Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit ac9d281

Browse files
committed
Modified Franklin Reiter Attack README
1 parent cca6b22 commit ac9d281

File tree

9 files changed

+8
-11
lines changed

9 files changed

+8
-11
lines changed
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# RSA-2
22

3-
**Description**: Go do some math
4-
5-
**Challenge points**: 150
6-
7-
**Writeup**:
3+
1. Challenge Description: Go do some math
4+
2. Challenge writeup:
781 Bytes
Loading
594 Bytes
Loading
660 Bytes
Loading
1.03 KB
Loading
660 Bytes
Loading
846 Bytes
Loading
746 Bytes
Loading

RSA-encryption/Attack-Franklin-Reiter/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ Prerequisites:
77
This attack works in a scenario where two messages differ only by a fixed known difference and are encrypted using public key e and same modulus N. The attacker can then recover the two messages in the above scenario using Franklin Reiter's Attack.
88

99
## Theorem
10-
Suppose there are two messages M<sub>1</sub> and M<sub>2</sub> where M<sub>1</sub> != M<sub>2</sub>, both less than N and related to each other as ![equation](https://latex.codecogs.com/png.latex?{\displaystyle&space;M_{1}\equiv&space;f(M_{2}){\pmod&space;{N}}}) for some linear polynomial ![equation](https://latex.codecogs.com/png.latex?{\displaystyle&space;f=ax&plus;b\in&space;\mathbb&space;{Z}&space;_{N}[x]}) where b!=0. These two messages are to be sent by encrypting using the public key (N, e), thus giving ciphertexts C<sub>1</sub> and C<sub>2</sub> respectively. Then, given (N, e, C<sub>1</sub>, C<sub>2</sub>, f), the attacker can recover messages M<sub>1</sub> and M<sub>2</sub>.
10+
Suppose there are two messages M<sub>1</sub> and M<sub>2</sub> where M<sub>1</sub> != M<sub>2</sub>, both less than N and related to each other as ![equation](Pictures/1.gif) for some linear polynomial ![equation](Pictures/2.gif) where b!=0. These two messages are to be sent by encrypting using the public key (N, e), thus giving ciphertexts C<sub>1</sub> and C<sub>2</sub> respectively. Then, given (N, e, C<sub>1</sub>, C<sub>2</sub>, f), the attacker can recover messages M<sub>1</sub> and M<sub>2</sub>.
1111

1212

1313
## Proof
1414
We can write C<sub>1</sub> and C<sub>2</sub> as:
15-
![equation](https://latex.codecogs.com/png.latex?{\displaystyle&space;C_{1}\equiv&space;M_{1}^{e}{\pmod&space;{N}}})
15+
![equation](Pictures/3.gif)
1616
We can also write,
17-
![equation](https://latex.codecogs.com/png.latex?{\displaystyle&space;C_{1}\equiv&space;(f(M_{2})&space;mod&space;N)^{e}{\pmod&space;{N}}})
18-
![equation](https://latex.codecogs.com/png.latex?{\displaystyle&space;C_{1}\equiv&space;M_{1}^{e}{\pmod&space;{N}}})
17+
![equation](Pictures/4.gif)
18+
![equation](Pictures/5.gif)
1919
We can then write the polynomials g<sub>1</sub>(x) and g<sub>2</sub>(x) as:
20-
![equation](https://latex.codecogs.com/png.latex?{\displaystyle&space;g_{1}(x)=f(x)^{e}-C_{1}\in&space;\mathbb&space;{Z}&space;_{N}[x]})
21-
![equation](https://latex.codecogs.com/png.latex?g_{2}(x)=x^{e}-C_{2}\in&space;{\mathbb&space;{Z}}_{N}[x])
20+
![equation](Pictures/6.gif)
21+
![equation](Pictures/7.gif)
2222
So clearly M<sub>2</sub> is a root of both the polynomials above and hence they have a common factor **x-M<sub>2</sub>** (Since, g<sub>1</sub>(M<sub>2</sub>) = 0 and g<sub>2</sub>(M<sub>2</sub>) = 0)
2323
Therefore, we can simply calculate GCD of g<sub>1</sub> and g<sub>2</sub> and if the resultant polynomial is linear, then we get out M<sub>2</sub> and hence M<sub>1</sub>!
2424

0 commit comments

Comments
 (0)