Skip to content

Instantly share code, notes, and snippets.

@anytizer
Created November 30, 2013 11:17
Show Gist options
  • Select an option

  • Save anytizer/7717822 to your computer and use it in GitHub Desktop.

Select an option

Save anytizer/7717822 to your computer and use it in GitHub Desktop.
Encode/Decode verification in MySQL
SELECT ENCODE('mytext', 'mykey');
SELECT AES_ENCRYPT('mytext', 'mykey');
SELECT DECODE(ENCODE('mytext', 'mykey'), 'mykey')='mytext' ok;
SELECT AES_DECRYPT(AES_ENCRYPT('mytext', 'mykey'), 'mykey')='mytext' ok;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment