public void Encrypt2_Test() { var key = new KeySinglePermutation.Key(4, "СКАНЕР"); var input = new KeySinglePermutation.Input("СИСТЕМНЫЙ ПАРОЛЬ ИЗМЕНЕН", key); var output = Method.Encrypt(input); Assert.AreEqual("Й ЕРЕС ИМОНИПЗНЛЕСАМЫЬНТ", output.Value); }
public void Encrypt1_Test() { var key = new KeySinglePermutation.Key(3, "ПАМИР"); var input = new KeySinglePermutation.Input("ВРАГБУДЕТРАЗБИТ", key); var output = Method.Encrypt(input); Assert.AreEqual("ГРДВББАЕРИУЗТАТ", output.Value); }
public IActionResult EncryptKeySingleProtection([FromBody] 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)); }