Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
how to do Encryption and Decryption the file in asp.net???
Posted 1-Nov-12 20:57pm
Deenuji3.8K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Considering you want to encrypt and then decrypt (when needed) content of some file, try article at File Encryption and Decryption in C#[^]
 
I believe it should serve the purpose.
 
-Milind
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I thinks you should first understand the basic concept of Encryption and Decryption Algorithm
Ex. Learn more about RSA, MD5 algorithms ie how these algorithms work Theoretically then implement in any Lang(C#,F#,VB.net,J#)
 

Link : http://www.di-mgt.com.au/rsa_alg.html[^]
 

http://en.wikipedia.org/wiki/RSA_(algorithm)[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Hi,
 
I think this article can help you:
Public Key RSA Encryption in C# .NET[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

1st write this function on your page:

public static string ConvertToBin(string asciiString)
   {
       StringBuilder sb = new StringBuilder();
       foreach (string letter in asciiString.Select(c => Convert.ToString(c, 8)))
       {
           sb.Append(letter);
       }
       return sb.ToString().Substring(0,5);
   }
then write this coding where u want to show ur encrypt key like textbox means write like this it show 5 digit encrypt key:

TextBox1.Text = ConvertToBin(a);
TextBox2.Text = ConvertToBin(content.Substring(content.Length - 5, 5)); RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
TextBox3.Text = ConvertToBin(rsa.ToXmlString(true).Substring(15, 5));
TextBox4.Text = ConvertToBin(rsa.ToXmlString(true).Substring(15, 5));
TextBox5.Text = ConvertToBin(rsa.ToXmlString(true).Substring(22, 5));
TextBox6.Text = content;
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 562
1 Sergey Alexandrovich Kryukov 484
2 Maciej Los 325
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 24 Nov 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100