This article includes a generic encryption & decryption class wrapper for C#. It also includes two extra algorithms BlowFish & TwoFish which are not included in standard .NET framework library.
The basic concept is from Frank Fang & William M. Rawls 's example code for SymmetricAlgorithm.
The BelowFish code is from Markus Hahn 's BelowFish source code.
The TwoFish code is from Shaun Wilde's ManyMonkey source code of TwoFish.
Please refer this website to get more information about BlowFish and TwoFish.
Using the code
The sample code initializes the engine to 3DES, you also can call
InitializeEngine again to reset the engine to a different algorithm.
XCryptEngine xe = new XCryptEngine();
enc_str = xe.Encrypt(src_str);
dec_str = xe.Decrypt(enc_str);
- 01/06/2003 - First package finished.