Solved the encryption and decryption issue