0TDTCCCCCCTEXTKEYWORDCODESQUAREALPHABETMESSAGERESULTVIGENERETOPCOLUMLINDELAKEMODCCODESLOLOOCROWROCOLUMNROWCOLUMNLLCHATIMNROWNROWNCOLUMNNCOLUMNSEESDMCTSAVMS@@@@@@ ) C   w@@@@ @2@s !@ "@#$%&'()76-@6-%6-%'6-%/6-%76-%(AA;,;@,;@%,;@&,;A,;A,2%%;@&$@&,;@@$,< +@00F/6. THE ATARI6-@%6-/ AP46.CIPHER MACHINE6-*6-@4 AZ. 6.by6-@ $6-@. Ad[6. ken murphy6-&6-@0 A?6.(C) 1984E6-Q6-@[ An6-A Ax<-@  A'` %6-+6-5 A<6.B-@ A'` %6-16-@; AB6.B - A'` %6-@ 16-@; AB6.B-@ A'` %6-16-@; AB6.Q-@ A'` %6-16-@; AG6-AQ AK +@0@)0@/-D( select cipherK6.\-@(pLAYFAIR+-@@( rANDOM CAESARL-@\(vIGENERE#-@#( iNSTRUCTIONS; A0;@:P,*@:R,*@:I,*@:V,A"@:I,A "@:R,A@"@:V,A'D +@0@)0@/-D( select option* -"(*0K-@'(eNCODE A MESSAGE3-@K(dECODE A MESSAGEB-@#( iNSTRUCTIONS/-@B( cIPHER MENUG A07@h*@i*@s*@g=(G A@" 6-"@:I, A@,"@:C,Ap6O+(6.ABCDEFGHIJKLMNOPQRSTUVWXYZO67@:J,&@d<@:J,&@d,. @<-@&(Ġ)(<@:E,AJR-(%You can now select your password wordR( or phrase. It should be selectedT0-(%according to the following guidelines0(^K((  It should be easy to rememberK(  It shouldn't be too obvioush>'(  Alphabetic characters only ->( spaces are OK.r''(  From 3 to 15 characters long|>-@)(What is the password->B:,!AV(AR8(!Your password cannot be accepted.V(Correct it and try again.#6-A A# A-B:,5(7<,0 *+7<,2A)7<,3Z,+'5 AR -@ -(You selected ''.R(Do you want to change it (Y/N)? A0 "@:Y,A@:N,A@. 6--B:,!7<,4J.67<,.ICC7<,4 )7@:7<,,&@d<@:7<,,&@d,4 A@67<,.7<,@67@:7<,,&@d<@:7<,,&@d,.  6-% 6-@&7<,0 .67<,.7<,66-%  A@ A F A50-@2(ҠŠF0@@&-@( 0A-@( | | | | | |1-@@A( :G-@@%( | | | | | |7-@@ G( DG-@@%( | | | | | |7-@@G( NG-@@%( | | | | | |7-@@G( XG-@@%( | | | | | |7-@@G( b( 6--@%! A % ($lE-@ ;(&Want to watch the coding process(Y/N)?E A0v"@:Y,6- A@:N,A  6- A` A:+0H:,$@&-@7( Š:(l)(!Enter your secret message now 200S(%characters maximum. Press RETURN wheni(you are finished.l( 6.(EAR-@"E(Your message has B:, characters., B:,!6-A" A, A D$(Please re-enter the message.06-A: AD A`F A50&0H:,$@@2-@C( ŠF(%(Your message reads ...!(%(IAR-@"?(Do you want to change it (Y/N)I A0"@:Y,A`@:N,A $ = A`-B:,07<,2 )7<,3Z3'= A  A X-@"8(#Message contains illegal charactersD6-AN AX A*2 A50&0H:,$@@2-@4,"@:E,#(Ǡ&(,6->-"@:D,#(Ǡ&(-6-6H'6-A A' A@R 6-\.7<,4 6.7%,$67,.. A`f"@:D,Ap:7<,47%<%,"6.7%,/67%,.X:67%,.z 6-% B:,A`'6-B:,'P:,'67B:,%,.X(-B:,7<,4J(67<,.I  6-6-6.(A `m-@@!( 3-@@:( L-@ @R( ^-@m( 0-@@%-@,( 0 # A AP6-#6-# A AP6-#6-6-+&,$%6-+&,$% " A0 " A/67<,.7<,'67%<%,.7<,/6-%<"@:E,'"@$P:'@,467<,. <6-%(A1-@@1(>:@:7&<&,,%A(,1-@@1(>:@:7&<&,,%A(,Z-@@(=.-@%+$,6(H-@%+$,Z(>:AY,$-@ @(7<,.A-@%+$,'(>:AW,9-@%+$,A(85-@!@(7<,+6-A5 AB B:,A 0L 6-V6&7<,47%<%,*7%<%,4X667%,.7%,`  B:,&6-% Aj  (}tG +@0!AR'-G(@your message reads~ 6-6- A?"(Print this message (Y/N)?, A0?"@:N,A @:Y,A`, A(3Your message reads ...,3*3The original was ... 3* A I(,( Printer doesn't respond - retry?6 A0I"@:Y,A@:N,AK(%(Want to do another (Y/N)?/ A0K@:Y,*@:N,A "@:Y,Ap + )-@%47<,') Ap ( ERROR - ABORT36-P:+&,'@,%06-&++&,$@,3$6.7<,6-%$ <AR- -B:,<6-P:@$H:,,%@J(@7<,22@@@@< AF2J AR$(F6-P:+&,'@,66-+&+$@,,$%@F6-$%@2 -(7<,6-%$<0 A50!0@@$(0@F--(%The cipher technique used here is thePN(( PLAYFAIR cipher named after LyonN(!Playfair. Playfair was actually aZU-(%good friend of Charles Wheatstone whoU(#discovered the cipher in the 1850s.dM+(#Playfair was responsible for makingM(the cipher well-known after anC,($demonstration at a secret meeting in@(London in 1854.C(xN*("The Playfair cipher is a techniqueN(of enciphering letters in pairs))(!such that the result depends uponS*("the interaction of both letters ofS($a pair. Today, this is recognized as=-(%the first 'literal, digraphic' cipher=( in history. AR,($}The enciphered result depends uponR(!a keyword phrase or word suppliedQ-(%by you. This password should be knownQ(only to you and the other partyN(( allowed to read the message. TheN(!password can have only letters orR-(%spaces. The Playfair cipher techniqueR( will use your password to 'seed'e*("the enciphering/deciphering squareT(%before actually performing the ciphere( translation.N&(A message enciphered with thisN(#technique will have spaces in fixedT*("positions to confound prying eyes.T(%Once deciphered, the real message canR)(!be easilly discerned. The messageR($you are enciphering can only containQ'(letters or spaces just like theQ(%password-numbers must be spelled out.9*("Also, your message should be UPPER9( CASE only. AP(( }The Playfair cipher works thisP(#way...first the codesquare is built"R'(by inserting the letters of theR(&password in order of first appearance.,d$(The remaining letters of theN(%alphabet follow in alphabetical orderd((J is dropped). 6f(The secret message isA(processed through the square inf( pairs of letters. First, all j's@N'(are replaced with i's. Then theN("message is broken down into pairs.JN)(!If both letters in a pair are theN( same, a dummy 'x' is inserted. ATW-(%dummy x is also used to round off theW(%message to an even number of letters.^v A4("}Here is an example of a PLAYFAIR^(%square using the keyword 'LEXINGTON'.p@@s(v(h3( #( |L|E|X|I|N|3( rc( |G|T|O|A|B|#( 3( |C|D|F|H|K|C( S( |M|P|Q|R|S|c( |2( |U|V|W|Y|Z|#( /@2(i,($The plain-text letter pair 'ER' thenT(#would be enciphered 'IP' using thisi(PLAYFAIR square. A A@=-@"0(: A0=$@ @3%6-F:@,$AV%F:@ ,3 A$% 6-6-6-%!%6-&  6-% 6-%!@6-&  6-%"6-+&,$%6-+&,$%"$% 6-6-6-%!%6-&  6-% 6-%!6-&  6-% Ap&1K:))AR1(>:,+B2@`@@+6-@5 A?2B$0D +@0@)0@/-D( select option:( - ((0DK-@'(eNCODE A MESSAGE3-@K(dECODE A MESSAGENB-@#( iNSTRUCTIONS/-@B( cIPHER MENUXG A07@g*@h*@i*@s=(G A@b"@:I,A$`l"@:C,Apv 6-2+-@ /(͠ĠΠ2(V+(#Enter the seed value for the randomV(&number generator to start your cipher.**("The value must be from 1 to 99999.O-@( SEED VALUE) AP-7 BO )!B AP= A`-B:,07<,2 )7<,3Z3'= A  AX-@"8(#Message contains illegal charactersD6-AN AX A`.6-'B6." A50.-@'((Ǡ' A (Ǡ<-B:,)6-$A &P:$A ,<"@:D,A `86-@:7<,,%P:$@Y,*!@86-&@Y67<,.>:,  A@ A@ 86-@:7<,,&P:$@Y,* @286-%@Y A @ h A50@?(!Despite a great diversity in theh($external appearance and the internal*S*("constitution of ciphers, there areS($only two basic classes of systems...4M)(!transposition and substitution. AM(transposition cipher involves a>O&(rearrangement or change in theO($sequence of the letters of the plainHT*("text message without any change inT(%their identity; a substitution cipherRR+(#involves a replacement of the plainR("text letters by others without any\c)(!change in their sequence. The twoQ(#systems may be combined in a singlec( cryptosystem.fg A A50A(%This program will encode/decode yourg(!messages using one of 3 differentpT-(%cipher techniques, i.e. the PLAYFAIR;T("a randomized form of CAESAR or thez(the VIGENERE ciphers.P*("The PLAYFAIR is a digraphic cipherP(!of the substitution variety whichS,($ciphers pairs of letters rather thanS("each individual letter. The CAESARK,($cipher is also a substitution cipherK(and is very similar to theO(( cryptographic cipher used by theO("military. The VIGENERE cipher is aR+(#polyalphabetic substitution cipher.R("All of these different ciphers areL*("difficult to break to the point ofL(being pointless to try in anyS,($reasonable amount of time. After youS("select a cipher technique, you canD#(read the details about thatA(particular cipher method.D( AP'(}Each cipher requires a secretP($password or code supplied by you andR-(%known only to you and the other partyR( with whom you are communicating.N)(!The PLAYFAIR requires a word or aN( phrase while the CAESAR requiresR+(#a number. The VIGENERE is differentR("in that, in this form, it does not S)(!require any keyword. This type ofS(%cipher is termed an 'AUTOKEY' cipher. L&(The results of all ciphers areL(!reversable given the correct key. Q+(#The message given to the cipher canQ(!be no longer than 200 characters.$ R)(!The PLAYFAIR and VIGENERE ciphersR($allow only alphabetic characters and. P-(%spaces, but the random CAESAR permitsP(all characters in its message.8 ^ A6($}For those of you who enjoy puzzles^(#generally and want to try your handB B+(#at Cryptology, I've included a niceB(challenge contest.V P)(!I assure you that the message wasP("enciphered with this program...but` U+(#which cipher(!)? Good hunting! P.S.U(%No professional cryptologists please!j *-@@*(ԠŠt c+(#RPNLOV RPDIPR GOROXL VOVSIY TQPOYFR("RAXLXR BQCQAT DBNCMO ADAGAP MEIYTS`( ESERAS BIc(~ P*("If you're really stumped and stillP(!interested, I can be reached thru 9)(!COMPUSERVE PPN 74025,731...expect9( only hints!  A Ap  A50@ Q'(The Caesar cipher is so calledQ(%because Julius Caesar is said to have N'(used it during the Gallic wars.N("In its original form a constant is R,($added to the character code for eachR(!letter so that the resultant code R-(%is again a valid letter. For example,R( suppose your constant is 3. Then T+(#each letter would be represented byT($the letter 3 positions away. By this S*("cipher technique A would become D;S($B would become E and so on (assuming U+(#a constant code of 3. Then only theU(%constant must be known by the reader. Q()(The weakness in this cipher isQ(#that the number of possibilities is S-(%limited to 25 (the number of letters)S(!and any high school student could L,($soon figure out a message coded withL(the standard Caesar cipher. A N*("}A vast improvement in the codingN(scheme would be possible if the K'(offset were different for everyK(character encoded. Also, if the( Q*("offset pattern from value to valueQ("was unique, then the code would be2 W.(&virtually unbreakable. This is exactlyW($what the RANDOM (or CRYPTO) code is.< S(-("The constantly changing offset andS(!pattern is generated using randomF V,($numbers. The only input required forV(%the cipher to operate is a seed valueP S*("for the random number scheme. ThenS($the decoder of the message must haveZ T+(#the random number seed the sameT($random number generator algorithm sod S,($that the random numbers would be theS("same starting from the seed value.n Ax O (}*(Your message can contain anyO( alphabetic characters, spaces or S+(#numbers and special characters. AllS(#are permitted with this cipher. You N+(#must, however, use UPPER CASE only.N(The seed number for the random N*("generator must be from 1 to 99999.N(Anyone to whom you send a coded Q,($message using this program must haveQ( the same random number generator L)(!algorithm to decode your message.L(This program, will, of course, 6)(!function both as an encoder and a6(decoder.  A A@ 67<,.>:P:H:,$A#,, .7<,2 .67<,.>:@:7<,,%@2, $ 8 +@00#-8( select option . - (.0@ K-@'(eNCODE A MESSAGE3-@K(dECODE A MESSAGE B-@#( iNSTRUCTIONS/-@B( cIPHER MENU G A07@h*@i*@s*@g=(G A'  6-"@:I, A2`" "@:C,Ap, W A500@)0@5-@T(ǠŠW(6  #A5@6.@ X-@%K-@%P:'@,$@%+&P:'@,$@,X(ROW %J "67B:,%,. T K 6--@ A(&Want to watch the coding process(Y/N)?K A0^ "@:Y,6- A)0h @:N,A)r  A`-B:,| 5(7<,0 *+7<,2A)7<,3Z,+'5 A)`   A)p dAR-@"D(#Message contains illegal charactersP6-AZ Ad A)0 2 A50 0H:,$@,-@26- &"@:E,#(Ǡ&( &"@:D,#(Ǡ&( 7<,4 67,.7%,  6-% B:,A0 (A0p L6-F:AY,AY(#A86-@4:"HA6%L  QA6%@44A6%@ F:@,QA6%@F:@, ?A@P:C:,'AV,?A9C:,&AV$F:A@, SA`Aa% A8G6-F:@,%AV$F:@,SAY "@:D,A2 6-@:7<,,&@e6- ''67@E,.+%9,%44%2 J-B:,067@e,.>:@:7<,,&@2,J67@I,.>:%@3,&  (}-(7<@&,0 <-@:7<,,&@e#-%,( 0 <@: 2 -(-&*-F:@,2( D R6( 7+%,$@&%<+%,$@&%@&,: F!@I(L(O(R(N 6-@P AX 9#6-@:7<,,&@d%$@&167,.7<,96-%b #"P:',$67,. #6-%l 6-@:7<,,&@ev   A@ #-@#6-$@&%% 7<,47<,' A20  ( ERROR-ABORT J6-$@&%)6-@:7<,,&@e4-B:,J6-@:7<,,&@d C6-$@&%/6-%&+@:7<,,&@d,5 C6-%@& 767<,.7<,)6-@:7<,,&@e- 7 A@ ] +6($The VIGENERE is a substitution type]("of cipher which is polyalphabetic; R+(#i.e., the technique employs severalR("copies of the alphabet arranged in Q)(!a table or square. Each letter ofQ(#the message is replaced by a letter O)(!from the square whose position isO(!determined by the column in which O)(!the original letter was found andO(!the nth alphabet which is the one Q+(#starting with a key letter. The keyQ(!letter is automatically generated M*("from the plain text as it is beingM(processed through the VIGENERE U,($square. Each copy of the alphabet isU($entered in its natural sequence. The \,($first key letter chosen is the firstR(!letter of the plain-text message.\ A V (}.( Here is an example of a VIGENEREV(#square. The actual square used will I*("contain 26 copies of the alphabet.6@B-@I(* 7AR#A5@'-@+"3( 7 4 '-@(F$@'(> Z-@4( The cipher equivalent of a givenZ(!plain-text letter enciphered by aH S-(%given key letter is that letter whichS(!stands at the intersection of theR S+(#column headed by the former and theS(#row begun by the latter. Therefore,\ I,($'B' is ciphered into 'G' using a key?(letter of 'F'.I Af T.(&}VIGENERE squares can be used in manyT(!different ways other than the wayp U,($I have chosen here. They can be usedU($with or without a key. They can alsoz N*("contain alphabets in different (orN(random) sequences. This version S)(!uses no key and is therefore moreS(%secure. An 'AUTOKEY' cipher generates Q)(!its own key from either the plainQ(#text or the enciphered result. I am R*("using the plain text letter as theR(#key to encipher the next plain text T,($letter so that the 'key' is actuallyT(#implicit in the plain text message. V-(%Your message must contain only spacesV($or alphabetic characters. The spaces @'(are actually removed during the@(enciphering process.  A A' +AR$ ABCDEFGHIJKLMNOPQRSTUVWXYZ BCDEFGHIJKLMNOPQRSTUVWXYZA CDEFGHIJKLMNOPQRSTUVWXYZAB DEFGHIJKLMNOPQRSTUVWXYZABC EFGHIJKLMNOPQRSTUVWXYZABCD FGHIJKLMNOPQRSTUVWXYZABCDE GHIJKLMNOPQRSTUVWXYZABCDEF HIJKLMNOPQRSTUVWXYZABCDEFG$ IJKLMNOPQRSTUVWXYZABCDEFGH. JKLMNOPQRSTUVWXYZABCDEFGHI8 KLMNOPQRSTUVWXYZABCDEFGHIJB LMNOPQRSTUVWXYZABCDEFGHIJKL MNOPQRSTUVWXYZABCDEFGHIJKLV NOPQRSTUVWXYZABCDEFGHIJKLM` OPQRSTUVWXYZABCDEFGHIJKLMNj PQRSTUVWXYZABCDEFGHIJKLMNOt QRSTUVWXYZABCDEFGHIJKLMNOP~ RSTUVWXYZABCDEFGHIJKLMNOPQ STUVWXYZABCDEFGHIJKLMNOPQR TUVWXYZABCDEFGHIJKLMNOPQRS UVWXYZABCDEFGHIJKLMNOPQRST VWXYZABCDEFGHIJKLMNOPQRSTU WXYZABCDEFGHIJKLMNOPQRSTUV XYZABCDEFGHIJKLMNOPQRSTUVW YZABCDEFGHIJKLMNOPQRSTUVWX ZABCDEFGHIJKLMNOPQRSTUVWXYSS112,112,66,0,0,2,2,11,66,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,65,0,0* 6.67@@$,.'67,.*$ D:CIPHER.BAS