Exemplo n.º 1
0
 public string Decrypt(byte[] iv, byte[] cipher)
 {
     return(MachineKeyWrapper.DecryptString(HttpServerUtility.UrlTokenEncode(iv.Concat(cipher).ToArray())));
 }
Exemplo 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());
        }