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)); } }
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); }