Last active
September 17, 2016 20:54
-
-
Save xtrasmal/f9506fb77fb169075e539e0e4f97a160 to your computer and use it in GitHub Desktop.
AES encrypt mysql fields. Needs VARBINARY(112) columntypes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT into encrypted_data (encrypted) VALUES (AES_ENCRYPT('let us hide this stuff', 'secretkey')); | |
SELECT AES_DECRYPT(encrypted, 'secretkey') from encrypted_data WHERE AES_DECRYPT(encrypted, 'secretkey') LIKE '%hide%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment