encryption/decryption fixes