Skip to content

Instantly share code, notes, and snippets.

@rtipton
Created March 20, 2010 16:25
Show Gist options
  • Save rtipton/338750 to your computer and use it in GitHub Desktop.
Save rtipton/338750 to your computer and use it in GitHub Desktop.
SQL -- EncryptByPassPhrase
SELECT EncryptByPassPhrase('Test-String', 'Bazinga') AS EncryptedString
--result encrypted value: 0x0100000058324693D3274FE65F2E975F9637059632CC3C9FD4C96F9E
SELECT CONVERT(VARCHAR(100),DecryptByPassPhrase('Test-String'
, 0x0100000058324693D3274FE65F2E975F9637059632CC3C9FD4C96F9E)) AS DeEncryptedString
--result decrypted value : Bazinga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment