public void Decrypt2_Test()
        {
            var key    = new KeySinglePermutation.Key(3, "СКАНЕР");
            var output = new KeySinglePermutation.Output("Й ЕРЕС ИМОНИПЗНЛЕСАМЫЬНТ", key);
            var input  = Method.Decrypt(output);

            Assert.AreEqual("СИСТЕМНЫЙ ПАРОЛЬ ИЗМЕНЕН", input.Value);
        }
        public void Decrypt1_Test()
        {
            var key    = new KeySinglePermutation.Key(3, "ПАМИР");
            var output = new KeySinglePermutation.Output("ГРДВББАЕРИУЗТАТ", key);
            var input  = Method.Decrypt(output);

            Assert.AreEqual("ВРАГБУДЕТРАЗБИТ", input.Value);
        }
        public IActionResult DecryptKeySinglePermutation([FromBody] KeySinglePermutationModel.OutputModel outputModel)
        {
            var method = new KeySinglePermutation();
            var key    = new KeySinglePermutation.Key(outputModel.Key.RowCount, outputModel.Key.KeyWord);
            var output = new KeySinglePermutation.Output(outputModel.Value, key);
            var input  = method.Decrypt(output);

            var result = new KeySinglePermutationModel()
            {
                Input = new KeySinglePermutationModel.InputModel()
                {
                    Key   = outputModel.Key,
                    Value = input.Value
                },
                Output = outputModel
            };

            return(View("KeySingleProtection", result));
        }
        public ActionResult EncryptKeySingleProtection(KeySinglePermutationModel.InputModel inputModel)
        {
            var method = new KeySinglePermutation();
            var key    = new KeySinglePermutation.Key(inputModel.Key.RowCount, inputModel.Key.KeyWord);
            var input  = new KeySinglePermutation.Input(inputModel.Value, key);
            var output = method.Encrypt(input);

            var result = new KeySinglePermutationModel()
            {
                Input  = inputModel,
                Output = new KeySinglePermutationModel.OutputModel()
                {
                    Key   = inputModel.Key,
                    Value = output.Value
                }
            };

            return(View("KeySingleProtection", result));
        }