Fixed bug for encryption and deryption.