🐻
berkeley
  • #Despair
  • 16A/B
    • Thevenin and Norton Equivalence
    • Resistive Touchscreen
    • Trilateration and Correlation
    • RC Circuits & Transient Analysis
  • 61B
    • Testing
    • References in Java
    • Linked Lists in Java
    • Implementation Inheritance
    • Comparables and Iterators
    • Casting
    • Lists and Sets
    • Asymptotics
    • Trees
    • Hashing
    • PriorityQueue and Heap
    • Graphs, Tree Traversals
    • Tries
    • Sorting
  • Discrete Mathematics
    • Sets + Mathematical Notation
    • Logic and Proofs
    • Induction
    • Cryptography/RSA
    • Modular Arithmetic
    • Discrete Probability
  • Linear Algebra
    • Linear Equations
    • Matrix Algebra
    • Determinants
    • Vector Spaces
    • Eigenvectors and Eigenvalues
    • Projections and Orthogonality
    • SVD/PCA
  • Math 275 — Ordinary Differential Equations
    • Math 275 — Overview
    • Modeling via Differential Equations
    • Linear Systems
  • INTEGBI 35AC
    • Humans Came From Fish
    • Evolution's History
    • Typology
    • The Human Diaspora
  • 170
    • Basics
    • Divide and Conquer
    • Fast Fourier Transform
    • Graphs
    • Greedy
  • 61C
    • Pointers and Memory
    • Floating Point
    • Compliation, Assembly, Linking, Loading
    • RISC-V, Assembly
Powered by GitBook
On this page
  • Fermat's Little Theorem
  • RSA
  • Encryption
  • Decrpytion

Was this helpful?

  1. Discrete Mathematics

Cryptography/RSA

Fermat's Little Theorem

The theorem states that for any prime p and any number a∈{1,...p−1}a \in \{1, ... p-1\}a∈{1,...p−1} we have that ap−1≡1 mod p.a^{p - 1} \equiv 1 \text{ mod }p.ap−1≡1 mod p.

RSA

RSA starts off with two primes, ppp and q.q.q.

We have N:=pqN:= pqN:=pq and a number eee such that gcd(e,(p−1)(q−1))=1.\text{gcd}(e, (p - 1)(q-1)) = 1.gcd(e,(p−1)(q−1))=1. Our private key is d:=e−1(mod(p−1)(q−1))d:= e^{-1}(\text{mod} (p - 1)(q - 1))d:=e−1(mod(p−1)(q−1))

Encryption

E(x)=xemod NE(x) = x^e \text{mod } NE(x)=xemod N

Decrpytion

D(x)=ydmod ND(x) = y^d \text{mod } ND(x)=ydmod N
PreviousInductionNextModular Arithmetic

Last updated 3 years ago

Was this helpful?