Begining of the machine oracle (work in progress..)
[crypto_lab1.git] / src / oracle_machine.rs
1 use std::io;
2 use std::io::{ TcpStream };
3 use end_point::EndPoint;
4
5 /// Try to decypher a cyphered data block by using an oracle on the provided address and port.
6 /// May prints some message on the stdout.
7 pub fn decypher(address: &str, port: u16, cypherblock: [u8, ..16]) -> Option<Vec<u8>> {
8 let end_point = EndPoint::new(
9 match TcpStream::connect(address, port) {
10 Ok(s) => s,
11 _ => {
12 println!("Unable to connect to the oracle on {}:{}", address, port);
13 return None
14 }
15 }
16 );
17
18 None
19 }