Created
September 9, 2013 20:22
-
-
Save LinuxDoku/6500963 to your computer and use it in GitHub Desktop.
mysql encryption
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
CREATE TABLE `data` ( | |
`name` varchar(255) DEFAULT NULL, | |
`value` blob | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
insert into crypt_test.data values("hello.world", AES_ENCRYPT("test", SHA2("ld", 512))); | |
select CONVERT(AES_DECRYPT(value, SHA2("ld", 512)) using UTF8) as d FROM crypt_test.data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment