Click here to Skip to main content
Click here to Skip to main content

XCrypt - encryption & decryption class wrapper

By , 18 Aug 2003
 

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

About the Author

pdwolf
Singapore Singapore
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5memberbitzhuwei4 Jan '13 - 14:43 
GeneralMy vote of 3memberyogeshpatil.psspl1 Jan '12 - 20:14 
Questionpossibly stupid question, twofish IV/key static to 0's?memberVertigo00712 Sep '11 - 12:20 
Generalgot error in using BlowFish decryptionmemberthefalcon7927 Mar '10 - 10:15 
Generalcan't compile this projectmemberMember 365176815 Feb '10 - 4:22 
QuestionWhat about to use this code???memberMichael Schaller18 Jun '08 - 12:08 
AnswerRe: What about to use this code???memberpdwolf25 Jun '08 - 4:12 
NewsTwo other related encryption articles in CodeProject ...memberTony Selke27 Sep '07 - 7:12 
GeneralRe: Two other related encryption articles in CodeProject ...memberVerifier30 Sep '07 - 22:45 
AnswerRe: Two other related encryption articles in CodeProject ...memberTony Selke1 Oct '07 - 2:10 
Generalcannot decrypt in phpmemberMihai Dobrescu15 Feb '07 - 10:20 
GeneralDoesn't decrypt in VS 2005memberjtang12327 Mar '06 - 14:46 
GeneralNot able to Decryptmemberglthomas2913 Jan '06 - 3:40 
GeneralRe: Not able to DecryptmemberShawn Bass18 Jan '06 - 5:25 
GeneralA little fix about key generator strategymemberNigai27 Jul '05 - 4:12 
GeneralMinimum OS RequirementsmemberaBrookland25 Jul '05 - 4:14 
GeneralRe: Minimum OS Requirementsmemberpdwolf1 Aug '05 - 14:11 
GeneralRe: Minimum OS Requirementsmemberborcondex18 Oct '05 - 8:33 
Generalsomething is wrongmemberphatrice937 Jul '05 - 16:55 
GeneralSpeed runmembergodfathers17 Mar '05 - 23:01 
GeneralRe: Speed runmemberAshok Dhamija31 Dec '05 - 4:47 
Questionencrypting öäu??memberDavid30017 May '04 - 3:22 
AnswerRe: encrypting öäu??memberMarcus E25 Oct '04 - 12:35 
GeneralRe: encrypting öäu??memberSk8tz10 Mar '05 - 0:10 

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

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