Skip to content

Instantly share code, notes, and snippets.

@LinuxDoku
Created September 9, 2013 20:22
Show Gist options
  • Save LinuxDoku/6500963 to your computer and use it in GitHub Desktop.
Save LinuxDoku/6500963 to your computer and use it in GitHub Desktop.
mysql encryption
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