Exemple #1
0
        public ActionResult ReadVersionToken(string versionToken)
        {
            var cipherBytes = MachineKeySectionWrapper.HexStringToByteArray(versionToken);
            var plainBytes  = MachineKeySectionWrapper.Decrypt(cipherBytes);
            var version     = Encoding.UTF8.GetString(plainBytes);

            return(this.Json(new { version = version }));
        }
Exemple #2
0
        public ActionResult Verify(string versionToken)
        {
            var cipherBytes = MachineKeySectionWrapper.HexStringToByteArray(versionToken);
            var plainBytes  = MachineKeySectionWrapper.Decrypt(cipherBytes);
            var plainText   = Encoding.UTF8.GetString(plainBytes);

            ViewBag.Version = plainText;

            return(this.Encrypt(plainText));
        }
Exemple #3
0
        public ActionResult Decrypt(string cipherText)
        {
            ViewBag.CipherText = cipherText;

            var cipherBytes = MachineKeySectionWrapper.HexStringToByteArray(cipherText);
            var plainBytes  = MachineKeySectionWrapper.Decrypt(cipherBytes);

            this.ViewBag.PlainText = Encoding.UTF8.GetString(plainBytes);

            return(this.View("Index"));
        }