Cryptography

{"authors": ["ret2basic"]}

spelling-quiz

Challenge

I found the flag, but my brother wrote a program to encrypt all his text files. He has a spelling quiz study guide too, but I don't know if that helps.

public.zip

Solution

First we write a frequency analysis script to find out the most common letter in study-guide.txt. Once we have that information, use it as "clues" for quipqiup:

quipqiup

Implementation

XtraORdinary

Challenge

Check out my new, never-before-seen method of encryption! I totally invented it myself. I added so many for loops that I don't even know what it does. It's extraordinarily secure!

output.txt encrypt.py

Solution

Ideas:

  1. The nested loop is useless. There are only two cases for each random string: either we XOR it, or we don't. That is, we can only keep the for m in range(randint(0, pow(2, 0))) loop and delete everything else.

  2. The random string b'ever' is repeated. If we delete the repeated strings, it won't make a difference to the XOR result. Although this step is unnecessary, it can speed up the script.

Implementation

triple-secure

Challenge

To get the flag, you must break RSA not once, but three times!

public-key.txt encrypt.py

Solution

The exp is self-explanatory.

Implementation

college-rowing-team

Challenge

I just joined my college's rowing team! To make a good first impression, I started sending my teammates positive automated messages every day. I even send them flags from time to time!

encrypted-messages.txt encrypt.py

Solution

Note that each ciphertext is short and e=3 is small. We can brute-force c + k * n for each positive integer k until c + k * n is a perfect cube. If a perfect cube is found, simply compute its cubic root, which is just the plaintext.

Implementation

Last updated