Main file. Key enchange