Ejemplo n.º 1
0
 private void btnEncrypt_Click(object sender, EventArgs e)
 {
     try
     {
         var block         = new Block();
         var crpytionLogic = new CryptionLogic();
         this.rTxtOutput.AppendText(DateTime.Now.ToLongTimeString() + " Encrypt: " + this.txtTextField.Text.Trim() + " Key: " + this.txtKeyField.Text.Trim());
         this.rTxtOutput.AppendText(Environment.NewLine);
         var outPut = crpytionLogic.Encrpyt1(this.txtTextField.Text.Trim(), this.txtKeyField.Text.Trim());
         this.rTxtOutput.AppendText("Output: " + block.ConvertBinariesToText(outPut));
         this.rTxtOutput.AppendText(Environment.NewLine);
         this.rTxtOutput.AppendText("Binary: " + (outPut));
         this.rTxtOutput.AppendText(Environment.NewLine);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something happend. Error: " + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 2
0
 public void Init()
 {
     _logic = new CryptionLogic();
     _block = new Block();
     _key   = new CryptionKey();
 }