Updating Encrypt and Keygen