restart; with(Maplets[Elements]): rrep := proc(key) local i, nkey, skey; nkey := ""; skey := convert(convert(key,list), set); for i from 1 to length(key) do if member(key[i],skey) then nkey := cat(nkey, key[i]): skey := skey minus {key[i]}; fi: od: nkey: end: simpsubcipa := proc(key) local rkey, abet, cabet; abet := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; rkey := rrep(StringTools[Remove](rcurry( member, {" "} ), StringTools[UpperCase](convert(key, string)))); cabet := cat(rkey, (StringTools[Remove](rcurry( member, {op(convert(rkey, list))} ), StringTools[UpperCase](convert(abet, string))))); end: keycolsubcipa := proc(key) local rkey, abet, cabet, nr, nc, S, i, k, j; abet := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; rkey := rrep(StringTools[Remove](rcurry( member, {" "} ), StringTools[UpperCase](convert(key, string)))); cabet := cat(rkey, (StringTools[Remove](rcurry( member, {op(convert(rkey, list))} ), StringTools[UpperCase](convert(abet, string))))); nr := ceil(length(abet)/length(rkey)); nc := length(rkey); S := Matrix(nr,nc); ArrayTools[Fill]("", S); k := 0; for i from 1 to nr do for j from 1 to nc do k := k + 1: S[i,j] := substring(cabet, k); od: od: S := cat(op(convert(convert(S, Vector), list))); end: asetup := proc(type) if type = "Make you own" then Maplets:-Tools:-Set('KEYW' = "None Needed"); Maplets:-Tools:-Set('BA'('caption') = "Check Alphabet Assignment"); Maplets:-Tools:-Set('CT1'('editable') = 'true', 'CT1'('background') = 'white', 'CT1' = ""); Maplets:-Tools:-Set('CT2'('editable') = 'true', 'CT2'('background') = 'white', 'CT2' = ""); Maplets:-Tools:-Set('CT3'('editable') = 'true', 'CT3'('background') = 'white', 'CT3' = ""); Maplets:-Tools:-Set('CT4'('editable') = 'true', 'CT4'('background') = 'white', 'CT4' = ""); Maplets:-Tools:-Set('CT5'('editable') = 'true', 'CT5'('background') = 'white', 'CT5' = ""); Maplets:-Tools:-Set('CT6'('editable') = 'true', 'CT6'('background') = 'white', 'CT6' = ""); Maplets:-Tools:-Set('CT7'('editable') = 'true', 'CT7'('background') = 'white', 'CT7' = ""); Maplets:-Tools:-Set('CT8'('editable') = 'true', 'CT8'('background') = 'white', 'CT8' = ""); Maplets:-Tools:-Set('CT9'('editable') = 'true', 'CT9'('background') = 'white', 'CT9' = ""); Maplets:-Tools:-Set('CT10'('editable') = 'true', 'CT10'('background') = 'white', 'CT10' = ""); Maplets:-Tools:-Set('CT11'('editable') = 'true', 'CT11'('background') = 'white', 'CT11' = ""); Maplets:-Tools:-Set('CT12'('editable') = 'true', 'CT12'('background') = 'white', 'CT12' = ""); Maplets:-Tools:-Set('CT13'('editable') = 'true', 'CT13'('background') = 'white', 'CT13' = ""); Maplets:-Tools:-Set('CT14'('editable') = 'true', 'CT14'('background') = 'white', 'CT14' = ""); Maplets:-Tools:-Set('CT15'('editable') = 'true', 'CT15'('background') = 'white', 'CT15' = ""); Maplets:-Tools:-Set('CT16'('editable') = 'true', 'CT16'('background') = 'white', 'CT16' = ""); Maplets:-Tools:-Set('CT17'('editable') = 'true', 'CT17'('background') = 'white', 'CT17' = ""); Maplets:-Tools:-Set('CT18'('editable') = 'true', 'CT18'('background') = 'white', 'CT18' = ""); Maplets:-Tools:-Set('CT19'('editable') = 'true', 'CT19'('background') = 'white', 'CT19' = ""); Maplets:-Tools:-Set('CT20'('editable') = 'true', 'CT20'('background') = 'white', 'CT20' = ""); Maplets:-Tools:-Set('CT21'('editable') = 'true', 'CT21'('background') = 'white', 'CT21' = ""); Maplets:-Tools:-Set('CT22'('editable') = 'true', 'CT22'('background') = 'white', 'CT22' = ""); Maplets:-Tools:-Set('CT23'('editable') = 'true', 'CT23'('background') = 'white', 'CT23' = ""); Maplets:-Tools:-Set('CT24'('editable') = 'true', 'CT24'('background') = 'white', 'CT24' = ""); Maplets:-Tools:-Set('CT25'('editable') = 'true', 'CT25'('background') = 'white', 'CT25' = ""); Maplets:-Tools:-Set('CT26'('editable') = 'true', 'CT26'('background') = 'white', 'CT26' = ""); else Maplets:-Tools:-Set('KEYW' = ""); Maplets:-Tools:-Set('BA'('caption') = "Create Alphabet Assignment"); Maplets:-Tools:-Set('CT1'('editable') = 'false', 'CT1' = ""); Maplets:-Tools:-Set('CT2'('editable') = 'false', 'CT2' = ""); Maplets:-Tools:-Set('CT3'('editable') = 'false', 'CT3' = ""); Maplets:-Tools:-Set('CT4'('editable') = 'false', 'CT4' = ""); Maplets:-Tools:-Set('CT5'('editable') = 'false', 'CT5' = ""); Maplets:-Tools:-Set('CT6'('editable') = 'false', 'CT6' = ""); Maplets:-Tools:-Set('CT7'('editable') = 'false', 'CT7' = ""); Maplets:-Tools:-Set('CT8'('editable') = 'false', 'CT8' = ""); Maplets:-Tools:-Set('CT9'('editable') = 'false', 'CT9' = ""); Maplets:-Tools:-Set('CT10'('editable') = 'false', 'CT10' = ""); Maplets:-Tools:-Set('CT11'('editable') = 'false', 'CT11' = ""); Maplets:-Tools:-Set('CT12'('editable') = 'false', 'CT12' = ""); Maplets:-Tools:-Set('CT13'('editable') = 'false', 'CT13' = ""); Maplets:-Tools:-Set('CT14'('editable') = 'false', 'CT14' = ""); Maplets:-Tools:-Set('CT15'('editable') = 'false', 'CT15' = ""); Maplets:-Tools:-Set('CT16'('editable') = 'false', 'CT16' = ""); Maplets:-Tools:-Set('CT17'('editable') = 'false', 'CT17' = ""); Maplets:-Tools:-Set('CT18'('editable') = 'false', 'CT18' = ""); Maplets:-Tools:-Set('CT19'('editable') = 'false', 'CT19' = ""); Maplets:-Tools:-Set('CT20'('editable') = 'false', 'CT20' = ""); Maplets:-Tools:-Set('CT21'('editable') = 'false', 'CT21' = ""); Maplets:-Tools:-Set('CT22'('editable') = 'false', 'CT22' = ""); Maplets:-Tools:-Set('CT23'('editable') = 'false', 'CT23' = ""); Maplets:-Tools:-Set('CT24'('editable') = 'false', 'CT24' = ""); Maplets:-Tools:-Set('CT25'('editable') = 'false', 'CT25' = ""); Maplets:-Tools:-Set('CT26'('editable') = 'false', 'CT26' = ""); fi: Maplets:-Tools:-Set('PT1'('background') = 'white', 'PT1' = `A`); Maplets:-Tools:-Set('PT2'('background') = 'white', 'PT2' = `B`); Maplets:-Tools:-Set('PT3'('background') = 'white', 'PT3' = `C`); Maplets:-Tools:-Set('PT4'('background') = 'white', 'PT4' = `D`); Maplets:-Tools:-Set('PT5'('background') = 'white', 'PT5' = `E`); Maplets:-Tools:-Set('PT6'('background') = 'white', 'PT6' = `F`); Maplets:-Tools:-Set('PT7'('background') = 'white', 'PT7' = `G`); Maplets:-Tools:-Set('PT8'('background') = 'white', 'PT8' = `H`); Maplets:-Tools:-Set('PT9'('background') = 'white', 'PT9' = `I`); Maplets:-Tools:-Set('PT10'('background') = 'white', 'PT10' = `J`); Maplets:-Tools:-Set('PT11'('background') = 'white', 'PT11' = `K`); Maplets:-Tools:-Set('PT12'('background') = 'white', 'PT12' = `L`); Maplets:-Tools:-Set('PT13'('background') = 'white', 'PT13' = `M`); Maplets:-Tools:-Set('PT14'('background') = 'white', 'PT14' = `N`); Maplets:-Tools:-Set('PT15'('background') = 'white', 'PT15' = `O`); Maplets:-Tools:-Set('PT16'('background') = 'white', 'PT16' = `P`); Maplets:-Tools:-Set('PT17'('background') = 'white', 'PT17' = `Q`); Maplets:-Tools:-Set('PT18'('background') = 'white', 'PT18' = `R`); Maplets:-Tools:-Set('PT19'('background') = 'white', 'PT19' = `S`); Maplets:-Tools:-Set('PT20'('background') = 'white', 'PT20' = `T`); Maplets:-Tools:-Set('PT21'('background') = 'white','PT21' = `U`); Maplets:-Tools:-Set('PT22'('background') = 'white','PT22' = `V`); Maplets:-Tools:-Set('PT23'('background') = 'white','PT23' = `W`); Maplets:-Tools:-Set('PT24'('background') = 'white','PT24' = `X`); Maplets:-Tools:-Set('PT25'('background') = 'white','PT25' = `Y`); Maplets:-Tools:-Set('PT26'('background') = 'white','PT26' = `Z`); end: checkalpa := proc() local abetct, ctc, mctc; abetct := cat(Maplets:-Tools:-Get('CT1'), Maplets:-Tools:-Get('CT2'), Maplets:-Tools:-Get('CT3'), Maplets:-Tools:-Get('CT4'), Maplets:-Tools:-Get('CT5'), Maplets:-Tools:-Get('CT6'), Maplets:-Tools:-Get('CT7'), Maplets:-Tools:-Get('CT8'), Maplets:-Tools:-Get('CT9'), Maplets:-Tools:-Get('CT10'), Maplets:-Tools:-Get('CT11'), Maplets:-Tools:-Get('CT12'), Maplets:-Tools:-Get('CT13'), Maplets:-Tools:-Get('CT14'), Maplets:-Tools:-Get('CT15'), Maplets:-Tools:-Get('CT16'), Maplets:-Tools:-Get('CT17'), Maplets:-Tools:-Get('CT18'), Maplets:-Tools:-Get('CT19'), Maplets:-Tools:-Get('CT20'), Maplets:-Tools:-Get('CT21'), Maplets:-Tools:-Get('CT22'), Maplets:-Tools:-Get('CT23'), Maplets:-Tools:-Get('CT24'), Maplets:-Tools:-Get('CT25'), Maplets:-Tools:-Get('CT26')); ctc := [StringTools:-CharacterFrequencies(abetct)]; mctc := max(seq(op(2, ctc[i]), i = 1..nops(ctc))); if length(abetct) <> 26 or mctc > 1 then Maplets:-Display(acheckn); else Maplets:-Display(acheckp); fi: end: assignalp := proc(key, type) local ct, abet; if type = "Keyword(simple)" then ct := simpsubcipa(key); elif type = "Keyword(columnar)" then ct := keycolsubcipa(key); fi: if type = "Keyword(simple)" or type = "Keyword(columnar)" then Maplets:-Tools:-Set('CT1'('background') = 'white', 'CT1' = substring(ct, 1)); Maplets:-Tools:-Set('CT2'('background') = 'white', 'CT2' = substring(ct, 2)); Maplets:-Tools:-Set('CT3'('background') = 'white', 'CT3' = substring(ct, 3)); Maplets:-Tools:-Set('CT4'('background') = 'white', 'CT4' = substring(ct, 4)); Maplets:-Tools:-Set('CT5'('background') = 'white', 'CT5' = substring(ct, 5)); Maplets:-Tools:-Set('CT6'('background') = 'white', 'CT6' = substring(ct, 6)); Maplets:-Tools:-Set('CT7'('background') = 'white', 'CT7' = substring(ct, 7)); Maplets:-Tools:-Set('CT8'('background') = 'white', 'CT8' = substring(ct, 8)); Maplets:-Tools:-Set('CT9'('background') = 'white', 'CT9' = substring(ct, 9)); Maplets:-Tools:-Set('CT10'('background') = 'white', 'CT10' = substring(ct, 10)); Maplets:-Tools:-Set('CT11'('background') = 'white', 'CT11' = substring(ct, 11)); Maplets:-Tools:-Set('CT12'('background') = 'white', 'CT12' = substring(ct, 12)); Maplets:-Tools:-Set('CT13'('background') = 'white', 'CT13' = substring(ct, 13)); Maplets:-Tools:-Set('CT14'('background') = 'white', 'CT14' = substring(ct, 14)); Maplets:-Tools:-Set('CT15'('background') = 'white', 'CT15' = substring(ct, 15)); Maplets:-Tools:-Set('CT16'('background') = 'white', 'CT16' = substring(ct, 16)); Maplets:-Tools:-Set('CT17'('background') = 'white', 'CT17' = substring(ct, 17)); Maplets:-Tools:-Set('CT18'('background') = 'white', 'CT18' = substring(ct, 18)); Maplets:-Tools:-Set('CT19'('background') = 'white', 'CT19' = substring(ct, 19)); Maplets:-Tools:-Set('CT20'('background') = 'white', 'CT20' = substring(ct, 20)); Maplets:-Tools:-Set('CT21'('background') = 'white', 'CT21' = substring(ct, 21)); Maplets:-Tools:-Set('CT22'('background') = 'white', 'CT22' = substring(ct, 22)); Maplets:-Tools:-Set('CT23'('background') = 'white', 'CT23' = substring(ct, 23)); Maplets:-Tools:-Set('CT24'('background') = 'white', 'CT24' = substring(ct, 24)); Maplets:-Tools:-Set('CT25'('background') = 'white', 'CT25' = substring(ct, 25)); Maplets:-Tools:-Set('CT26'('background') = 'white', 'CT26' = substring(ct, 26)); else checkalpa(): fi: end: subcipher := proc(smess, key, type, ctype, lpres) local abet, ptctable, cabet, ctptable, i, mres, message; abet := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if type = "Keyword(simple)" then cabet := simpsubcipa(key); elif type = "Keyword(columnar)" then cabet := keycolsubcipa(key); else cabet := cat(Maplets:-Tools:-Get('CT1'), Maplets:-Tools:-Get('CT2'), Maplets:-Tools:-Get('CT3'), Maplets:-Tools:-Get('CT4'), Maplets:-Tools:-Get('CT5'), Maplets:-Tools:-Get('CT6'), Maplets:-Tools:-Get('CT7'), Maplets:-Tools:-Get('CT8'), Maplets:-Tools:-Get('CT9'), Maplets:-Tools:-Get('CT10'), Maplets:-Tools:-Get('CT11'), Maplets:-Tools:-Get('CT12'), Maplets:-Tools:-Get('CT13'), Maplets:-Tools:-Get('CT14'), Maplets:-Tools:-Get('CT15'), Maplets:-Tools:-Get('CT16'), Maplets:-Tools:-Get('CT17'), Maplets:-Tools:-Get('CT18'), Maplets:-Tools:-Get('CT19'), Maplets:-Tools:-Get('CT20'), Maplets:-Tools:-Get('CT21'), Maplets:-Tools:-Get('CT22'), Maplets:-Tools:-Get('CT23'), Maplets:-Tools:-Get('CT24'), Maplets:-Tools:-Get('CT25'), Maplets:-Tools:-Get('CT26')); fi: ptctable := table(); ctptable := table(); for i from 1 to length(abet) do ptctable[ substring(abet, i) ] := substring(cabet, i); ctptable[ substring(cabet, i) ] := substring(abet, i); od: mres := ""; if lpres = true then if ctype = "encipher" then message := StringTools[Select](StringTools[IsUpper], StringTools[UpperCase](convert(smess, string))); else message := smess; fi: for i from 1 to length(message) do if ctype = "encipher" then mres := cat(mres, ptctable[substring(message, i)]): else mres := cat(mres, ctptable[substring(message, i)]): fi: od: else if ctype = "encipher" then message := StringTools[UpperCase](convert(smess, string)); else message := smess; fi: for i from 1 to length(message) do if ctype = "encipher" then if StringTools:-Search(substring(message, i), abet) > 0 then mres := cat(mres, ptctable[substring(message, i)]): else mres := cat(mres, substring(message, i)): fi: else if StringTools:-Search(substring(message, i), cabet) > 0 then mres := cat(mres, ctptable[substring(message, i)]): else mres := cat(mres, substring(message, i)): fi: fi: od: fi: convert(mres, symbol); end: wsetup := proc(type) if type = "encipher" then Maplets:-Tools:-Set('TB1'('editable') = 'true', 'TB1'('foreground') = 'blue', 'TB2'('foreground') = 'red', 'B1'('enabled') = 'true', 'B1'('foreground') = 'blue', 'B1'('caption') = "Encipher Message"); elif type = "decipher" then Maplets:-Tools:-Set('TB1'('editable') = 'true', 'TB1'('foreground') = 'red', 'TB2'('foreground') = 'blue','B1'('enabled') = 'true', 'B1'('foreground') = 'red', 'B1'('caption') = "Decipher Message"); fi: end: clearvar := proc() Maplets:-Tools:-Set('TB1' = ""); Maplets:-Tools:-Set('TB2' = ""); Maplets:-Tools:-Set('TB1'('editable') = 'false'); Maplets:-Tools:-Set('KEYW' = ""); Maplets:-Tools:-Set('DDST'('value') = "?"); Maplets:-Tools:-Set('B1'('caption') = " "); Maplets:-Tools:-Set('B1'('enabled') = 'false'); Maplets:-Tools:-Set('DDB1'('value') = "?"); Maplets:-Tools:-Set('DDB1'('enabled') = 'false'); Maplets:-Tools:-Set('PT1' = "", 'PT1'('background') = 'gray'); Maplets:-Tools:-Set('CT1' = "", 'CT1'('editable') = 'false', 'CT1'('background') = 'gray'); Maplets:-Tools:-Set('PT2' = "", 'PT2'('background') = 'gray'); Maplets:-Tools:-Set('CT2' = "", 'CT2'('editable') = 'false', 'CT2'('background') = 'gray'); Maplets:-Tools:-Set('PT3' = "", 'PT3'('background') = 'gray'); Maplets:-Tools:-Set('CT3' = "", 'CT3'('editable') = 'false', 'CT3'('background') = 'gray'); Maplets:-Tools:-Set('PT4' = "", 'PT4'('background') = 'gray'); Maplets:-Tools:-Set('CT4' = "", 'CT4'('editable') = 'false', 'CT4'('background') = 'gray'); Maplets:-Tools:-Set('PT5' = "", 'PT5'('background') = 'gray'); Maplets:-Tools:-Set('CT5' = "", 'CT5'('editable') = 'false', 'CT5'('background') = 'gray'); Maplets:-Tools:-Set('PT6' = "", 'PT6'('background') = 'gray'); Maplets:-Tools:-Set('CT6' = "", 'CT6'('editable') = 'false', 'CT6'('background') = 'gray'); Maplets:-Tools:-Set('PT7' = "", 'PT7'('background') = 'gray'); Maplets:-Tools:-Set('CT7' = "", 'CT7'('editable') = 'false', 'CT7'('background') = 'gray'); Maplets:-Tools:-Set('PT8' = "", 'PT8'('background') = 'gray'); Maplets:-Tools:-Set('CT8' = "", 'CT8'('editable') = 'false', 'CT8'('background') = 'gray'); Maplets:-Tools:-Set('PT9' = "", 'PT9'('background') = 'gray'); Maplets:-Tools:-Set('CT9' = "", 'CT9'('editable') = 'false', 'CT9'('background') = 'gray'); Maplets:-Tools:-Set('PT10' = "", 'PT10'('background') = 'gray'); Maplets:-Tools:-Set('CT10' = "", 'CT10'('editable') = 'false', 'CT10'('background') = 'gray'); Maplets:-Tools:-Set('PT11' = "", 'PT11'('background') = 'gray'); Maplets:-Tools:-Set('CT11' = "", 'CT11'('editable') = 'false', 'CT11'('background') = 'gray'); Maplets:-Tools:-Set('PT12' = "", 'PT12'('background') = 'gray'); Maplets:-Tools:-Set('CT12' = "", 'CT12'('editable') = 'false', 'CT12'('background') = 'gray'); Maplets:-Tools:-Set('PT13' = "", 'PT13'('background') = 'gray'); Maplets:-Tools:-Set('CT13' = "", 'CT13'('editable') = 'false', 'CT13'('background') = 'gray'); Maplets:-Tools:-Set('PT14' = "", 'PT14'('background') = 'gray'); Maplets:-Tools:-Set('CT14' = "", 'CT14'('editable') = 'false', 'CT14'('background') = 'gray'); Maplets:-Tools:-Set('PT15' = "", 'PT15'('background') = 'gray'); Maplets:-Tools:-Set('CT15' = "", 'CT15'('editable') = 'false', 'CT15'('background') = 'gray'); Maplets:-Tools:-Set('PT16' = "", 'PT16'('background') = 'gray'); Maplets:-Tools:-Set('CT16' = "", 'CT16'('editable') = 'false', 'CT16'('background') = 'gray'); Maplets:-Tools:-Set('PT17' = "", 'PT17'('background') = 'gray'); Maplets:-Tools:-Set('CT17' = "", 'CT17'('editable') = 'false', 'CT17'('background') = 'gray'); Maplets:-Tools:-Set('PT18' = "", 'PT18'('background') = 'gray'); Maplets:-Tools:-Set('CT18' = "", 'CT18'('editable') = 'false', 'CT18'('background') = 'gray'); Maplets:-Tools:-Set('PT19' = "", 'PT19'('background') = 'gray'); Maplets:-Tools:-Set('CT19' = "", 'CT19'('editable') = 'false', 'CT19'('background') = 'gray'); Maplets:-Tools:-Set('PT20' = "", 'PT20'('background') = 'gray'); Maplets:-Tools:-Set('CT20' = "", 'CT20'('editable') = 'false', 'CT20'('background') = 'gray'); Maplets:-Tools:-Set('PT21' = "", 'PT21'('background') = 'gray'); Maplets:-Tools:-Set('CT21' = "", 'CT21'('editable') = 'false', 'CT21'('background') = 'gray'); Maplets:-Tools:-Set('PT22' = "", 'PT22'('background') = 'gray'); Maplets:-Tools:-Set('CT22' = "", 'CT22'('editable') = 'false', 'CT22'('background') = 'gray'); Maplets:-Tools:-Set('PT23' = "", 'PT23'('background') = 'gray'); Maplets:-Tools:-Set('CT23' = "", 'CT23'('editable') = 'false', 'CT23'('background') = 'gray'); Maplets:-Tools:-Set('PT24' = "", 'PT24'('background') = 'gray'); Maplets:-Tools:-Set('CT24' = "", 'CT24'('editable') = 'false', 'CT24'('background') = 'gray'); Maplets:-Tools:-Set('PT25' = "", 'PT25'('background') = 'gray'); Maplets:-Tools:-Set('CT25' = "", 'CT25'('editable') = 'false', 'CT25'('background') = 'gray'); Maplets:-Tools:-Set('PT26' = "", 'PT26'('background') = 'gray'); Maplets:-Tools:-Set('CT26' = "", 'CT26'('editable') = 'false', 'CT26'('background') = 'gray'); Maplets:-Tools:-Set('RB1'('value') = 'false', 'RB2'('value') = 'true'); end: acheckp := Maplet(Window('title' = "Check", [["Alphabet assignment is ok."], [Button("Go Back to Substitution Cipher Window", Shutdown())]] )): acheckn := Maplet(Window('title' = "Check", [["Alphabet assignment must be be a one-to-one assignment between the plaintext alphabet and ciphertext alphabet. Check your ciphertext assignment"], [Button("Go Back to Substitution Cipher Window.", Shutdown())]] )): submaplet := Maplet( Window( 'title'="Substitution Cipher", BoxColumn('halign' = 'none', 'background' = 'navy', BoxRow('halign' = 'none', "Substitution cipher type?", DropDownBox['DDST']( 'value' = "?", ["?", "Keyword(simple)", "Keyword(columnar)", "Make you own"], onchange = Evaluate('function' = "asetup", Argument('DDST', 'quotedtext' = 'true')) ), " Keyword?: ", TextField['KEYW'](15, 'font' = Font("times", bold, 12)), seq(HorizontalGlue(), i = 1..30)), BoxColumn(BoxRow('halign' = 'none', BoxColumn('background' = 'yellow', 'halign' = 'none', BoxRow('halign' = 'none', "Plain: ", TextField['PT1']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), TextField['PT2']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), TextField['PT3']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), TextField['PT4']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT5']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT6']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT7']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT8']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT9']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT10']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT11']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT12']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT13']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT14']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT15']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT16']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT17']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT18']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT19']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT20']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT21']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT22']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT23']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT24']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT25']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['PT26']('foreground' = 'blue', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), HorizontalGlue()), BoxRow('halign' = 'none', "Cipher: ", TextField['CT1']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), TextField['CT2']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), TextField['CT3']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), TextField['CT4']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT5']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT6']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT7']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT8']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT9']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT10']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT11']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT12']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT13']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT14']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT15']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT16']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT17']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT18']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT19']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT20']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT21']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT22']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT23']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT24']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT25']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'),TextField['CT26']('foreground' = 'red', 2, 'font' = Font("times", bold, 12), 'editable' = 'false', 'halign' = 'center'), HorizontalGlue()), HorizontalGlue())), BoxRow('halign' = 'none', Button['BA'](" ", Action(Evaluate('function' = "assignalp", Argument('KEYW', 'quotedtext' = 'true'), Argument('DDST', 'quotedtext' = 'true')), SetOption('DDB1'('enabled') = 'true') ) ) ) ), BoxRow('halign' = 'none', "Encipher or Decipher?", DropDownBox['DDB1']( 'value' = "?", ["?", "encipher", "decipher"], 'enabled' = 'false', onchange = Action(Evaluate('function' = "wsetup", Argument('DDB1', 'quotedtext' = 'true'))) ), " Preserve word divisions? ", RadioButton['RB1']("Yes", 'value'=false, 'group'='BG1'), RadioButton['RB2']("No", 'value'=true, 'group'='BG1'), Button("What is this?", RunDialog('MRB')), seq(HorizontalGlue(), i = 1..10)), BoxRow('halign' = 'none', "Input Message:", TextBox['TB1'](7..70, 'font' = Font("times", bold, 12), 'editable' = 'false'), HorizontalGlue() ), BoxRow('halign' = 'left', Button['B1'](" ", 'enabled' = 'false', Evaluate('TB2' = "subcipher", Argument('TB1', 'quotedtext' = 'true'), Argument('KEYW', 'quotedtext' = 'true'), Argument('DDST', 'quotedtext' = 'true'), Argument('DDB1', 'quotedtext' = 'true'), 'RB2' ) ), TextBox['TB2']( 'editable' = 'false', 7..70, 'font' = Font("times", bold, 12) ) ), BoxRow('halign' = 'center', Button( "Clear", Evaluate('function' = 'clearvar()') ), Button( "Quit", Shutdown() ) ) ) ), ButtonGroup['BG1'](), MessageDialog['MRB']("If no is selected, only letters in the plaintext/ciphertext will be used and punctuation and space characters will be deleted. If yes is selected, all characters, including spaces and punctuation characters, will be included in the ciphertext.", 'type' = 'information') ): Maplets[Display]( submaplet ): # # # # # # # # # # # # # # #