# opisthocomus-hoazin (376 solves, 300 points)
## Description
I started by running test values through the algorithm. Specifically, ``flag{`` turned out to be ``65639, 65645, 65632, 65638, 65658``. This is how the flag output starts so
once again we can create a key using the same method as in [aptenodytes-forsteri](https://github.com/BASHing-thru-challenges/HSCTF-2021-Writeups/tree/main/crypto/aptenodytes-forsteri).
This time we have to use the entire ascii character set though.

The output was much longer than the first challenge so I took the time to read it from a file and decode the flag using the created lookup table.

Here's the script to do so:

import time
from Crypto.Util.number import *
import linecache
keyText = "abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()-=_+ABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}`~'\"\\ /?.>,<"
key = {}
def encrypt():
p = getPrime(1024)
q = getPrime(1024)
e = 2**16+1
i = 0
for ch in keyText:
key[ch] = str(ct[i])
i += 1

plainText = list(key.keys())
cypherText = list(key.values())
data = linecache.getline('hoazin.txt', 4)
flag = data.split(', ')
flag[-1] = flag[-1].rstrip()
flagText = ""
for ct in flag:
pos = cypherText.index(ct)
flagText += plainText[pos]

## Flag

Original writeup (https://github.com/BASHing-thru-challenges/HSCTF-2021-Writeups/tree/main/crypto/opisthocomus-hoazin).