Code
[1, 4, 9]
DSAN 5500: Data Structures, Objects, and Algorithms in Python
Thursday, April 16, 2026
[1, 4, 9]
compute_powers()) commit code and go to sleep 😴exponent argument would tell user they need to explicitly specify exponent before using your function!)exponent environment variable)1000000.0
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[5], line 1 ----> 1 parse_money_amount("1'000'000") Cell In[4], line 2, in parse_money_amount(money_amount) 1 def parse_money_amount(money_amount: str) -> float: ----> 2 return float(money_amount.replace(",","")) ValueError: could not convert string to float: "1'000'000"
10
24
| 👍 | 👎 | |
|---|---|---|
| One-Time Pad | Provably perfectly(!) secure ✅ | Requires establishing a single shared (symmetric) key |
| RSA / Diffie-Hellman / ElGamal | Provably secure (via NP-hardness of prime factorization) ✅ | Restarts sometimes required; key sizes have to grow exponentially bc Moore’s Law |
| Elliptic Curve Cryptography | Provably secure (discrete logarithm NP-hard) ✅ | [Still 👍] Smaller key sizes: 256-bit ECC \(\approx\) 3072-bit RSA |
| Throughout: Public keys, secret keys, signatures, etc., are all functions! \(\leadsto\) Functional Programming |
||
Addition of points (\(\oplus\)) and multiplication-by-constants (\(\otimes\)) given an elliptic curve. From AbdElHaleem et al. (2022)
| 1. \(P \rightarrow 2P\) | 5. \(12P \rightarrow 24P\) |
| 2. \(2P \rightarrow 3P\) | 6. \(24P \rightarrow 25P\) |
| 3. \(3P \rightarrow 6P\) | 7. \(25P \rightarrow 50P\) |
| 4. \(6P \rightarrow 12P\) | 8. \(50P \rightarrow 100P\) |
| 1. \(1 \cdot P\) | |
| 2. \(2 \cdot P\) | |
| 3. \(3 \cdot P\) | |
| \(\vdots\) |
curve: "p1707" => y^2 = x^3 + 0x + 7 (mod 17)
0 * G = (None, None)
1 * G = (15, 13)
2 * G = (2, 10)
3 * G = (8, 3)
4 * G = (12, 1)
5 * G = (6, 6)
6 * G = (5, 8)
7 * G = (10, 15)
8 * G = (1, 12)
9 * G = (3, 0)
10 * G = (1, 5)
11 * G = (10, 2)
12 * G = (5, 9)
13 * G = (6, 11)
14 * G = (12, 16)
15 * G = (8, 14)
16 * G = (2, 7)
17 * G = (15, 4)
18 * G = (None, None)
19 * G = (15, 13)
20 * G = (2, 10)
21 * G = (8, 3)
22 * G = (12, 1)
23 * G = (6, 6)
24 * G = (5, 8)
DSAN 5500 Week 13: Elliptic Curve Cryptography