Tags: crypto rsa 

Rating:

the provided text file shows really big numbers

- `lotta_numbers.txt`

```
c: 34709089913401150635163820358938916881993556790698827096314474131695180194656373592831158701400832173951061153349955626770351918715134102729180082310540500929299260384727841272328651482716425284903562937949838801126975821205390573428889205747236795476232421245684253455346750459684786949905537837807616524618

p: 7049378199874518503065880299491083072359644394572493724131509322075604915964637314839516681795279921095822776593514545854149110798068329888153907702700969

q: 11332855855499101423426736341398808093169269495239972781080892932533129603046914334311158344125602053367004567763440106361963142912346338848213535638676857

e: 65537
```

and if you haven't noticed the challenge name and description give off that this is a RSA algorithm challenge

- $p, q$ large prime numbers
- $c$ is the ciphered message
- $e$ is a part of the public key

now we can easily compute $n = p * q$ and we'll have the public key (e, n)

we can compute phi from $\phi(n) = (p-1) * (q-1)$

and lastly $d$ the modular inverse of $e$ from [`this calculator`](https://www.dcode.fr/modular-inverse)

the decrypted message can be acquired from the following formula:

$$m = c^d \enspace mod \enspace n$$

we have all the required parameters to crack the cipher so plug them into [`this calculator`](https://www.dcode.fr/rsa-cipher)

and u get the flag

![Screenshot](https://www.notion.so/Road-Safety-Association-de199ad00ba14c7ea1609a4b05e7c9d5#4b18cbf1c1f345e98c0f917912c31241)

### flag

`kqctf{y0uv3_6r4du473d_fr0m_r54_3l3m3n74ry_5ch00l_ac8770bdcebc}`

Original writeup (https://earthy-saguaro-61f.notion.site/Road-Safety-Association-de199ad00ba14c7ea1609a4b05e7c9d5).