SIGN UP MEMBER LOGIN:    
ARTICLE

Symmetric Encryptor Beta1

Posted by Saurabh Nandu Articles | Cryptography C# January 11, 2000
Free to use Encrypt/Decrypt using 2 Symmetric Algorithms 'DES' and 'RC2' coded in C#.
Reader Level:
Download Files:
 

Assemblies Used

  • System.IO
  • System.Security
  • System.Security.Cryptography

Free to use Encryptor / Decryptor using 2 Symmetric Algorithms 'DES' and 'RC2' coded in C#.

Installation Instructions

  • Unzip the zip file in to any directory (Remember to keep 'Use folder names' checked ON in your unzipping program).
  • Then go to the 'source' directory and click 'compile.bat' .

Files

  • ReadMe.txt - This File.
  • SymEncryptor.exe - Sample Program which can encrypt / decrypt any file using any of the 2 symmetric algorithm 'DES' or 'RC2'.

    [Source Directory]

    source>SymEncryptor.cs - Full commented Source Code for the SymEncryptor.exe
    source>compile.bat - a Batch file to compile the above source code.

Explaination

Cryptography is basically of 2 types Asymmetric and Symmetric. Asymmetric encryption is based on the concept of Public and Private Key's. On the other hand Symmetric encryption is based on a single 'Key' . Hence it upto the person to first send the password to the receiver of the file so that he can decrypt it.

In this example we learn how to use two of the Symmetric encryption algorithms namely Data Encryption Standard (DES) and RC2. Both these are Key based algorithms. Here we use 64 bit encryption in DES and 40 bit encryption in RC2 . Also in this example you will learn how to write your own implementations of the "ICryptoStream" interface.

To encrypt the file the user has to select the file to encrypt and the file to save the encrypted data in. The file gets encrypted with the password provided by the user using either of the two algorithms selected by the user. Decryption checks the input file for validity and the algorithm used in encryption automatically. So you do not have to provide with the encryption algorithm used. The program reads it from the automatically from the encrypted file. If the password provided for decryption is same as the one used for encryption then the file will decrypt. Both binary and text files can be encrypted / decrypted .

Requirements

.NET Framework Installed.

Disclaimer

This program is for demo purpose and the author is not responsible for any damage caused to the user of this program in any way.

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Become a Sponsor