XOR Pain

Level: 3 Score 30 Category crypto

There is a piece of code and a text file. Make it work!!

Link: SecurityValley/PublicCTFChallenges/crypto/xor_hellarrow-up-right

Analysis

  1. xor_hell.pyarrow-up-right performs standard XOR operation on the flag

  2. We have the output (in hex format)

  3. Key is 0. It's not a real key, but rather redacted value

Solution

Since we know that XOR is a symmetrical encryption we can abuse that.

By using Crib Attackarrow-up-right method we can find the key and then decrypt the flag. We can utilize the crib attack since we know that flag always starts with SecVal{

Cyberchef

Note: Bruteforcing whole flag from Cyberchef will take ages, doing chunk by chunk is faster

After doing it for other parts

key=6f6d67 in hex (we know this because key gets repeated).

To test the key we can use XOR from CyberChef and get the flagCyberchef

Last updated