string EncryptedString= Encrypt("STRING VALUE");
------------------------------------------ public string Encrypt(string Data) { SHA1Managed shaM = new SHA1Managed(); Convert.ToBase64String(shaM.ComputeHash(System.Text.Encoding.ASCII.GetBytes(Data))); byte[] eNC_data = System.Text.ASCIIEncoding.ASCII.GetBytes(Data); string eNC_str = Convert.ToBase64String(eNC_data); return eNC_str; }
string DecryptedString= Decrypt("Encryptedsrting");
------------------------------------------------------------------------------------------------ string original_string=Decrypt(eNC_str);
private string Decrypt(string Data) { byte[] dEC_data = Convert.FromBase64String(Data); string dEC_Str = System.Text.ASCIIEncoding.ASCII.GetString(dEC_data); return dEC_Str; }