Click here to Skip to main content
6,595,444 members and growing! (19,141 online)
Email Password   helpLost your password?
General Programming » Cryptography & Security » Encryption     Intermediate License: The Apache License, Version 2.0

XCrypt - encryption & decryption class wrapper

By pdwolf

A generic encryption & decryption class wrapper for C#.
C#.NET 1.0, Win2K, Dev
Posted:18 Aug 2003
Views:79,249
Bookmarked:48 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
25 votes for this article.
Popularity: 5.95 Rating: 4.26 out of 5
1 vote, 4.0%
1
2 votes, 8.0%
2
3 votes, 12.0%
3
5 votes, 20.0%
4
14 votes, 56.0%
5

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


Member

Location: Singapore Singapore

Other popular Cryptography & Security articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 20 of 20 (Total in Forum: 20) (Refresh)FirstPrevNext
Generaljetlib Pingroupthe Jet Lib Team11:15 15 Jun '09  
GeneralWhat about to use this code??? PinmemberMichael Schaller13:08 18 Jun '08  
GeneralRe: What about to use this code??? Pinmemberpdwolf5:12 25 Jun '08  
NewsTwo other related encryption articles in CodeProject ... PinmemberTony Selke8:12 27 Sep '07  
GeneralRe: Two other related encryption articles in CodeProject ... PinmemberVerifier23:45 30 Sep '07  
AnswerRe: Two other related encryption articles in CodeProject ... PinmemberTony Selke3:10 1 Oct '07  
Generalcannot decrypt in php PinmemberMihai Dobrescu11:20 15 Feb '07  
GeneralDoesn't decrypt in VS 2005 Pinmemberjtang12315:46 27 Mar '06  
GeneralNot able to Decrypt Pinmemberglthomas294:40 13 Jan '06  
GeneralRe: Not able to Decrypt PinmemberShawn Bass6:25 18 Jan '06  
GeneralA little fix about key generator strategy PinmemberNigai5:12 27 Jul '05  
GeneralMinimum OS Requirements PinmemberaBrookland5:14 25 Jul '05  
GeneralRe: Minimum OS Requirements Pinmemberpdwolf15:11 1 Aug '05  
GeneralRe: Minimum OS Requirements Pinmemberborcondex9:33 18 Oct '05  
Generalsomething is wrong Pinmemberphatrice9317:55 7 Jul '05  
GeneralSpeed run Pinmembergodfathers0:01 18 Mar '05  
GeneralRe: Speed run PinmemberAshok Dhamija5:47 31 Dec '05  
Generalencrypting öäu?? PinmemberDavid30014:22 7 May '04  
GeneralRe: encrypting öäu?? PinmemberMarcus E13:35 25 Oct '04  
GeneralRe: encrypting öäu?? PinmemberSk8tz1:10 10 Mar '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 18 Aug 2003
Editor: Smitha Vijayan
Copyright 2003 by pdwolf
Everything else Copyright © CodeProject, 1999-2009
Web16 | Advertise on the Code Project