How To Encrypt And Decrypt Highly Sensitive Information In Sql Server Database With Asp Classic?
Solution 1:
It may well be beneficial to allow SQL Server to handle the encryption/decryption using Keys/Certificates. This way, you don't have to roll your own with ASP and the management of this system is kept where the data itself resides. There is also the benefit of not having to update this process should you decide to move to another platform.
It is a simple process to create the Keys on the server and use of them after this point is also simple, for example;
Encrypt;
OPENSYMMETRIC KEY mykey DECRYPTION BY CERTIFICATE [mycert]
UPDATEtableSET number = EncryptByKey(Key_GUID('mykey'), @number)
Decrypt;
OPENSYMMETRIC KEY mykey DECRYPTION BY CERTIFICATE [mycert]
SELECTCONVERT(varchar, DecryptByKey(number)) AS number FROMTABLEA good overview of this can be found here Introduction to SQL Server Encryption
Solution 2:
You can use the Rinjdael cipher successfully in VBScript with this library. The key functions are EncryptData() and DecryptData().
It seems secure enough for me. Obviously you will want to keep your key pretty secret. An application variable in the global.asa might be a good place to store this (as that's usually where connection strings and such are found).
Post a Comment for "How To Encrypt And Decrypt Highly Sensitive Information In Sql Server Database With Asp Classic?"