The data-encryption function

Since Hive v1.3.o, aes_encrypt(input string/binary, key string/binary) and aes_decrypt(input binary, key string/binary) UDF have been provided to support data encryption and decryption using the AES (Advanced Encryption Standard: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) algorithm, which is a symmetric 128-bit, block-data encryption technique developed by Belgian cryptographers Joan Daemen and Vincent Rijmen.

The following is an example of using these functions:

-- 1st para. is value to encryped/decryped-- 2nd para. is 128 bit (16 Byte) keys> SELECT> name,> aes_encrypt(name,'1234567890123456') as encrypted,> aes_decrypt(> aes_encrypt(name,'1234567890123456'),> '1234567890123456') as decrypted ...

Get Apache Hive Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.