Пример #1
0
 private void btnEncodeText_Click(object sender, EventArgs e)
 {
     if (txtInputText.Text.Length > 0)
     {
         byte[] key = GetBytes("masohoc").Clone() as byte[];
         MaHoa objMahoa = new MaHoa(key);
         byte[] plain = GetBytes(txtInputText.Text).Clone() as byte[];
         byte[] tmp = FixBytes(plain);
         txtOutputText.Text = GetString(objMahoa.Encipher(tmp));
     }
 }
Пример #2
0
        private void btnEncodeFile_Click(object sender, EventArgs e)
        {
            string fi = txtFileIn.Text;
            string fo = txtFileOut.Text;

            byte[] key = GetBytes("masohoc");
            MaHoa objMahoa = new MaHoa(this);
            objMahoa.InitBoxes(key);
            objMahoa.Encipher(fi, fo);
        }