Tags: crypto xor
Rating:
### Question
Background story: this code was once used on a REAL site to encrypt REAL data. Thankfully, this code is no longer being used and has not for a long time.
A long time ago, one of the sites I was building needed to store some some potentially sensitive data. I did not know how to use any proper encryption techniques, so I wrote my own symmetric cipher.
The encrypted content in output.bin is a well-known, olde English quote in lowercase ASCII alphabetic characters. No punctuation; just letters and spaces.
The flag is key to understanding this message.
```
string = "sf'gh;k}.zqf/xc>{j5fvnc.wp2mxq/lrltqdtj/y|{fgi~>mff2p`ub{q2p~4{ub)jlc${a4mgijil9{}w>|{gpda9qzk=f{ujzh$`h4qg{~my|``a>ix|jv||0{}=sf'qlpa/ofsa/mkpaff>n7}{b2vv4{oh|eihh$n`p>pv,cni`f{ph7kpg2mxqb"
```
```
^ ~
2 R r
/ O o
, L l
, L l
> ^ ~
9 Y y
/ O o
5 U u
2 R r
> ^ ~
/ O o
7 W w
. N n
> ^ ~
# C c
2 R r
9 Y y
0 P p
4 T t
/ O o
= ] }
```
Looks like we only had to add 96...
```
l3 = [int(_) for _ in "7 9 7 5 13 27 4 15 14 20 30 18 15 12 12 30 25 15 21 18 30 15 23 14 30 3 18 25 16 20 15 29".split()]
for i in l3:
print(chr(i + 96), end='')
```
```
gigem{dont~roll~your~own~crypto}
```
which, ladies and gentlemen is the flag!