[ Download Code ] | [ Download Help ]
Many programmers out there in the code wise community, and those that are in your everyday office life, may state that implementing a strong encryption is a very difficult chore. It is a difficult task, but with a little ground work, any difficult task becomes easy. We've covered most of the aspects of the DES and Triple DES encryption. In a total of 350 lines of code including comments, we've implemented one of the most widely-used encryption algorithms available.
Key points to remember:
- Triple DES is as secure as your Private-Key and Initialization Vector.
- It is best to research the different types of encryption algorithms to ensure your choice is the right one for the job.
- The DES-base algorithms have been broken in the past. However, realistically, Triple DES is more than enough in terms of encryption strength for most of our applications.
- NEVER lose the Private-Key, Initialization Vector, and Cipher Mode combination per encryption. Without all three parts absolutely correct, you may never decrypt the original data.
- The example source may work as is but may require some alterations to fit your applications needs.
- Read, read, read. Test, fail, test again. Always try what you've read, and continue to keep your knowledge up to date.
Salted MD5, Triple DES, Rijndael (AES), Blowfish, and RSA are common encryption algorithms used in the programming world today to safely store sensitive information. Prior to jumping on a technology, it's to your best interest to know the overall details of each encryption algorithm including their flaws before deciding on the exact one you wish to implement.
For further reading on cryptography with the .NET Framework, you may visit the following sites.
- http://msdn.microsoft.com/library/en-us/cpqstart/html/cpsmpnetsamples-howtocryptography.asp?frame=true
- http://www.gotdotnet.com/team/clr/cryptofaq.htm
- http://www.ftponline.com/vsm/2003_03/magazine/features/vandersypen/
- http://www.developer.com/net/net/article.php/1548761
- http://csrc.nist.gov/CryptoToolkit/aes/rijndael/
- http://labmice.techtarget.com/security/crypto.htm
- http://searchsecurity.techtarget.com/tip/0,289483,sid14_gci968714,00.html
- http://www.itl.nist.gov/fipspubs/fip46-2.htm
- http://www.laynetworks.com/des.htm (JavaScript source)
- http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation
- http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemsecuritycryptographytripledesclasstopic.asp?frame=truehttp://www.tropsoft.com/strongenc/des.htm