12,999,417 members (84,377 online)
Rate this:
See more: , +
how to do Encryption and Decryption the file in asp.net???
Posted 1-Nov-12 19:57pm
Deenuji3.9K

Rate this:

## 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
Rate this:

## 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#)

http://en.wikipedia.org/wiki/RSA_(algorithm)[^]
Rate this:

## Solution 4

Hi,

Public Key RSA Encryption in C# .NET[^]
Rate this:

## 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;```
v2

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

Top Experts
Last 24hrsThis month
 RickZeeland 185 OriginalGriff 50 Raghu112 50 Bharat Leel 35 Jochen Arndt 30
 OriginalGriff 4,547 ppolymorphe 2,272 RickZeeland 2,107 Kornfeld Eliyahu Peter 1,973 Richard Deeming 1,593

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 24 Nov 2013