Rating:

Problem description: `Welcome to ASIS Early School.`
Category: Crypto
Solves: 210
Points: 32

first install package: `pip install pycryptodome`

then run code:
```
from Crypto.Util.number import *

iteration = 19

def decrypt(msg):
msg = msg[0:len(msg)-1]
some_name = ""
for i in range(0, len(msg), 3):
some_name += msg[i:i+2]
return some_name

with open("FLAG.enc", "rb") as f:
r = f.read()
f.close()
my_var = bytes_to_long(r)

my_var = bin(my_var)[2:]

for _ in xrange(iteration):
my_var = decrypt(my_var)

ans = int(my_var, 2)

my_var = long_to_bytes(ans)
print my_var
```
NOTE: we change iteration with a for loop and find out it is 19( i remove for loop in this code).

how we write `def decrypt`? we run the original code(challenge) and realize how it work(we give a single character with one iteration) and reverse it.

flag was: `ASIS{50_S1mPl3_CryptO__4__warmup____}`

another solution: [https://github.com/rollsafe/ctf-writeups/tree/master/asis-ctf-2018-quals/the_early_school](https://github.com/rollsafe/ctf-writeups/tree/master/asis-ctf-2018-quals/the_early_school)