To download these programs, you should have a floppy disk or some hard drive space accessible to you. Then push shift-click in Netscape over the link to bring up the dialog box for downloading.
After you download it, you can run Maple and use the menu command File-Open to load the worksheets.
crypt.mpl(9/8/99)
modular.mws(8/27/99)
basic.mws(8/27/99)
crypt.mpl
and demonstrates affine ciphers.
keyword.mws(8/30/99)
crypt.mpl
and demonstrates cryptanalysis of monoalphabetic ciphers.
homophone.mpl(9/9/99)
homophone.mws(9/9/99)
homophone.mpl
and demonstrates homophonic ciphers.
vigenere.mpl(9/9/99)
vigenere.mws(9/9/99)
vigenere.mpl
and demonstrates Vigenere ciphers.
testbug.txt(9/9/99)
goldbug.mws(9/9/99)
vigen_decode.mws(9/30/99)
shiftregister.mws(11/4/99)
fiat-shamir.mws(11/4/99)
RSA.mws(11/4/99)
.mws)
load the cryptology programs in the file crypt.mpl.
You may need to change the beginning line of the worksheet
to be able to find the program file crypt.mpl to
something
like
read `C:/windows/desktop/crypt.mpl`;
depending on where you have put the file. Be sure to enclose the entire pathname in single backquotes.
Here are some descriptions of the individual commands found in crypt.mpl.
numbers(string)
string is a string of uppercase letters enclosed
in single backquotes, e.g. `THECATINTHEHAT`.
The function numbers(string) returns the list of
numbers from 1 to 26 associated to the letters, e.g.
[20, 8, 5, 3, 1, 20, 9, 14, 20, 8, 5, 8, 1, 20]
letters(numberlist)
letters does the reverse of numbers,
i.e. convert a list of numbers from 1 to 26 back to a string of
letters.
caesar(plaintext,key)
plaintext is a string in UPPERCASE enclosed in
`backquotes`;
that's for all our strings in these programs.key is an integer. So
caesar(`HELLO`,3)
produces `KHOOR` (the backquotes won't show in the
output; but they will be there for the purposes of using the
output).
ciphertext:=caesar(plaintext,key). Decoding can be
accomplished by
caesar(ciphertext, -key). Check it out!
tryall(string)
affine(plaintext,[addkey,multkey])
addkey
and multiplicative key
multkey.
It takes the numbers associated to each letter in the plaintext
and carries out multkey * (number + addkey) mod 26.
(* means multiplication in Maple). So
affine(`HELLO`,[1,3]) gives `ARMMV`
monoencode(plaintext,keyword)
`ABCDE...XYZ`, giving
the letters that should be substituted for A, B, C, etc.
So
monoencode(`HELLO`,`VWXZCRYPTANLSIBDEFGHJKMOQU`);
yields `PCLLB`
monodecode(ciphertext,keyword)
monodecode(`PCLLB`,`VWXZCRYPTANLSIBDEFGHJKMOQU`);
gives `HELLO`.
freq(msg)
msg. The result is a chart of these numbers.
percent(msg)
msg.
sortfreq(msg)
sortpercent(msg)
bigramfreq(msg)
msg. Only the ones that occur are listed.
analyze(ciphertext,keyword)
keyword is your current
guess for the keyword that unlocks the cipher. If you are right,
then monodecode(ciphertext,keyword) should give a
sensible message. If it doesn't, then analyze gives
a chart that shows the cipher letters, the plaintext letters
they are translated into, and the frequencies of occurrence in
msg. That may give you clues on how to rearrange
the keyword to make sense of the ciphertext.
chart, schart
schart is the chart sorted from
high to low. To see them just give the command
chart;, or in prettier format evalm(chart);
Here are some descriptions of the individual commands found in homophone.mpl.
homophoneenc(plaintext)
homophonedec(ciphertext)
hfreq(ciphertext)
hfreqsort(ciphertext)
hpairfreq(ciphertext)
hpairfreqsort(ciphertext)
readin(`filename`)
Here are some descriptions of the individual commands found in vigenere.mpl.
vigen_enc(plaintext,keyword)
vigen_dec(ciphertext,keyword)
fig2_2
exercise6
index_of_coincidence(text)
friedman(text)
friedman2(text)
subfreq(text,[l,i])
readin(`filename`)
Last modified: Mon Dec 4 14:27:48 CET 2006