Click here to Skip to main content
13,560,290 members
Click here to Skip to main content
Add your own
alternative version


72 bookmarked
Posted 18 Aug 2003
Licenced Apache

XCrypt - encryption & decryption class wrapper

, 18 Aug 2003
Rate this:
Please Sign up or sign in to vote.
A generic encryption & decryption class wrapper for C#.


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.


This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


About the Author

Singapore Singapore
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
bitzhuwei4-Jan-13 14:43
memberbitzhuwei4-Jan-13 14:43 
GeneralMy vote of 3 Pin
yogeshpatil.psspl1-Jan-12 20:14
memberyogeshpatil.psspl1-Jan-12 20:14 
Questionpossibly stupid question, twofish IV/key static to 0's? Pin
Vertigo00712-Sep-11 12:20
memberVertigo00712-Sep-11 12:20 
Generalgot error in using BlowFish decryption Pin
thefalcon7927-Mar-10 10:15
memberthefalcon7927-Mar-10 10:15 
Generalcan't compile this project Pin
Member 365176815-Feb-10 4:22
memberMember 365176815-Feb-10 4:22 
QuestionWhat about to use this code??? Pin
Michael Schaller18-Jun-08 12:08
memberMichael Schaller18-Jun-08 12:08 
AnswerRe: What about to use this code??? Pin
pdwolf25-Jun-08 4:12
memberpdwolf25-Jun-08 4:12 
NewsTwo other related encryption articles in CodeProject ... Pin
Tony Selke27-Sep-07 7:12
memberTony Selke27-Sep-07 7:12 
GeneralRe: Two other related encryption articles in CodeProject ... Pin
Verifier30-Sep-07 22:45
memberVerifier30-Sep-07 22:45 
AnswerRe: Two other related encryption articles in CodeProject ... Pin
Tony Selke1-Oct-07 2:10
memberTony Selke1-Oct-07 2:10 
Generalcannot decrypt in php Pin
Mihai Dobrescu15-Feb-07 10:20
memberMihai Dobrescu15-Feb-07 10:20 
GeneralDoesn't decrypt in VS 2005 Pin
jtang12327-Mar-06 14:46
memberjtang12327-Mar-06 14:46 
GeneralNot able to Decrypt Pin
glthomas2913-Jan-06 3:40
memberglthomas2913-Jan-06 3:40 
GeneralRe: Not able to Decrypt Pin
Shawn Bass18-Jan-06 5:25
memberShawn Bass18-Jan-06 5:25 
GeneralA little fix about key generator strategy Pin
Nigai27-Jul-05 4:12
memberNigai27-Jul-05 4:12 
GeneralMinimum OS Requirements Pin
aBrookland25-Jul-05 4:14
memberaBrookland25-Jul-05 4:14 
GeneralRe: Minimum OS Requirements Pin
pdwolf1-Aug-05 14:11
memberpdwolf1-Aug-05 14:11 
GeneralRe: Minimum OS Requirements Pin
borcondex18-Oct-05 8:33
memberborcondex18-Oct-05 8:33 
Generalsomething is wrong Pin
phatrice937-Jul-05 16:55
memberphatrice937-Jul-05 16:55 
GeneralSpeed run Pin
godfathers17-Mar-05 23:01
membergodfathers17-Mar-05 23:01 
GeneralRe: Speed run Pin
Ashok Dhamija31-Dec-05 4:47
memberAshok Dhamija31-Dec-05 4:47 
Questionencrypting öäu?? Pin
David30017-May-04 3:22
memberDavid30017-May-04 3:22 
AnswerRe: encrypting öäu?? Pin
Marcus E25-Oct-04 12:35
memberMarcus E25-Oct-04 12:35 
GeneralRe: encrypting öäu?? Pin
Sk8tz10-Mar-05 0:10
memberSk8tz10-Mar-05 0:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.180527.3 | Last Updated 19 Aug 2003
Article Copyright 2003 by pdwolf
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid