Chapter 1: Modular arithmetic

  • euclidean algorithm: find .
  • extended euclidean: find such that
  • euler’s totient function:

Chapter 2

diffie-hellman

elgamal-pke

Hardness of DLP

A very important thing to note is hardness of DLP depends heavily on the groups used. For example: DLP for an additive group in can be solved in using Extended-Euclidean algorithm while the best known solution for DLP in has sub-exponential time algorithm. Elliptic curves has DLP solution computable in which is exponential time.

Shanks Babystep-Giantstep

Can solve DLP in a multiplicative group in .

  • let .
  • create two lists:
    • L1:
    • L2:
  • find match between two lists, let
  • solves

CRT

crt

Pohlig-Hellman Algorithm

In a group , suppose that you have an algorithm to solve discrete logarithm in a group of prime power order, i.e. in steps, then it’s possible to solve discrete logarithm in a group with order in steps.

Basic steps are to divide the algorithm for each prime power factor and find discrete logarithm and then use CRT to solve for in :

  • let . Note that, each is pairwise co-prime. Now, let and
  • for any prime power , let
  • taking it to multiplicative group :
  • each of the previous step takes steps.
  • now use CRT, to solve for in each in steps.

Polynomial Rings

, where form a ring with .

  • write as where and and
  • arithmetic on polynomial rings
  • , then there is a common divisor of .
    • extended euclidean algorithm to compute .
  • every element of ring can be factored into monic irreducible polys.

Quotient ring: let be an irreducible poly, then every congruence class has representation such that .

  • unit in a quotient ring: exists iff
    • go in both direction, let exists and then prove that gcd(a,m)=1
    • let , then exists.
  • every element in the field created by quotient ring has a multiplicative inverse.
    • take help of , if gcd=1, then unit exists
    • if gcd=d, then d divides m, but m is irreducible and monic, then d = m, and d divides a, so m divides a. if m divides a then .

prove that there exists an irreducible polynomial of degree .

Exercises

  • prove lagrange’s theorem, i.e. has subgroup of such that , if and is a finite group.
  • 2.11-2.15: how do I prove if a group is commutative? and if a group is commutative, does lie inside group? prove?
  • 2.14: how to prove if a map is group homomorphism?
    • prove map holds for
    • identity element is preserved
  • 2.22: show a map is homomorphism of rings.
    • shown by representing an element in quotient ring as a+my and then mapping to product of rings and checking ring operations (+,*).
  • 2.25: if you know the square root solution, how to use it to factorise ?
  • 2.29: prove a ring with non-zero element is a field. use the map to map element from a a.b. prove that map is 1-1. then for . thus inverse exists.
  • 2.40: couldn’t find the starting point to compose the proofs. i + (1+…+1) = j + (1+…+1)

Chapter 3: Integer factorisation and RSA

  • diffie-hellman and el-gamal cryptosystem is based on hardness of DLP, i.e. , where a, b and p are public values and x is the secret.
  • in RSA cryptosystem, , where e, c, and N are public values. In short, RSA is based on hardness of finding eth roots modulo N.
  • theorem: let be distinct primes, and , then
    • proof is using Fermat’s Little Theorem, as

let be a prime and let be an integer satisfying , then

  • let be a prime, and such that , then there exists such that . Now, let , then unique solution to congruence is
    • prove existence and uniqueness of solution.
  • let be distinct primes, and such that , then . Now, let , then unique solution to congruence is .
    • prove existence and uniqueness of solution.

RSA encryption

  • let Alice and Bob be two participants.
  • Bob chooses two distinct primes and calculates .
    • choose public encryption key such that , send to Alice.
  • Alice chooses the message m and encrypt as . Send ciphertext to Bob.
  • Bob knowing p and q, finds such that , decrypts ciphertext as
  • security of RSA doesn’t depend on adversary Eve knowing private key , but, it depends on hardness of finding solution to . Thus, even if Eve knows , it’s easier to find solution.
  • Also, bob has two choices, either make encryption key larger and decryption key smaller, or vice versa. making decryption key smaller is usually insecure.
  • Man in the middle attack: these are attacks that are not directly related to cryptosystem’s problem hardness but on other factors like communication between parties involved.
  • For example: in RSA, attacker Eve can intercept Alice’s ciphetext and send to Bob.
  • Bob, then decrypts and send to Eve which she can decrypt easily knowing .
  • similarly, using multiple encrpytion keys is also not secure, as Eve can find , being two encryption keys, and being ciphertexts sent by Alice to Bob. Eve can compute, . if, , then Eve has ciphertext.

Primality testing

  • Fermat’s little theorem can be used to prove compositeness of a number, but can’t prove primality of it. i.e. if
  • Carmichael numbers: that are composite but exhibit FLT.
  • Miller-Rabin test: checks whether a number is composite or not, and gives Miller-Rabin witness for a number
    • get a test subject : , a witness suspect :
    • check whether is even, or , return Composite
    • factorise , with as odd number.
    • write
    • if , then return failure (i.e. not sure if prime)
    • loop: :
      • if , return failure
      • set
    • return composite
  • Proof of Miller-Rabin test: for an odd prime: if , then either , or must hold.

Distribution of primes

  • distribution of primes: very interesting mathematical results that check how prime numbers are distributed across ranges.
  • prime number theorem: , where represents number of primes between .
  • TODO: read proof of prime number theorem
  • using prime number theorem, one can estimate the probability of finding a prime number in a range, and can use miller-rabin test to be confident that the chosen number is prime.
  • riemann hypothesis: is used to explain distribution of prime numbers
  • riemann zeta function: , is also equal to the product: , and thus, incorporates information about set of prime numbers.
  • using generalised riemann hypothesis, every composite number has a miller-rabin witness for its compositeness satisfying . but even Riemann hypothesis hasn’t been proven let alone it’s generalised version.
  • Ask primality test: proposed an unconditional polynomial time algorithm for checking primality based on the relation

Pollard’s factorisation

  • main logic to break RSA lies in the factorisation of either or . pollard’s factorisation gives factors of using .
  • it’s concept lies in the fact that if we find a number such that and implies for a number , and .
  • then , hence we can find , if we have a number .
  • Pollard’s observation: is the number that divides, if p is product of small primes.

how small should the primes be?

  • pollard’s factorisation algorithm: Integer to be factored
    • set (can be any a)
    • loop:
      • set
      • find
      • if , then success, return
      • else loop for next
  • thus, to save such attacks in RSA, user has to choose such that neither is product of small primes.
  • smooth number refers to a number such that all prime factors of are less than or equal to .
  • conversely, a number is smooth number if all its prime factors are less than or equal to .

factorisation via squares

  • to factorise N, find such that , then it’s highly probable that N factors into or , so you can find factors of N from or .

a square number is always 0 (if even) or 1 (if odd) modulo 4. Why?

  • a method to find correct :
    • find such that relation factors into small primes (2,3,5,7,11)
    • take such that product form a square (i.e. power of every prime in product is even)
    • compute , then can be nontrivial factor of .