XOR Starter
XOR is a bitwise operator which returns 0 if the bits are the same, and 1 otherwise. In textbooks the XOR operator is denoted by ⊕, but in most challenges and programming languages you will see the caret ^ used instead.
For longer binary numbers we XOR bit by bit: 0110 ^ 1010 = 1100. We can XOR integers by first converting the integer from decimal to binary. We can XOR strings by first converting each character to the integer representing the Unicode character.
challenge : Given the string label, XOR each character with the integer 13. Convert these integers back to a string and submit the flag as crypto{new_string}.
Solution : I wrote below python script to solve the challenge
Code python
string = "label"
print("crypto{",end="")
for i in string:
print(chr(ord(i)^13),end="")
print("}")
Output/Flag : crypto{aloha}
In Rust
Code rust
fn main() {
let h = "label";
print!("crypto{{");
for i in h.chars() {
let c = match char::from_u32((i as u32) ^ 13) {Some(a) => a,None => todo!(),};
print!("{}", c);
}
print!("}}");
}