Meet ROXy, a coder obsessed with being exclusively the worlds best hacker. She specializes in short cryptic hard to decipher secret codes. The below hex values for example, she did something with them to generate a secret code, can you figure out what? Your answer should start with 0x.
0xc4115 0x4cf8
Easy to solve with Python code
The ^
operator in Python represents the bitwise XOR operation. When applied to two numbers, it performs the XOR operation on each corresponding pair of bits. Here's how it works:
0xc4115 -> 11000001000100010101 (binary)
0x4cf8 -> 0100110011111000 (binary)
Result -> 10001101111010010101 (binary)
When you use the hex()
function to print the result in hexadecimal format, it converts the binary result to its hexadecimal representation:
10001101111010010101 (binary) -> The Flag (hexadecimal)
So, print(hex(0xc4115 ^ 0x4cf8))
will output The Flag.
couldnt figure out what it was at first then read some comments to understand what it is
ROXy is using eXclusive OR (XOR) which is a boolean operator that is widely used in cryptography. XOR compares two input bits and generates one output bit. The logic is simple. If the bits are the same, the result is 0. If the bits are different, the result is 1.
The 0x prefix in 0xc4115 and 0x4cf8 means we are dealing with hexadecimal (base16).
When you calculate XOR at http://xor.pw/ for example, you get the hexadecimal output you’re looking for. This output is used as secret code to encrypt and decrypt data which is essentially a form of symmetric cryptography.
the webpage also strips the "0x" from the begining both inputs and outputs..
Easy to solve with Python code
The ^
operator in Python represents the bitwise XOR operation. When applied to two numbers, it performs the XOR operation on each corresponding pair of bits. Here's how it works:
0xc4115 -> 11000001000100010101 (binary)
0x4cf8 -> 0100110011111000 (binary)
Result -> 10001101111010010101 (binary)
When you use the hex()
function to print the result in hexadecimal format, it converts the binary result to its hexadecimal representation:
10001101111010010101 (binary) -> The Flag (hexadecimal)
So, print(hex(0xc4115 ^ 0x4cf8))
will output The Flag.
Clue for the newbies: Focus on the name ROXy
so sorry about leaking it.!! UGhhh forgive me I thought it was a protected comment. They need to have a check mark or something in the box to let you know if it's been selected or not
Nice one ROXy, liked it
add the 0x(flag here)
1 month ago
pleasee give me the correct answerss