954,170 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Data Encryption and Decryption

Hi Developers.......

Can anybody help me......I have an array and i want to enrypt that array and save that encrypted data into a file .......how can i do this...... i don't know ....how to do Encrytion in C#

Every Comment will be welcome....
Thanks......

btech_Saurabh
Light Poster
39 posts since Jan 2008
Reputation Points: 10
Solved Threads: 2
 

There are for algorithms of encryption/decryption with in the .Net framework

DES algorithm, RC2 algorithm, Rijindael algorithm and TripleDES algorithm they are represented as classes

First step is to include directive of cryptography
witch is System.Security.Cryptography

Second step is to create your own key, to do that
string password = // you can put here your password
UnicodeEncoding objectEncoding= new UnicodeEncoding();
byte[] key = objectEncoding.GetBytes(password);

third step is to create a stream where the encipted data will be putted

FileStream CryptedFile=new FileStream(cryptFile, FileMode.Create);

encrypt the contents

RijndaelManaged Crpt= new RijndaelManaged();
CryptoStream Encryptor= new CryptoStream(cryptedFile, Crpt.CreateEncryptor(key, key), CryptoStreamMode.Write);

And the the data encryption is done according to the Rajindael algorythm
u can use another algorithms like the DES or u can develop your own encryption algorithm

Jugortha
Junior Poster
172 posts since Oct 2007
Reputation Points: 11
Solved Threads: 16
 

Okay.....i'll try it.......thanx Jugortha......

btech_Saurabh
Light Poster
39 posts since Jan 2008
Reputation Points: 10
Solved Threads: 2
 

I'm trying to write the data encryption and decryption by using MISTY Algorithm with Java Language. So I need to help all of you. Can you help me for my coding? Please help me.

aungzy24
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You