CSC 290 Introduction to Cryptography: Assignments

The Rosetta Stone.
A historically important crib.
-
The assignments will be posted here after the day's class,
along with the due date.
Assignments are due at the beginning of class on the due date.
In general, no credit will be allowed for for late assignments.
Turn what you have in in for partial credit.
For cryptanalysis problems, there will generally be at least a week, so
if you start early, there should be no problem.
I plan to drop the lowest couple of assignments to cover occasional lapses.
-
Assignments will be of several sorts, including problem sets from the text,
and cryptanalysis projects that may or may not include a programming
component
For programming, you can use any platform/language you want,
but C/linux might be an advantage, because if I ever write and hand out
any source code, that is what it will be in.
(Not that you should have any trouble translating anything.)
-
Document every stage of your work, especially for cryptanalysis.
Hand in all scratch work, computer code, etc.
Little or no credit will be given just for getting the answer right.
Credit will be based on demonstrated understanding, creativity, effort,
results, and presentation.
If you find a program on the web that cracks ciphers of form "ABC"
and feed it the assignment "decrypt x", and hand in the answer, you
won't get (nearly) as much credit as if you wrote the cracker yourself, or
assembled it creatively out of other pieces.
-
For cryptanalysis and programming projects, I expect a well organized
report-style writeup that describes in detail what you did, why you did it,
and what the results were. This includes negative results.
Even if you fail to crack a particular ciphertext, you can still get
plenty of credit for an imaginative, well executed, and well documented
approach. Scratch work and computer code, if requested
should be appended to the main
writeup with appropriate pointers.
-
Attribute ANY work that is not your own, including software off the
web, text cribbed from other sources, etc.
You are encouraged to look for resources, but not to the extent that
it negates the point of the assignment.
This is sometimes a fine line, especially in programming assignments.
I will try to be specific as to what I expect you to write
as a minimum. If in doubt, ask.
In any case, use of UN-attributed material is plagiarism, and a violation
of the University's academic honesty policy.
-
You are encouraged to discuss general techniques and specific approaches
to general problems with your fellow students, or anyone else.
Unless specifically directed in an assignment, however, you are not to
share code you have written, or your written solutions to specific
problems.
-
Your TA, David Ahn, has provided a set of
presentation guidelines
that he would like followed in the work he grades.
You should look at them.
Tuesday, September 3, 2002
- Topics: Introductory material, modulo arithmetic, simple ciphers.
- Reading assignment: Garret, Chapter 1; Singh, Chapter1.
- Homework: Aristocrat cryptogram handed out in class. Hand in a writeup
describing what you tried, what worked, and what didn't.
Append all scratch work.
Due Tuesday, September 10, 2002
Thursday, September 5, 2002
- Topics: Simple ciphers, breaking them,
probability, statistics of English.
- Reading Assigment: Garret, Chapters 2 and 3.
- Problem set 1: 2.1.10, 2.1.11, 2.1.12, 2.2.02, 2.2.04, 2.2.08,
2.3.02, 2.4.02
Due: Tuesday, September 10, 2002.
- Homework, encryption:
Write a program (or adapt material found on the web)
to perform monoalphabetic encryption and decryption using a permutation
derived from a specified key phrase (Singh page 13).
For encryption, remove all non-alphabetic characters,
and print the output in groups of 5.
For decryption, just print one long string of lower case
letters, as that is easier to read than groups.
Encrypt two samples of English prose with at least 200 characters using
different keys.
Prose can be anything that is not offensive, or engineered to be
difficult to crack. For the next assignment, you will crack each other's
encryptions, so you might consider what you need to do this as you
are doing this program. Disallowed will be any tool that is fully
automated or that uses a dictionary, (unless you write it yourself).
Hand in short writeup, with encryption and decryption runs.
Also attach copies of the encryptions on separate sheets
of paper without keys or plaintext (provide these in the main writeup).
The program should not take long to write. If you adapt material you
find on the web, you must document your source.
Disallowed sources are other people associated with the class
(students, TA, prof).
Due Tuesday, September 10, 2002 (you don't have a week on this one).
Tuesday, September 10, 2002
- Topics: Probability and statistics.
Statistical attacks on affine and monalphabetic substitution
ciphers
- Reading Assigment: Finish Garret, Chapter 3.
- Cryptanalysis Assignment:
Decrypt the substitution cipher given to you today.
Provide a writeup detailing how you solved the problem (or not)
along with your solution (if any).
Hand in all scratch work, intermediate steps if you used a program,
and any programs you used. In other words, document your progress.
If you used tools you did not write yourself, document it.
Breaking into account of the student who generated the ciphertext
it is NOT an allowed method of attack.
As before, fully automated tools are disallowed.
Due Tuesday, Sept. 17
- Due today: Aristocrat cryptogram; Problem set 1;
mono-alphabetic encryption assignment.
Sample solution to aristocrat cryptogram
A whole pile of aristocrat cryptograms (without solutions)
should you feel like doing puzzles.
Thursday, September 12, 2002
- Topics: Transposition ciphers and permutations.
- Reading assignment: Garret, chapter 4; Singh, chapter 2.
- Problem set 2: 3.3.02, 3.3.04, 3.3.05, 3.3.08, 3.3.10, 3.3.12,
3.4.02, 3.4.04, 3.5.02
Due Tuesday, Sept 17.
- Encryption assignment:
Write or find software to do block transposition encryption
with block of 16 characters using a key derived from a key phrase.
Document the source of any software you did not write yourself.
Since 16! is about 2 * 10^13, this should be reasonably secure
against brute-force attack.
Encrypt two segments of English prose at least 256 letters each,
and print the output in groups of 16.
Make sure the last group is filled by adding some random prose.
As before, hand in an additional two pages containing the
two encrypted messages with no other information.
Note that your main writeup should also contain the encrypted text.
Due Tuesday, Sept 17. (Yes, three assignments due at once again.
Schedule your time.)
Tuesday, September 17, 2002
- Topics: Polyalphabetic substitution and the Vigenere cipher
- Reading assignment: Garret, chapter 4; Singh, chapter 3.
- Encryption assignment:
Write or locate software to perform Vigenere encryption with
a given key.
Encrypt two pieces of English prose of at least 1000 characters
using a Vigenere cipher with a key between 10 and 20 characters in
length. Output text in groups of 8, 8 groups to a line.
Hand in writeup along with plaintext, ciphertext, and keys used.
Hand in blind copies of the encrypted text as before, except put the
last 4 digits of your student id as a heading.
Also put copies of encrypted text in ~/davidahn/vigenere
under the file names xxxx_vigenere1.txt and xxx_vigenere2.txt
where xxx is the last four digits of your student id number.
Due Thursday, Sept 19 2002.
DON'T ENCRYPT THE SAME TEXT AS A PREVIOUS ASSIGNMENT!!.
- Decryption assignment:
Decrypt the transposition cipher given to you in class
You will probably need to write or get hold of some tools that allow
you to propose a trial (partial) transposition in one group,
and automatically see the result of that transposition in all the
other groups. As before, you can look for some help on the web,
with appropriate documentation, but remenber that will receive little
credit if you use a fully or mostly automated cracker that you
did not write yourself.
Due Tuesday, Sept 24 2002.
- Due today: Transposition Encryption, Substitution decryption,
problem set 2.
Sample solution to a monoalphabetic substitution cipher
Thursday, September 19, 2002
- Topics: Polyalphabetic substitution and the Vigenere cipher (continued).
- Reading assignment: Garret, chapter 5.
- Decryption assignment:
Decrypt the Vigenere-encrypted cipher given to you in class.
You can use either the Kasiski or the Friedman approaches to
attack the keylength. As before, hand in full doucmentation of
your work.
Warning: there are several computer programs floating around the web
that (claim to) crack Vigenere ciphers completely, or nearly
completely, automatically.
If you use one of these, the available credit is substantially
less than if you performed the analysis yourself.
The vigenere-encryped texts are now available on the undergraduate
system in: ~davidahn/vigenere.
Files are named xxxx_vigenere1.txt or xxxx_vigenere2.txt,
where xxxx is a four-digit number.
If you have a hardcopy ciphertext already, use the
corresponding electronic copy; if you don't find it there (which may be
the case for those of you with any of the texts from 5923 or 6275),
email me (davidahn@cs.rochester.edu) and I'll assign you a new one.
(If you already typed in the hard copy, you can keep working on it.)
If you don't have a hardcopy ciphertext already, email me and I'll
assign you an electronic one (you can print out your own hardcopy).
Note: if you have a hardcopy ciphertext that you received on Thursday,
please hand it in with your writeup.
Note2: If, on any of the ciphertexts, you suspect that the rules
for encryption were not followed, ask the TA for another text.
You are expected to do the same if what you received is
obviously not well encrypted according to the assignment
(e.g. chunks of plaintext showing).
NOTE3: 5069_vigenere*.txt has been replaced by 5069_vigenere*revised.txt
due to a programming error that made the original ciphertext not quite
to spec.
Due: Thursday, September 26, 2002.
Thuesday, September 24, 2002
Thursday, September 26, 2002
- Topics: Hill Cipher, Euclidean algorith.
- Reading assignment: Singh, Chapter 4.
- Encryption assignment: Write a program to find the multiplicative
inverse, mod 26 for
a square matrix if it exists, and report that it does not exist
if that is the case. This can be done using an adapation of the
Gauss-Jordan technique (see handout), using multiplicative inverses
instead of 1/x. You do not need to compute these
multiplicative inverses
on the fly - since you are only using mod 26, you can use a lookup
table - which is practical to initialize by hand if you do not
feel like implementing the inverse-by-euclidean-algorithm technique.
In order for the technique to work, you need to reduce using a pivot
that is not even or equal to 13. This may necessitate some row
exchanges that you need to keep track of.
If you get to a point in the reduction where no such pivot exists,
then you have a non-invertable matrix.
Fortunately the choice of pivot does not seem to propagate - i.e.,
if you have two or more valid pivots, it does not matter which one
you take in terms of whether you get stuck later on.
This is fortunate, as otherwise there would be a nasty search problem.
Use this routine to write a program that encrypts and decrypts
messages using the Hill cipher.
Demonstrate that your decryption works.
Generate 2 (good) 4x4 keys, and use them to encrypt two
pieces of text at least 256 characters long.
Place the encryptions along with a 30 character crib
in the files xxxx_hill_4x4_1.txt and xxxx_hill_4x4_2.txt
in the directory ~davidahn/hill
Also generate 2 3x3 keys and use them to encrypt two pieces of text
at least 1800 characters. Place these without cribs in
xxxx_hill_3x3_1.txt and xxxx_hill_3x3_2.txt
DO NOT REUSE TEXT FROM A PREVIOUS ASSIGNMENT.
Due Thursday, Oct 3, 2002
- Due today: Vigenere decryption.
Tuesday, October 1, 2002
- Topics: Rotor machines; German Enigma; methods of attack.
- Reading Assignment: Garret, chapter 7.
Thursday, October 3, 2002
- Topics: More math. Equivalence relations, integers mod m,
primitive roots.
- Reading assignment: Garret, chapter 9.
- Encryption assignment: Implement a simulator for a 3-rotor
Enigma type machine with symmetric reflector and plugboard
accomodating up to 13 cables (thus allowing all letters to be
swapped). Your progam should permit easy redefinition of rotors,
and should permit a plugboard setting and initial rotor position
to be specified as a key.
Use simple "odometer" gearing - rotor 1 counts up from 0 to 25
(or a to z), rotor 2 clicks one step, etc.
Make the fastest moving rotor the one closest to the plugboard
(and hence farthest from the reflector)
Wiring of rotors and reflectors of original German enigma
(from http://www.enigma-replica.com/wiring.html)
Rotors
In.....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
1......E K M F L G D Q V Z N T O W Y H X U S P A I B R C J
2......A J D K S I R U X B L H W T M C Q G Z N P Y F V O E
3......B D F H J L C P R T X V Z N Y E I W G A K M U S Q O
4......E S O V P Z J A Y Q U I R H X L N F T G K D C M W B
5......V Z B R G I T Y U P S D N H L X A W M J Q O F E C K
6......J P G V O U M F Y Q B E N H Z R D K A S X L I C T W
7......N Z J H G R C X M Y S W B O U F A I V L P E K Q D T
8......F K Q H T L X O C B J S P D Z R A M E W N I U Y G V
Reflectors
B......Y R U H Q S L D P X N G O K M I E B F Z C W V J A T
C......F V P J I A O Y E D R Z X W G C T K U Q S B N M H L
Using rotors 1, 2, and 3, reflector B, and 6 plugs, encrypt two
messages, in english, of (at least) 50 and 1000 characters
using the same key (and plugboard setting), and another pair using a
different key (and plugboard setting).
The 50 character messages will serve as a crib for decrypting
the longer, so corresponding plaintext of those should be placed
with them in the puzzle file.
Place the message pairs in
xxxx_enigma_1.txt and xxxx_enigma2.txt
in directory ~/davidahn/enigma
Due Thursday, October 10, 2002.
- Decryption assignment. Decrypt the two Hill ciphers you were given,
one 4x4 using supplied cribs, and one 3x3 without a crib, using
a probable trigram attack.
You should make use of the matrix inversion programs you wrote
for the last assignment to check the invertablility of
cribs and probable trigrams.
You may also want to develop some simple statistical checkers
to reduce your load in determining whether trial decryptions
are correct or not.
Due Thursday, October 10, 2002.
- Due today: Hill encryption.
Tuesday, October 8, 2002
Thursday, October 10, 2002
- Topics: Steganography.
- Reading Assignment: Garret, Chapter 5.
- Decryption Assignment: Decrypt the enigma encryption you were
given. Recover the plaintext of the 50 and 1000 character messages along
with the (common) plugboard and rotor settings.
The 50 character message with known plaintext can be used as a crib to
obtain the rotor settings and some, if not all, of the plugboard
settings.
The 1000 character message should then be decryptable,
serving as a check on the initial key determination, and as data to
recover any still unknown plugboard settings.
Note that this is somewhat easier than the problem where the
long message has different rotor settings but the same plugboard settings)
The character loop approach (Turing's method) described
in Singh might be helpful here, though the description is incomplete,
and the use of multiple loops seems to be necessary. More directly,
a partial trail decryption leveraging the fact that only 6 plugs are used
can be employed to find rotor and plugboard settings.
In any case you can use your encryption program
as a basis for a bombe simulator.
If you are feeling really ambitious, you could try a ciphertext only
attack on the 1000 character message using the index-of-coincidence
approach outlined in class. 1000 characters should be enough
to give you a good chance of cracking the six plug setup.
Due Thursday, October 17, 2002, reassigned version due Thursday, October 24.
- Due today: Hill decryption, Enigma encryption
Tuesday, October 15, 2002
- Topics: David Ahn on Language.
- Reading Assignment: Garret, chapter 6; Singh, chapter 6, 243-252.
- Encryption Assignment. Redo Enigma simulator to fix various
problems in most implementations.
Due Tursday, October 17, 2002.
Thursday, October 17, 2002
- Topics: DES.
- Reading assignment: Garret, Chapter 11.
- Decryption assignment: Enigma decryption reassigned. Due Thursday,
October 24, 2002.
- Due today: Enigma encryption revision.
Thuesday, October 22, 2002
- Topics: Prime numbers, Fermat's little theorem.
- Reading Assignment: Garret, Chapters 12, 13.1, 13.2, 13.3
- Decryption assignment: Crypt/DES dictionary attack.
Get on a Unix/Linux system and read the man page on the crypt function.
Use this function and web/other resources to mount a dictionary attack on
the encrypted passwords in the file
password_cipher.txt.
Most of these passwords are poorly chosen, i.e. they are short, or
words, or names, or minor variations thereof, or potentially guessable
because they are TOOOO clever, or all of the above.
(No guarantees about only lowercase letters being present though).
See how many you can find out of the list of 50.
Stealing or sharing classmates results is disallowed in this assignment.
Use of fully canned password crackers is discouraged,
as are pre-encrypted dictionaries.
Use of text dictionary resources on the other hand, is encouraged, and
probably necessary to complete the assignment in a timely fashion.
As usual, document all of the resources you use.
Note that the crypt function does not run all that fast (deliberately),
so you may have to allow considerable time for your program to run.
You also have to put -lcrypt on the link line in Linux systems, which
is not mentioned in the documentation, at least on my Linux system.
Due, Tuesday Oct. 29, extended to Thursday Oct. 31 because original date
was not posted.
Thursday, October 24, 2002
- Topics: Factoring special expressions, fast exponentiation, Sun Ze's
theorem.
- Reading assignment: Garret, Chapter 10.1, 10.2, 10.3
- Problems: 12.1.03, 12.1.07, 12.4.05, 12.5.02, 12.5.06, 12.6.04 13.2.04,
13.3.03. Due Thursday, Oct 31, 2002.
- Due today: Enigma decryption (final).
Tuesday, October 29, 2002
- Topics: Probabilistic primality testing, Diffie_Hellman key exchange.
Thursday, October 31, 2002
- Topics: Public key systems, RSA.
- Reading Assignment: Garret, Chapter 17
- Encryption Assignment: Use probabilistic primality testing methods
(Fermat's little theorem, or one of the more sophisticated
methods in Garret) to find 10 large (about 100 decimal digits) primes
(very probably) and 10 100 digit non-primes without small factors
(you might get these by multiplying two 50 digit primes).
Also see how large a prime you can produce within the time
allowed for the assignment.
Use the large number routines in
the freelip library (in ~/davidahn/freelip) or write your own.
In your writeup, provide certificates of non-primality for the
non primes, and attempt to bound the probability that your
"primes" are actually not primes.
Also place a file named xxxx_primes.txt containing your 100 digit
primes and non-primes, in mixed order, into directory
~/davidahn/primes
Due Tuesday, November 12, 2002.
- Due today: Attack on password file
Problems from Garret chapters 12 and 13.
Tuesday, November 5, 2002
- Topics: Introduction to group theory (Essentially chapter 17 in Garret)
Back to cryptology main page