Tags: crypto xor
Rating:
1. Decode the hex of the encrypted flag into ASCII
```bash
echo 2e313f2702184c5a0b1e321205550e03261b094d5c171f56011904 | xxd -r -ps > encodedascii.txt
```
2. Find the key by supplying the encrypted flag to [xor-decrypt](https://github.com/AlexFSmirnov/xor-decrypt), and `CHTB{` as key
```bash
python3 xor-decrypt.py -i "encodedascii.txt" -o key.txt -k CHTB{ -d
```
So we get `mykey[IeqZQu@nOK6_KzZL`, and deduce that `mykey` is the 5-byte key
3. Decrypt the encrypted flag using our key
```bash
python3 xor-decrypt.py -i encodedascii.txt -o flag.txt -k mykey -d
```