RSS Forums RSS

Data Encryption and Decryption

Please support our C# advertiser: DiscountASP.NET – 3 Months Free on C# Web Hosting
Reply
Posts: 39
Reputation: btech_Saurabh is an unknown quantity at this point 
Solved Threads: 2
btech_Saurabh's Avatar
btech_Saurabh btech_Saurabh is offline Offline
Light Poster

Data Encryption and Decryption

  #1  
Jan 7th, 2008
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......
AddThis Social Bookmark Button
Reply With Quote  
Posts: 171
Reputation: Jugortha is an unknown quantity at this point 
Solved Threads: 16
Jugortha Jugortha is offline Offline
Junior Poster

Re: Data Encryption and Decryption

  #2  
Jan 7th, 2008
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
Reply With Quote  
Posts: 39
Reputation: btech_Saurabh is an unknown quantity at this point 
Solved Threads: 2
btech_Saurabh's Avatar
btech_Saurabh btech_Saurabh is offline Offline
Light Poster

Re: Data Encryption and Decryption

  #3  
Jan 7th, 2008
Okay.....i'll try it.......thanx Jugortha......
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 2407 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:19 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC