implemented encyption/decryption