added functionality for encryption/decryption