Fixing the encoding

Fix the encryption and decryption problem