<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Prime numbers on Benjamin Italiaander</title><link>https://tlnd.org/topic/prime-numbers/</link><description>Recent content in Prime numbers on Benjamin Italiaander</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 29 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tlnd.org/topic/prime-numbers/index.xml" rel="self" type="application/rss+xml"/><item><title>Clock arithmetic — exercises</title><link>https://tlnd.org/math/public_key_cryptography/01a_clock_arithmetic/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01a_clock_arithmetic/</guid><description>&lt;h1 id="-clock-arithmetic-exercises"&gt;✏️ Clock arithmetic: exercises&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#1-clock-arithmetic"&gt;1. The mathematics, section 1&lt;/a&gt; · Next: &lt;a href="https://tlnd.org/math/public_key_cryptography/01b_easy_forward_hard_backward/"&gt;Easy forward, hard backward →&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Everything in public-key cryptography happens on a clock. If this page feels easy, the rest of the series will too. Every exercise has its answer hidden below it: work it out on paper first, then click &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-the-remainder"&gt;1. The remainder&lt;/h2&gt;
&lt;p&gt;$a \bmod n$ is the &lt;strong&gt;remainder&lt;/strong&gt; after dividing $a$ by $n$. It is always one of $0, 1, \dots, n-1$.&lt;/p&gt;</description></item><item><title>Diffie–Hellman — exercises and in depth</title><link>https://tlnd.org/math/public_key_cryptography/01e_diffie_hellman/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01e_diffie_hellman/</guid><description>&lt;h1 id="-diffiehellman-exercises-and-in-depth"&gt;✏️ Diffie–Hellman: exercises and in depth&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#4-diffiehellman-key-exchange-1976"&gt;1. The mathematics, section 4&lt;/a&gt; · Previous: &lt;a href="https://tlnd.org/math/public_key_cryptography/01d_rsa/"&gt;← RSA&lt;/a&gt; · Next: &lt;a href="https://tlnd.org/math/public_key_cryptography/01f_elliptic_curves/"&gt;Elliptic curves in depth →&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Diffie–Hellman is the idea that both SSH and TLS rely on for every connection. The formula is one line; the subtle part is &lt;strong&gt;which numbers you may use&lt;/strong&gt;. This page lets you play the exchange, then attack it in three ways, each of which happened to real software. You need &lt;a href="https://tlnd.org/math/public_key_cryptography/01a_clock_arithmetic/"&gt;clock arithmetic&lt;/a&gt; and &lt;a href="https://tlnd.org/math/public_key_cryptography/01b_easy_forward_hard_backward/#3-generators-and-the-order-of-a-number"&gt;generators&lt;/a&gt;. Answers are hidden under &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Digital signatures — exercises and in depth</title><link>https://tlnd.org/math/public_key_cryptography/01g_signatures/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01g_signatures/</guid><description>&lt;h1 id="-digital-signatures-exercises-and-in-depth"&gt;✏️ Digital signatures: exercises and in depth&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#6-digital-signatures-on-a-curve-schnorr--eddsa"&gt;1. The mathematics, section 6&lt;/a&gt; · Previous: &lt;a href="https://tlnd.org/math/public_key_cryptography/01f_elliptic_curves/"&gt;← Elliptic curves&lt;/a&gt; · Back to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/"&gt;1. The mathematics&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Everything here uses part 1&amp;rsquo;s small curve $y^2 = x^3 + 2x + 2 \pmod{17}$ with $G = (5, 1)$ and group order $n = 19$. All &amp;ldquo;signature numbers&amp;rdquo; ($k$, $s$, $e$, $x$) count &lt;strong&gt;modulo 19&lt;/strong&gt;; point coordinates count modulo 17. The table of multiples $kG$ is in &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#53-multiplying-a-point-by-a-number"&gt;part 1&lt;/a&gt;; &lt;a href="https://tlnd.org/math/public_key_cryptography/01f_elliptic_curves/"&gt;Elliptic curves in depth&lt;/a&gt; explains it. Answers are hidden under &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Easy forward, hard backward — exercises</title><link>https://tlnd.org/math/public_key_cryptography/01b_easy_forward_hard_backward/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01b_easy_forward_hard_backward/</guid><description>&lt;h1 id="-easy-forward-hard-backward-exercises"&gt;✏️ Easy forward, hard backward: exercises&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#2-easy-forward-hard-backward"&gt;1. The mathematics, section 2&lt;/a&gt; · Previous: &lt;a href="https://tlnd.org/math/public_key_cryptography/01a_clock_arithmetic/"&gt;← Clock arithmetic&lt;/a&gt; · Next: &lt;a href="https://tlnd.org/math/public_key_cryptography/01c_prime_numbers/"&gt;Prime numbers →&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Public-key cryptography needs a calculation that is &lt;strong&gt;fast one way and hopeless the other way&lt;/strong&gt;. This page lets you feel both directions with your own hands: first how quick the forward direction is, then how slow going back gets, and finally the clever shortcuts attackers use (and why real keys are big enough to survive them). Answers are hidden under &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Elliptic curves and ECDH — the mathematics in depth</title><link>https://tlnd.org/math/public_key_cryptography/01f_elliptic_curves/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01f_elliptic_curves/</guid><description>&lt;h1 id="-elliptic-curves-and-ecdh-the-mathematics-in-depth"&gt;🌀 Elliptic curves and ECDH: the mathematics in depth&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#5-elliptic-curves"&gt;1. The mathematics, section 5&lt;/a&gt; · Previous: &lt;a href="https://tlnd.org/math/public_key_cryptography/01e_diffie_hellman/"&gt;← Diffie–Hellman&lt;/a&gt; · Next: &lt;a href="https://tlnd.org/math/public_key_cryptography/01g_signatures/"&gt;Signatures in depth →&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Part 1 &lt;em&gt;showed&lt;/em&gt; the addition formulas and a table of points. This page &lt;strong&gt;derives&lt;/strong&gt; them, so you see where every symbol comes from, and then follows the path all the way to X25519, the key exchange your SSH client used the last time you connected to GitHub. You need &lt;a href="https://tlnd.org/math/public_key_cryptography/01a_clock_arithmetic/"&gt;clock arithmetic&lt;/a&gt; (inverses) and the idea of &lt;a href="https://tlnd.org/math/public_key_cryptography/01e_diffie_hellman/"&gt;Diffie–Hellman&lt;/a&gt;. Exercises have their answers hidden under &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Prime numbers — the atoms of cryptography</title><link>https://tlnd.org/math/public_key_cryptography/01c_prime_numbers/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01c_prime_numbers/</guid><description>&lt;h1 id="-prime-numbers-the-atoms-of-cryptography"&gt;🔢 Prime numbers: the atoms of cryptography&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/"&gt;1. The mathematics&lt;/a&gt; · Previous: &lt;a href="https://tlnd.org/math/public_key_cryptography/01b_easy_forward_hard_backward/"&gt;← Easy forward, hard backward&lt;/a&gt; · Next: &lt;a href="https://tlnd.org/math/public_key_cryptography/01d_rsa/"&gt;RSA →&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;RSA multiplies two primes. Diffie–Hellman calculates modulo a prime. Curve25519 is named after the prime $2^{255} - 19$. This chapter explains what makes primes so special, proves the two theorems everything rests on, and shows how your computer finds a 1536-bit prime in a fraction of a second. Exercises have their answers hidden under &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>RSA — exercises and in depth</title><link>https://tlnd.org/math/public_key_cryptography/01d_rsa/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01d_rsa/</guid><description>&lt;h1 id="-rsa-exercises-and-in-depth"&gt;✏️ RSA: exercises and in depth&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#3-rsa-1977"&gt;1. The mathematics, section 3&lt;/a&gt; · Previous: &lt;a href="https://tlnd.org/math/public_key_cryptography/01c_prime_numbers/"&gt;← Prime numbers&lt;/a&gt; · Next: &lt;a href="https://tlnd.org/math/public_key_cryptography/01e_diffie_hellman/"&gt;Diffie–Hellman in depth →&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Part 1 made one RSA key with $p = 47$ and $q = 59$. Here you make several yourself, prove why it works, see how real software makes it four times faster, and break it in the ways real attackers have. You need &lt;a href="https://tlnd.org/math/public_key_cryptography/01a_clock_arithmetic/"&gt;clock arithmetic&lt;/a&gt; (inverses) and &lt;a href="https://tlnd.org/math/public_key_cryptography/01c_prime_numbers/"&gt;prime numbers&lt;/a&gt; (Euler&amp;rsquo;s φ). Answers are hidden under &lt;strong&gt;Answer&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Why 77 to 925 digits? — how big is big enough</title><link>https://tlnd.org/math/public_key_cryptography/01h_why_so_many_digits/</link><pubDate>Sun, 29 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/math/public_key_cryptography/01h_why_so_many_digits/</guid><description>&lt;h1 id="-why-77-to-925-digits-how-big-is-big-enough"&gt;📏 Why 77 to 925 digits? How big is big enough&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://tlnd.org/math/public_key_cryptography/"&gt;Overview&lt;/a&gt; · Belongs to &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/"&gt;1. The mathematics&lt;/a&gt; and its &lt;a href="https://tlnd.org/math/public_key_cryptography/01_the_math/#7-how-big-is-big-enough"&gt;section 7, key sizes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The examples in this series use numbers like 23, 2773 and a curve modulo 17, small enough to check by hand. Part 1 says that real systems use &lt;strong&gt;the same formulas with numbers of 77 to 925 digits&lt;/strong&gt;. This page explains where exactly those two numbers come from, and why they are this size: not smaller (then they could be broken) and not bigger (then everything gets slow for nothing).&lt;/p&gt;</description></item></channel></rss>