using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace PwdMirror_04 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { String englishString = inE.Text; String assemble = ""; char output = 'a'; int length = englishString.Length; char[] smallEnglish = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; char[] capitalEnglish = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; char[] smallGreek = { 'α', 'β', 'c', 'δ', 'ε', 'φ', 'γ', 'η', 'ι', 'j', 'κ', 'λ', 'μ', 'ν', 'ο', 'π', 'θ', 'ρ', 'σ', 'τ', 'υ', 'ψ', 'ω', 'χ', 'ξ', 'ζ' }; char[] capitalGreek = { 'Α', 'Β', 'C', 'Δ', 'Ε', 'Φ', 'Γ', 'Η', 'Ι', 'J', 'Κ', 'Λ', 'Μ', 'Ν', 'Ο', 'Π', 'Θ', 'Ρ', 'Σ', 'Τ', 'Υ', 'Ψ', 'Ω', 'Χ', 'Ξ', 'Ζ' }; int flag_match = 0; int k; int m; for (k = 0; k < length; k++) { flag_match = 0; for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == smallEnglish[m]) { output = smallGreek[m]; flag_match = 1; } else output = englishString[k]; } } if (flag_match == 0) { for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == capitalEnglish[m]) { output = capitalGreek[m]; flag_match = 1; } else output = englishString[k]; } } } assemble = assemble + output; } outG.Text = assemble; String assemble2 = ""; for (m = 0; m < 26; m++) { assemble2 += smallEnglish[m]; } String assemble3 = ""; for (m = 0; m < 26; m++) { assemble3 += smallGreek[m]; } String assemble4 = ""; for (m = 0; m < 26; m++) { assemble4 += capitalEnglish[m]; } String assemble5 = ""; for (m = 0; m < 26; m++) { assemble5 += capitalGreek[m]; } IoMap.Text = assemble2 + "\n" + assemble3 + "\n" + assemble4 + "\n" + assemble5; } private void richTextBox2_TextChanged(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { String englishString = inE.Text; String assemble = ""; char output = 'a'; int length = englishString.Length; char[] smallEnglish = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; char[] capitalEnglish = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; char[] smallCyrillic = { 'а', 'б', 'ш', 'д', 'е', 'ф', 'г', 'ч', 'и', 'Ш', 'к', 'л', 'м', 'н', 'о', 'п', 'ю', 'р', 'с', 'т', 'у', 'щ', 'ы', 'х', 'з', 'ж' }; char[] capitalCyrillic = { 'А', 'Б', 'Ш', 'Д', 'Е', 'Ф', 'Г', 'Ч', 'И', 'Ј', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Ю', 'Р', 'С', 'Т', 'У', 'Щ', 'Ы', 'Х', 'З', 'Ж' }; int flag_match = 0; int k; int m; for (k = 0; k < length; k++) { flag_match = 0; for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == smallEnglish[m]) { output = smallCyrillic[m]; flag_match = 1; } else output = englishString[k]; } } if (flag_match == 0) { for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == capitalEnglish[m]) { output = capitalCyrillic[m]; flag_match = 1; } else output = englishString[k]; } } } assemble = assemble + output; } outG.Text = assemble; String assemble2 = ""; for (m = 0; m < 26; m++) { assemble2 += smallEnglish[m]; } String assemble3 = ""; for (m = 0; m < 26; m++) { assemble3 += smallCyrillic[m]; } String assemble4 = ""; for (m = 0; m < 26; m++) { assemble4 += capitalEnglish[m]; } String assemble5 = ""; for (m = 0; m < 26; m++) { assemble5 += capitalCyrillic[m]; } IoMap.Text = assemble2 + "\n" + assemble3 + "\n" + assemble4 + "\n" + assemble5; } private void doN_Click(object sender, EventArgs e) { String englishString = inE.Text; String assemble = ""; char output = 'a'; int length = englishString.Length; char[] smallEnglish = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; char[] capitalEnglish = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; char[] smallNumeric = { '9', '6', '0', '6', '8', '4', '9', '8', '1', '2', '3', '1', '3', '4', '0', '6', '9', '4', '6', '2', '5', '7', '3', '4', '7', '5' }; char[] capitalNumeric = { '4', '8', '6', '0', '3', '7', '6', '4', '7', '5', '2', '7', '3', '4', '0', '9', '2', '9', '5', '7', '1', '2', '3', '4', '1', '6' }; int flag_match = 0; int k; int m; for (k = 0; k < length; k++) { flag_match = 0; for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == smallEnglish[m]) { output = smallNumeric[m]; flag_match = 1; } else output = englishString[k]; } } if (flag_match == 0) { for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == capitalEnglish[m]) { output = capitalNumeric[m]; flag_match = 1; } else output = englishString[k]; } } } assemble = assemble + output; } outG.Text = assemble; String assemble2 = ""; for (m = 0; m < 26; m++) { assemble2 += smallEnglish[m]; } String assemble3 = ""; for (m = 0; m < 26; m++) { assemble3 += smallNumeric[m]; } String assemble4 = ""; for (m = 0; m < 26; m++) { assemble4 += capitalEnglish[m]; } String assemble5 = ""; for (m = 0; m < 26; m++) { assemble5 += capitalNumeric[m]; } IoMap.Text = assemble2 + "\n" + assemble3 + "\n" + assemble4 + "\n" + assemble5; } private void doInst_Click(object sender, EventArgs e) { outG.Text = "This Out box shows the result of alphabetic substitution. Push the Greek button to see the In box instructions be mirrored as Greek letters in the Out box. See greekalphabet.blogspot.com or write toyon@live.com People may find this Password Mirror to be useful for purposes that are linguistic, artistic, educational, and cryptographic."; IoMap.Text = "This box normally shows 4 lines that define the alphabetic substitution (transliteration). When a button is pushed for Greek, Cyrillic, or other substitutions, the Map is used as follows: The first line shows small letters, the second line has the symbols that replace the small letters found in the In box. The third line has capital letters and the fourth line has the symbols that are put in the Out box to replace the Capital letters found in the In box. You can customize the Map and then push the Custom button to make the Out box mirror the In box according to your 4 lines of custom substitutions."; inE.Text = "This utility called Password Mirror takes any input characters and changes them to look like other symbols. Unicode is used. The In box is where you paste the English or other phrases. The Out box will hold the results of the alphabetic substitution. This may be useful to reflect something like your password without spelling it out. Print the output phrases on paper to leave the electronic domain. You can read the mirrored phrases after you train yourself."; } private void doClear_Click(object sender, EventArgs e) { outG.Text = " "; inE.Text = " "; IoMap.Text = " "; } private void doCu_Click(object sender, EventArgs e) { outG.Text = "Rev. 4.2 : Fixed the empty map problem. The custom map must have 26 letters on each line . There must be 4 lines. "; outG.Text += "You can reverse the mapping using a Wordpad editor, and for example, change Greek back to English. "; outG.Text += "The author of this program places it in the public domain. You are allowed to use and copy this program and its source code. "; outG.Text += "Not Copyrighted. \nToyon Jungle Technology\nproduced this C# program PwdMirror_04\n on September 14, 2009 in Kona, Hawaii."; } private void doAp_Click(object sender, EventArgs e) { outG.Text = ""; int flag_match = 0; char[] smallInput = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '8' }; char[] smallOutput = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '8' }; char[] capitalInput = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '8' }; char[] capitalOutput = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '8' }; String mapString = IoMap.Text; int length2 = mapString.Length; // inE.Text += " Map needs 104 characters (26 x 4) and 3 newlines. There are " + length2; if (length2 != 107) { outG.Text = "ERROR! The Map needs 104 characters (26 x 4) and 3 newlines not " + length2 +" "; length2 = 107; mapString = "11112222333344445555666677778888999900001111222233334444555566667777888899990000111122223333444455556666111"; } int k; length2 = (length2 - 3) / 4; for (k = 0; k < length2; k++) { smallInput[k] = mapString[k]; smallOutput[k] = mapString[length2 + k + 1]; capitalInput[k] = mapString[2 * length2 + k + 2]; capitalOutput[k] = mapString[3 * length2 + k + 3]; } String englishString = inE.Text; String assemble = ""; char output = 'a'; int m; int length = englishString.Length; for (k = 0; k < length; k++) { flag_match = 0; for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == smallInput[m]) { output = smallOutput[m]; flag_match = 1; } else output = englishString[k]; } } if (flag_match == 0) { for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == capitalInput[m]) { output = capitalOutput[m]; flag_match = 1; } else output = englishString[k]; } } } assemble = assemble + output; } outG.Text += assemble; } private void label4_Click(object sender, EventArgs e) { } private void button1_Click_1(object sender, EventArgs e) { String englishString = inE.Text; String assemble = ""; char output = 'a'; int length = englishString.Length; char[] smallEnglish = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; char[] capitalEnglish = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; char[] smallNumeric = { 'a', 'b', 'c', 'd', 'e', 'f', '9', '8', '1', '2', '3', '1', '3', '4', '0', '6', '9', '4', '6', '2', '5', '7', '3', '4', '7', '5' }; char[] capitalNumeric = { 'A', 'B', 'C', 'D', 'E', 'F', '6', '4', '7', '5', '2', '7', '3', '4', '0', '9', '2', '9', '5', '7', '1', '2', '3', '4', '1', '6' }; int flag_match = 0; int k; int m; for (k = 0; k < length; k++) { flag_match = 0; for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == smallEnglish[m]) { output = smallNumeric[m]; flag_match = 1; } else output = englishString[k]; } } if (flag_match == 0) { for (m = 0; m < 26; m++) { if (flag_match == 0) { if (englishString[k] == capitalEnglish[m]) { output = capitalNumeric[m]; flag_match = 1; } else output = englishString[k]; } } } assemble = assemble + output; } outG.Text = assemble; String assemble2 = ""; for (m = 0; m < 26; m++) { assemble2 += smallEnglish[m]; } String assemble3 = ""; for (m = 0; m < 26; m++) { assemble3 += smallNumeric[m]; } String assemble4 = ""; for (m = 0; m < 26; m++) { assemble4 += capitalEnglish[m]; } String assemble5 = ""; for (m = 0; m < 26; m++) { assemble5 += capitalNumeric[m]; } IoMap.Text = assemble2 + "\n" + assemble3 + "\n" + assemble4 + "\n" + assemble5; } } }