prototype for encryption decryption