Error handling for encryption.