# Exam Dates

**Midterm:** Thursday, February 27th, 5:15 - 6:45 pm, ECCR 155.

**Final Exam:** Monday, May 5th, 1:30 pm - 4:00 pm, Room TBA.

If you have a problem with these dates, please contact me ASAP.

# Work Schedule

Due | Topics Today | Due Today |

JAN 13 | Introduction | Read the Syllabus, register an account at sage.colorado.edu and bring a laptop to class. |

JAN 15 | Introduction to classical ciphers, the use of Sage | Read TW (the text), Chapter 1 all, Section 3.3 up to but not including "3.3.1 Division" and then Chapter 2 up to but not including 2.2. Get started reading Introduction and Chapter 1 of The Code Book. Get registered at sage.colorado.edu (must be done on campus from registered connection; if you are still having trouble, email me your desired username and I'll do it for you), and bring a laptop or tablet (e.g. ipad) to class (last ditch: smartphone). Do yesterday's homework (read your syllabus) if you are just joining the class and haven't done so. |

JAN 17 | More Sage intro, modular arithmetic | If you still (!) aren't registered on Sage, email me to do it for you (send a preferred username). Then open up the "Coding and Crypto, Intro" worksheet and work through it at home (using, for example, tab completing and searching documentation we learned in class today to figure out the right functions you'll need). This will require lots of messing around to figure out how things work, so do two things: 1) check out the "Resources" tab on our course website and 2) log into D2L and use the forum to discuss it with your classmates and me while working on it. This gives us the chance to get to know the D2L forum software and see if we like it. We can use D2L whenever, but we can make a vague D2L date for Thursday between noon and 2 pm for those that are available then. Sage can be frustrating at first (like any new software), but take heart! I'll try to be available to answer questions as much as possible on D2L between now and Friday. |

JAN 22 | Latex intro, more intro to number theory | Read the rest of Intro and Chapter 1 of The Code Book, and get started on Chapter 2 about the Vigenere cipher (we'll cover it next week, probably). Read Chapter 3 of TW up to the end of 3.2. As you're reading, try to make an outline for yourself of the main ideas being covered. Finally, you'll find a Sage Worksheet called "Coding and Crypto, Modular Arithmetic" among those published. Work through the first part of it. Start looking at the exercises at the end. Later I will request that you hand in the first of these, but you don't have to have it done yet. |

JAN 24 | Primes, euclidean algorithm |
In the LaTeX file we looked at today in the lab, there's an exercise at the end (page 2). Please do that to hand in by email by Friday night. This will give me a chance to see where you guys are with writing up a proof, which will help me calibrate the course. And it will give you a chance to use LaTeX! |

JAN 27 | Solving congruences, back to ciphers | Click here to see the magic box we did at the end of class. Use the magic box to find the gcd of 1263 and 915, and to solve 915x + 1263y = gcd(915,1263). Hand in on paper in class on Monday (handwritten is fine; requiring you to latex that might be a little cruel, but feel free to learn how to make pretty tables in latex if you want, it's kinda fun). In class on monday bring us all an interesting big number, e.g. the number of atoms in the known universe is approximately 10^80 (please also provide a reference). Finally, by classtime Monday, please do the following exercise (from Modular Arithmetic worksheet): Implement the Shift Cryptosystem using Modular Arithmetic. That is, in a separate worksheet, write a function shiftmod26(n,m) that will take in an integer n and shift it m spots forward along the cycle modulo 26. Use it to encode and decode a secret four-letter word. Document what you did a bit (hold SHIFT+click on the blue bar to make a new text box to write documentation in your worksheet). Then share the worksheet with "math4440". |

JAN 29 | The affine cipher, vigenere cipher | Read Chapter 2.2, 2.3 (up to but not including 2.3.1) of TW. Do Exercise 3(a) and 6(a) in Chapter 3 of TW. For 3(a) you may use the xgcd function in Sage instead of doing magic box by hand, but don't use other fancy functions in Sage. Please LaTeX your solutions, print out to hand in. |

JAN 31 | Vigenere cipher | Read TW, Chapter 2.3, 2.4. TW, Chapter 2, Exercise 5, 6. Extra exercise: Suppose you create an affine cipher with key alpha = 2 (not coprime to 26) and beta = 7. Give an example of two plaintexts that encipher to the same ciphertext. (LaTeX... but don't over OCD-it!) Definitely bring your laptop. |

FEB 3 | Vigenere cryptanalysis | Have a great weekend; we'll continue to work on the sage worksheet in class tomorrow. |

FEB 5 | More Vigenere cryptanalysis | Read WT, 2.7, 2.8, 2.9. Get started reading The Code Book, Chapter 3. |

FEB 7 | Block Ciphers, Hill Cipher, One-time pad, Enigma | Read WT, 2.10, 2.12. Finish The Code Book, Chapter 3, start Chapter 4. |

FEB 10 | Enigma, Chinese Remainder Theorem | Read WT, 3.4. Finish The Code Book, Chapter 4. WT Chapter 2 Exercises 13, 14, 15, 18. Note: each chapter of the text has "Exercises" and "Computer Problems" - I will use those keywords here to avoid confusion. |

FEB 12 | More number theory | Read WT, 3.5, 3.6. You don't have to hand in your Vigenere worksheet, but take a look at the solutions published online (on sage site) and contact me if you have questions. |

FEB 14 | More number theory | I moved your assignment back to Monday because we didn't cover that much yet. |

FEB 17 | Number theory | WT, Chapter 3, Exercise 10, Exercise 13 (by hand, no sage!!). |

FEB 19 | DES/AES | Get started reading The Code Book, Chapter 6 (we skipped 5). |

FEB 21 | RSA | Finish The Code Book, Chapter 6 |

FEB 24 | RSA, Primitive roots | TW, Chapter 3 Exercises: 15 (4440 students only) and 16. 5440 students should do the following problem: Consider the question of the Chinese Remainder Theorem for non-coprime moduli; do some experiments and make conjectures; prove your conjectures: for example, how many solutions are there to a system of congruences with non-coprime moduli? do such solutions always exist, are they unique? what modulus do they exist with respect to? if you are familiar with rings, is there a ring-theoretic statement? document your explorations and conjectures and anything you can prove; include conjectures you made that you later disproved with a counterexample, etc. This is an intentionally open-ended problem, and I don't necessarily expect you to come up with one particular answer I have in mind, but I want to see your thought process, your creativity, and your ability to communicate mathematically. Don't use any resources for this besides TW. No looking it up! |

FEB 26 | primitive roots | Finish your RSA Sage Project (published as "Fermat, Euler, RSA" on the server), and do review problems for the midterm. Click here for the RSA algorithm. |

FEB 28 | primitive roots, square mod n | None. Recover from midterm. |

MAR 3 | squares mod n | None. |

MAR 5 | Legendre/Jacobi symbols | None. |

MAR 7 | Primality testing | None. |

MAR 10 | Primality testing | Chapter 3 Exercises: 17, 20, 21 (these are somewhat longer problems) |

MAR 12 | Factoring | Chapter 7 of the codebook is good reading for around now. (Note: We skipped Chapter 5; it is interesting but not very relevant to the course.) |

MAR 14 | Factoring -- Quadratic Sieve | Chapter 3 Exercises: 25, 29, 30. |

MAR 17 | Attacks on RSA | Do these exercises: 1) User Miller-Rabin to test n=1093 for primality using a=2; 2) Use Solovay-Strassen to test n=7487 for primality. Note: on these problems, you can use computers to do the basic modular arithmetic (e.g. taking powers mod n), or basic arithmetic (e.g. multiplying and dividing integers), but not for anything else. 5440 students should do the above problems and also do Chapter 6 Exercise 16. |

MAR 19 | Review Day -- Material since midterm | Chapter 6 Exercises: 12, 14. Additional (obligatory) exercises: 1) Use trial division to factor n=1155; 2) Use Fermat factoring to factor n=5621; 3) Use Pollards's (p-1) method to factor n=13193 and explain how large you need to take B to make it work? Note: on these problems, you can use computers to do the basic modular arithmetic (e.g. taking powers mod n), or basic arithmetic (e.g. multiplying and dividing integers), but not for anything else. |

MAR 21 | Discrete Logs and ElGamal | None. |

MAR 31 | Computing Discrete Logs | None. |

APR 2 | Elliptic Curve Cryptography | Chapter 6 Exercise 27, Chapter 3 Exercise 27. |

APR 4 | Signature Schemes | Chapter 7 Exercise 3, 6, 7 (find a trick by hand!!), 11. Extra obligatory exercise: Use Baby Step Giant Step to compute log_{2} 10 modulo 59 (you can use a computer to do modular computations, but demonstrate the algorithm by showing all its steps). |

APR 7 | Bitcoin | Chapter 16 Exercise 2, Exercise 9 (you can just give the theoretical side, no example computation necessary). |

APR 9 | Coding Theory | None. |

APR 11 | Coding Theory | Sign the message "OK" (using A=01, ...) using the ElGamal Signature Scheme. Use the prime p = 637909. Take alpha to be the smallest primitive root (i.e. 2 if that works, if not then 3 if that works, if not then...). Use a = 265579, k = 314953. You can use Sage to do the low-level computations. |

APR 14 | Coding Theory | None. Spend your weekend on KRYPTOS4 (see my email for details on bonus points). |

APR 16 | Coding Theory | TBA |

APR 18 | Coding Theory | TBA |

APR 21 | Coding Theory | TBA |

APR 23 | Coding Theory | TBA |

APR 25 | Coding Theory | TBA |

APR 28 | Quantum Cryptography | TBA |

APR 30 | Quantum Cryptography | TBA |

MAY 2 | Quantum Cryptography | TBA |