Quiz 1: October 05
Quiz 2: October 14
Quiz 3: October 28
Quiz 4: November 13
Quiz 5: November 30
Makeup Quiz: December 04
Final: December 07
Assignment 1, due October 17
Assignment 2, due November 22
Assignment 3, due December 04
December 04: Makeup quiz
December 02: Elliptic curve Elgamal [Section 4.13]
November 30: Quiz 5
November 25: No class.
November 23: Quadratic Residues and Euler's criterion [Section 4.12]
November 20: The Discrete Logarithm Problem for Elliptic Curves is the following: given a prime p and an elliptic curve E which is nonsingular mod p, and points P and Q on E mod p, if Q = rP, can you compute r? This problem is computationally hard and forms the basis of most Elliptic curve cryptographic algorithms. We then discussed the Elliptic Curve Diffie--Hellman algorithm -- this is very similar to the ordinary Diffie--Hellman algorithm, except the public key is (E, p, P) where E is an elliptic curve which is nonsingular modulo p, and P is a solution of E modulo p; and rather than exponentiating an integer modulo p, both Alice and Bob, after choosing secret keys k_a and k_b, instead compute and share k_a P and k_b P respectively; and the shared message is just the point k_a k_b P on E modulo P. [Section 4.11]
November 18: We first defined the notion of an order of a point P on an elliptic curve E -- it is the smallest r > 0, if it exists, such that rP = O. We noted that for an elliptic curve over the real numbers, very few points have finite order. An elliptic curve E with a and b integers is nonsingular modulo p if its Discriminant is not divisible by p. Fixing such a p, we discussed the solutions of E modulo p; the solutions of E modulo p along with the point at infinity can also be endowed with an addition operation. Since the number of solutions modulo p is at most p^2, all points on E modulo P have finite order, denoted ord_{E, p}(P). Furthermore, if rP = 0, then ord_{E,p}(P) divides r. [Section 4.9, 4.10]
November 16: For us, an elliptic curve E is, for fixed a and b with -16(4a^3 + 27b^2) ≠ 0, the points on the x-y plane defined by the equation y^2 = x^3 + ax + b along with the point at infinity. We are interested in elliptic curves as we can use the geometry of an elliptic curve to define an addition operation on its points. To compute P+Q, we first draw the secant line joining P and Q; this line meets the curve at a third point reflect this point along x-axis, and P+Q is the reflection of this third point along the x-axis. To compute P+P, we draw the tangent line to E at P and reflect the second point of intersection along the x-axis. For example, consider the Elliptic curve defined by y^2 = x^3 + 1; the points P=(-1,0) and Q = (0,1) are on E, and doing this process yields P+Q = (2, -3). [Section 4.8, 4.9]
November 13: Quiz 4
November 9: We continued with known-plaintext attacks for simple substitution cipher [Section 3.9]
November 6: We learnt how to perform a G-test and used it to break rectangular transposition and to carry out a known-plaintext attack on simple substitution ciphers. [Section 3.7, 3.8, 3.9]
November 4: We discussed the ElGamal algorithm, a public-key cryptosystem built on a primitive root modulo a prime p, and saw how encryption and decryption work. We also discussed why its security rests on the difficulty of the discrete logarithm problem. [Section 4.7]
November 2: We discussed what a primitive root modulo p is, namely an integer g whose order modulo the prime p is p-1 (equivalently, whose powers produce every nonzero residue mod p), and worked through examples of finding and checking primitive roots. [Section 4.6]
October 30: We implemented the RSA algorithm. BOB chooses a large number n = pq, where p and q are two large distinct primes, and also a number d which is coprime to phi(n) = (p-1)(q-1). BOB computes a multiplicative inverse of d mod phi(n), call it e. The pair (n, e) is made public; p and q can be forgotten, and d is kept private. If ALICE wants to send a message m, she computes c = m^e mod n and sends c to BOB, who simply computes c^d mod n, which we saw recovers m. The security of RSA rests on the belief that computing prime factorizations is difficult. [Section 4.5]
October 28: Quiz 3
October 26: We worked through selected problems from the worksheet, which covered the recent material on the Euler totient function, Euler's theorem, and modular exponentiation (see Canvas > Files > lecture_handouts).
October 23: We learnt how to compute binary expansions of integers, the remaining step needed for binary exponentiation, and used it to quickly compute large exponents. We then discussed how to implement the Diffie–Hellman algorithm. [Section 4.3, 4.8]
October 21: We first deduced several formulas for Euler's totient function (especially phi(n) = n \prod_{p divides n} (1 - 1/p) ) from the fact that it is multiplicative. We then saw Euler's theorem: given coprime integers a and n, a^{phi(n)} ≡ 1 (mod n). This allows us to greatly speed up computing exponents modulo n. Specifically, we have a^N ≡ a^r (mod n) where N ≡ r (mod phi(n)). We introduced the order of an integer a modulo n where gcd(a, n) = 1: it is the smallest positive integer r such that a^r ≡ 1 (mod n). We saw that ord_n(a) divides phi(n). [Section 4.2, 4.6]
October 19: We started Chapter 4, defined Euler's totient function, computed some examples, and stated that it is a multiplicative function. [Section 4.1, 4.2]
October 16: We defined the index of coincidence for a block of text and used this to break the Vigenere cipher. [Section 3.5, 3.6]
October 14: Quiz 2
October 12: We saw the final classical cipher, namely rectangular transposition. See this page for a detailed explanation. We started Chapter 3 and discussed how to use frequency analysis, which allows us to easily break simple substitution ciphers. We fumbled through one example (the opening passage of "A Tale of Two Cities") using the Sage cell in the textbook. [Section 2.2, 3.1, 3.2]
October 09: We talked about 2x2 matrices and computing their determinants and inverses. Then we focussed on 2x2 matrices with entries in the integers mod 26. In this case, a matrix is invertible if its determinant is coprime to 26. This allows us to construct the Hill cipher, where the KEY is a 2 x 2 matrix which is invertible mod 26. We also saw how the Playfair cipher works. Both of these are examples of polyalphabetic ciphers. [Section 2.10, 2.11, 2.12]
October 07: Recall that if a and n are coprime, then ra ≡ 1 (mod n) where r is a Bezout coefficient of a in ra + sn = 1. This allowed us to construct the Affine cipher, where the KEY is a pair of integers a and b such that a is coprime to 26. We use the standard letter-to-number correspondence to map each letter x to the letter corresponding to ax + b (mod 26). To decrypt a ciphertext, we map each letter y to r(y-b) mod 26, where r is an inverse of a mod 26. [Section 2.6, 2.7]
October 05: Quiz 1
October 02: We executed the Euclidean algorithm on many examples and saw how to obtain Bezout's theorem: given integers a and b, there exist integers r and s such that gcd(a, b) = ra + sb. The coefficients r and s are called Bezout coefficients of a and b respectively. We discussed how to use Bezout's coefficients to obtain (multiplicative) inverses of integers mod n. Specifically, if a and n are coprime, then ra ≡ 1 (mod n) where r is a Bezout coefficient of a in ra + sn = 1. [Section 2.6]
September 30: We defined what it means for two integers to be equivalent mod n: a ≡ b (mod n) if and only if n divides (b-a), or equivalently, a and b leave the same remainder when divided by n. We explained how modular arithmetic works, saw how to execute the Vigenere cipher, and defined the greatest common divisor of two integers. [Section 2.5, 2.13, 2.6]
September 28: We introduced the general framework for classical cryptosystems. We saw the simple substitution cipher and the Polybius square (ADFGVX cipher) with many examples. [Section 2.8, 2.9]
September 25: We went through the syllabus, gave a quick history of cryptography, and saw how to execute the Caesar cipher with an example. [Chapter 1; Section 2.4]
Lecture Time: MWF 1 to 1:50pm
Lecture Location: HSS 1330
Textbook: An Introduction to Cryptography, by Shishir Agrawal. Available online via this link.
Discussion Section:
Section 001: Wednesday, 4:00pm-4:50pm at SOLIS 111
Section 002: Wednesday, 5:00pm-5:50pm at SOLIS 111
Section 003: Wednesday, 4:00pm-4:50pm at HSS 4025
Section 004: Wednesday, 5:00pm-5:50pm at HSS 4025
Course Personnel:
Instructor: Karthik Ganapathy Venkitachalam
Teaching Assistant for Sections A01: JD Flynn
Teaching Assistant for Sections A02: JD Flynn
Teaching Assistant for Sections A03: Jasper Liu
Teaching Assistant for Sections A04: Jasper Liu
Note: To contact us, please use Piazza. The system is highly catered to getting you help fast and efficiently from classmates, the TA, and myself. Rather than emailing questions to the teaching staff, I encourage you to post your questions on Piazza. If you have a question that is fairly long, please come to office hours and speak to me directly.
Office Hours:
Karthik: Monday 4:15pm-5:45pm, Friday 11am-12:30pm at APM 1230
JD: Tuesday 5:15pm-6:15pm and Thursday 5:15pm-6:45pm at HSS 4012
Jasper: Tuesday 10:00am-12:30pm at HSS 4070
Quizzes:
There will be five quizzes in class on the following dates: October 05, October 14, October 28, November 13, November 30. Each quiz is cumulative but the emphasis will be what was covered the previous three or four lectures leading up to it. If you miss any of the five quizzes, you can take a makeup quiz on December 04. Aside from this, no makeup quizzes will be given. Each quiz is equally weighted.
Reading Assignments:
You will be assigned sections of the textbook to read every week, and you are expected to fill a form answering some basic questions based on these readings. Each reading assignment is equally weighted.
Reflection Assignments:
There will be three reflection assignments which will be posted on Canvas. They will be due on October 17, November 18, and December 04. The first reflection assignment is worth 1% of your overall grade; the second and third are worth 2.5% each.
Final Exam:
It is on Monday, December 7, 2026 from 11:30am-2:29pm at HSS 1330. No makeup final will be given in this course.
Note: It is standard Math Department practice to utilize different versions of exams, both within each lecture's exam, and between lectures whose exams are at different times.
Regrades: Regrade requests for Quizzes and the Final may be made using the built-in regrade request feature in Gradescope. Typically, you are given one week from when the scores are released to submit regrade requests. For the Final and later quizzes, this window will be greatly shortened.
Grading Policy:
To ensure fairness and recognize different paths to success, your final grade will be calculated using the highest score from three grading rubrics:
9% Reading Assignments; 6% Reflection Assignments; 45% Final; 40% Quizzes
9% Reading Assignments; 6% Reflection Assignments; 35% Final; 50% Quizzes
9% Reading Assignments; 6% Reflection Assignments; 60% Final; 25% Quizzes
The first rewards students who stay consistent with quizzes and assignments, the second protects against having a single off day during finals, and the third provides an opportunity to demonstrate mastery on the final exam even if earlier work was weaker.
The final grades will be at least as generous as the standard ones (97.00 - 100.00 A+; 94.00 - 96.99 A; 90.00 - 93.99 A-; 87.00 - 89.99 B+; 84.00 - 86.99 B; 80.00 - 83.99 B-; 77.00 - 79.99 C+; 74.00 - 76.99 C; 70.00 - 73.99 C; <70.00 F).
Attendance Policy: You are expected to attend every session of the lectures and discussion section you are enrolled in. Students who do not attend class rarely succeed in this course. If you must miss class for any reason, it is your responsibility to catch up on the material. You are also responsible for the information given in any announcements made during class. Please note that lectures will NOT be recorded.
Academic Integrity: Academic dishonesty is considered a serious offense at UCSD. Students caught cheating will face an administrative sanction which may include suspension or expulsion from the university. Using LLMs for any assignments will be considered a form of academic dishonesty.
Accommodations: Students requesting accommodations for this course due to a disability must provide a current Authorization for Accommodation (AFA) letter issued by the Office for Students with Disabilities (https://osd.ucsd.edu/.) Students are required to discuss accommodation arrangements with instructors and OSD liaisons in the department in advance of any exams or assignments.
Food Support for Students: If you are skipping and stretching meals, or having difficulties affording or accessing food, you may be eligible for CalFresh, California’s Supplemental Nutrition Assistance Program, that can provide up to $298 a month on a debit card to buy food. Students can apply at benefitscal.com/r/ucsandiegocalfresh. And don’t forget to recertify every six months to continue receiving benefits.
The Hub Basic Needs Center empowers all students by connecting them to resources for food, stable housing and financial literacy. Visit their site at basicneeds.ucsd.edu.