Example #1
0
        public static string Decrypt(string[] data, PathProvider p)
        {
            WebBase64 sessionMaterial = (WebBase64)data[0];
            WebBase64 cipherText = (WebBase64)data[1];
            string output;

            //PathProvider pathProvider = new PathProvider();
            string path1 = p.GetPrivatePath();

            //string path1 = HostingEnvironment.ApplicationPhysicalPath + "encryption";

            using (var crypter = new Crypter(path1))
            using (var sessionCrypter = new SessionCrypter(crypter, sessionMaterial))
            {
                output = sessionCrypter.Decrypt(cipherText);

            }
            return output;
        }