Click here to Skip to main content
11,432,627 members (62,465 online)
Click here to Skip to main content

XCrypt - encryption & decryption class wrapper

, 18 Aug 2003 Apache
Rate this:
Please Sign up or sign in to vote.
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, along with any associated source code and files, is licensed under The Apache License, Version 2.0

Share

About the Author

pdwolf

Singapore Singapore
No Biography provided

Comments and Discussions

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

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

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

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