Points: 300

Tags: crypto xor 

Poll rating:

Soulcrabber

Problem

main.rs

use rand::{Rng,SeedableRng};
use rand::rngs::StdRng;
use std::fs;
use std::io::Write;

fn get_rng() -> StdRng {
    let seed = 13371337;
    return StdRng::seed_from_u64(seed);
}

fn rand_xor(input : String) -> String {
    let mut rng = get_rng();
    return input
        .chars()
        .into_iter()
        .map(|c| format!("{:02x}", (c as u8 ^ rng.gen::<u8>())))
        .collect::<Vec<String>>()
        .join("");
}

fn main() -> std::io::Result<()> {
    let flag = fs::read_to_string("flag.txt")?;
    let xored = rand_xor(flag);
    println!("{}", xored);
    let mut file = fs::File::create("out.txt")?;
    file.write(xored.as_bytes())?;
    Ok(())
}

out.txt

1b591484db962f7782d1410afa4a388f7930067bcef6df546a57d9f873

Writeups

ActionRatingAuthor team
Read writeup
not rated
KPAX
Read writeup
not rated
\x4247Sec
Read writeup
not rated
Unicorns of Security
Read writeup
not rated
EvilBunnyWrote
Read writeup
not rated
UVeBinPwned
You need to authenticate and join a team to post writeups