5,693,062 members and growing! (16,908 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, Windows, .NETVisual Studio, VS.NET2002, Dev

Posted: 18 Aug 2003
Updated: 18 Aug 2003
Views: 70,932
Bookmarked: 44 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
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



Location: Singapore Singapore

Other popular Cryptography & Security articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 19 of 19 (Total in Forum: 19) (Refresh)FirstPrevNext
GeneralWhat about to use this code???memberMichael Schaller13:08 18 Jun '08  
GeneralRe: What about to use this code???memberpdwolf5:12 25 Jun '08  
NewsTwo other related encryption articles in CodeProject ...memberTony Selke8:12 27 Sep '07  
GeneralRe: Two other related encryption articles in CodeProject ...memberVerifier23:45 30 Sep '07  
AnswerRe: Two other related encryption articles in CodeProject ...memberTony Selke3:10 1 Oct '07  
Generalcannot decrypt in phpmemberMihai Dobrescu11:20 15 Feb '07  
GeneralDoesn't decrypt in VS 2005memberjtang12315:46 27 Mar '06  
GeneralNot able to Decryptmemberglthomas294:40 13 Jan '06  
GeneralRe: Not able to DecryptmemberShawn Bass6:25 18 Jan '06  
GeneralA little fix about key generator strategymemberNigai5:12 27 Jul '05  
GeneralMinimum OS RequirementsmemberaBrookland5:14 25 Jul '05  
GeneralRe: Minimum OS Requirementsmemberpdwolf15:11 1 Aug '05  
GeneralRe: Minimum OS Requirementsmemberborcondex9:33 18 Oct '05  
Generalsomething is wrongmemberphatrice9317:55 7 Jul '05  
GeneralSpeed runmembergodfathers0:01 18 Mar '05  
GeneralRe: Speed runmemberAshok Dhamija5:47 31 Dec '05  
Generalencrypting öäu??memberDavid30014:22 7 May '04  
GeneralRe: encrypting öäu??memberMarcus E13:35 25 Oct '04  
GeneralRe: encrypting öäu??memberSk8tz1: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-2008
Web12 | Advertise on the Code Project