Esempio n. 1
0
 public string Decrypt(byte[] iv, byte[] cipher)
 {
     return(MachineKeyWrapper.DecryptString(HttpServerUtility.UrlTokenEncode(iv.Concat(cipher).ToArray())));
 }
Esempio n. 2
0
        public byte[] Encrypt(string clearText)
        {
            var bytes = HttpServerUtility.UrlTokenDecode(MachineKeyWrapper.EncryptString(clearText));

            return(Enumerable.Repeat <byte>(0, Program.BlockSize).Concat(bytes).ToArray());
        }