This commit is contained in:
John Gatward committed 2026-10-04 15:24:17 +01:00
1 parent d0f27f276b
commit d6f54d4ec2
103 files changed
+3663 -3779

No files matched your search

+16 -18
View File
@@ -20,9 +20,7 @@ d_{s_i} (y_i) \equiv (x_i + 0\cdot s_i \space (mod\space 2) \\
d_{s_i} (y_i) \equiv x_i
$$
Note: 2 % 2 is 0, its like **xor**-ing twice.
Note: 2 % 2 is 0; it's like **xor**-ing twice.
#### Security of XOR
@@ -44,12 +42,12 @@ The security of a stream cipher depends entirely on the nature of the key stream
##### True Randomness
- True randomness is impossible to recreate except by chance
- coin flips
- coin flips
- Computer systems often use hardware sources for randomness
- Thermal or other noise
- Radioactive decay
- Clock drift
- Random timings of interrupts
- Thermal or other noise
- Radioactive decay
- Clock drift
- Random timings of interrupts
##### Pseudo Randomness
@@ -58,7 +56,7 @@ The security of a stream cipher depends entirely on the nature of the key stream
###### Linear Congruential Generator
Cs `rand()` function, this is a PRNG
C's `rand()` function is a PRNG
$$
s_0 = 12345 \\
@@ -76,7 +74,7 @@ $$
#### Unconditional Security
A crypto-system is **unconditional security** is unconditionally or information-theoretically secure if it cannot be broken, even with infinite computational resources.
A cryptosystem has **unconditional security**: it is unconditionally or information-theoretically secure if it cannot be broken, even with infinite computational resources.
**Perfect Secrecy**: The cipher-text should reveal no information about the plain text
@@ -84,7 +82,7 @@ $\forall_{m_0, m_1} \in M$ where $|m_0| = |m_1|$ and $\forall_c \in C$
$Pr[E(k,m_0) = c] = Pr[E(k,m_1) = c]$
The probability that $m_0$ encrypts to $c$ is the same as the probability of $m_1$ also encrypted to $c$
The probability that $m_0$ encrypts to $c$ is the same as the probability of $m_1$ also being encrypted to $c$
## One Time Pad
@@ -134,7 +132,7 @@ $$
#### Crib Dragging
This involves guessing $M_1$, this can be a common message such as `HTTP` request.
This involves guessing $M_1$; this can be a common message such as an `HTTP` request.
This can be automated by checking $M_1$ over different parts of $M_2$.
@@ -145,14 +143,14 @@ This can be automated by checking $M_1$ over different parts of $M_2$.
- Numbers used once or *nonces* are vital for stream cipher security
- Instead of always using a unique key, the security requirement is you always use a unique (key + nonce) pair
- Nonces are not secret, they are public random seed for a key stream
- Nonces are not secret; they are public random seeds for a key stream
### Could we use a LCG?
### Could we use an LCG?
- LCG - Linear congruential generators
- Seed using some key, then
- $s_{i+1} \equiv A \cdot s_i + B \space (mod \space 2)$
- $s_i, A, B$ are $log_2m$ bits long
- $s_{i+1} \equiv A \cdot s_i + B \space (mod \space 2)$
- $s_i, A, B$ are $log_2m$ bits long
- This is trivial to break
- Given known plaintext $x_1, x_2, x_3$
- Calculate corresponding key $s_1, s_2, s_3$
- Given known plaintext $x_1, x_2, x_3$
- Calculate corresponding key $s_1, s_2, s_3$