private void Encrypt(object sender, EventArgs e) { string keystring = Key.Text.Trim(); byte[] key = Encoding.Unicode.GetBytes(keystring); byte[] input = Encoding.Unicode.GetBytes(EnterText.Text); string returnstring = ""; int keyindex = 0; int counter = 0; foreach (byte CHAR in input) { returnstring += (char)(CHAR + 10); keyindex++; counter++; } Return.Text = returnstring; }
private void Decrypt(object sender, EventArgs e) { string keystring = Key.Text.Trim(); byte[] key = Encoding.Unicode.GetBytes(keystring); byte[] input = Encoding.Unicode.GetBytes(EnterText.Text); string returnstring = ""; int keyindex = 0; int counter = 0; foreach (byte CHAR in input) { returnstring += (char)(CHAR - 10); keyindex++; counter++; } Return.Text = returnstring; }
|