示例#1
0
 private void btnDecodeText_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[];
         txtOutputText.Text = GetString(objMahoa.Decipher(plain));
     }
 }
示例#2
0
        private void btnDecodeFile_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.Decipher(fi, fo);
        }