# CS327-Cryptography

Nicholas Tamassia

February 27, 2025

CS-327

Cryptography PA

**Program Location:** `/cs/home/stu/tamassno/cs327/cryptography_PA/affine.py`

**Usage:** `python affine.py [encrypt | decrypt | decipher] --help`

## Questions

### 7.1 Part 1
$D(c,a,b)=a^{-1}(c-b)\;\text{mod}\;128$

### 7.1 Part 2
Restrictions on $a$ and $b$:
1. $0 < a < 128$, $a$ and $128$ must be coprime, i.e. $\text{gcd}(128,a)=1$
2. $0 \leq b < 128$

### 7.1 Part 3
Because 128 is coprime with all odd numbers less than itself (1, 3, 5, …, 127), there are 64 possible values for a. There are 128 options for b so there exists an upper limit on valid $a$, $b$
pairs of 8192.