Improved encryption/decryption