Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

XCrypt - encryption & decryption class wrapper

0.00/5 (No votes)
18 Aug 2003 1  
A generic encryption & decryption class wrapper for C#.

Introduction

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.

Background

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();
...
xe.InitializeEngine(XCryptEngine.AlgorithmType.TripleDES);

enc_str = xe.Encrypt(src_str);
dec_str = xe.Decrypt(enc_str);

xe.DestroyEngine();

History

  • 01/06/2003 - First package finished.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here