Tags: diffie-hellman crypto 

Rating:

Here `p` is small, and so is `k`. We [bruteforce](https://github.com/CTF-STeam/ctf-writeups/blob/master/2021/UIUCTF/dhkectfintro_solve.py) all values of `k` from 0 to 30 and see which one gives us the flag.

```python
ciphertext = unhexlify('b31699d587f7daf8f6b23b30cfee0edca5d6a3594cd53e1646b9e72de6fc44fe7ad40f0ea6')

iv = bytes("kono DIO daaaaaa", encoding = 'ascii')
for k in range(31):
key = pad_key(str(k))
cipher = AES.new(key, AES.MODE_CFB, iv)
flag = cipher.decrypt(ciphertext)
if b'uiuctf' in flag:
print(flag)
```

Flag: `uiuctf{omae_ha_mou_shindeiru_b9e5f9}`

Original writeup (https://github.com/CTF-STeam/ctf-writeups/tree/master/2021/UIUCTF#dhke_intro-crypto---50-pts).