Click here to Skip to main content
16,012,116 members

Comments by Member 11026295 (Top 17 by date)

Member 11026295 25-Nov-14 13:04pm View    
explain how its works
Member 11026295 13-Oct-14 5:34am View    
I stored encrypt image in one of image button.If we click on the Image it ask for key and if key is correct i want to download the file
Member 11026295 25-Sep-14 7:15am View    
there is any way to disable right click
Member 11026295 25-Sep-14 6:46am View    
I have a pdf file in a folder.I want to disable copy paste in that file. how?
Member 11026295 24-Sep-14 7:06am View    
private string Decrypt(string cipherText)
{
Panel_download.Visible = false;
Panel_decrypt.Visible = true;
String EncryptionKey = txt_key.Text;

byte[] cipherBytes = Convert.FromBase64String(cipherText);
using (Aes encryptor = Aes.Create())
{
Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
encryptor.Key = pdb.GetBytes(32);
encryptor.IV = pdb.GetBytes(16);
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
{
cs.Write(cipherBytes, 0, cipherBytes.Length);
cs.Close();
}
cipherText = Encoding.Unicode.GetString(ms.ToArray());
}
}
return cipherText;
This is code for decrypting