Created
January 23, 2021 00:12
-
-
Save 10maurycy10/0e30096d37269c986f676e4e854b187e to your computer and use it in GitHub Desktop.
a terrible encription.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Gen { | |
key: i32 | |
} | |
impl Iterator for Gen { | |
type Item = u8; | |
fn next(&mut self) -> Option<Self::Item> { | |
self.key += 1; | |
Some(( | |
((self.key+3*3)^17)%256 | |
) as u8) | |
} | |
} | |
fn main() { | |
use std::io; | |
use std::io::Read; | |
use std::io::Write; | |
let mut gen = Gen{key:0}; | |
for ch in io::stdin().bytes() { | |
let code = ch.unwrap()^gen.next().unwrap(); | |
io::stdout().write(&[code]).unwrap(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment