# why\_xor

| Info     | Details      |
| -------- | ------------ |
| Category | Cryptography |

## Challenge Overview

> We're given a Python script where every character from the list is the XORed result between each character from `s1` and `s2` with the same corresponding positions.

In this type of challenge I'd like to use **CyberChef** and not complicate things with Python scripts. Even though I extracted and transformed all characters in hex values using python.

<figure><img src="https://3350216265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8aLNxke1qPtepwlrf6VI%2Fuploads%2F9pwDxckWkrArnirxAnfX%2Fscript.png?alt=media&#x26;token=930df926-fc85-40e8-8f18-c58e83107a62" alt=""><figcaption><p>extracting values</p></figcaption></figure>

We're also given a hint that `['\x00', '\x00', '\x00']` at the start of the `xored` list is the best hint we get. Knowing the basics of XOR operations, that means the first 3 characters from both strings are equal.

We also know the flag format, which is `ctf{...}`.

XORed the extracted list with key `ctf` using CyberChef, and got the flag.

<figure><img src="https://3350216265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8aLNxke1qPtepwlrf6VI%2Fuploads%2F3yRn4LlNi0PMaO5FNbyy%2Fcyberchef.png?alt=media&#x26;token=84434adb-3922-4d68-8c49-fefc2309c46c" alt=""><figcaption><p>cyberchef best tool</p></figcaption></figure>

## Final Flag

`ctf{79f107231696395c004e87dd7709d3990f0d602a57e9f56ac428b31138bda258}`

*made by k0d*
