Add user input for RSA key pair size in bits
This commit is contained in:
parent
9067538985
commit
3be97adffc
1 changed files with 12 additions and 1 deletions
13
src/main.rs
13
src/main.rs
|
@ -107,7 +107,18 @@ fn main() {
|
|||
Err(error) => println!("error: {error}"),
|
||||
}
|
||||
|
||||
let rsa = RSA::new(1024);
|
||||
let mut rsa_size: String = "".to_string();
|
||||
|
||||
info!("Enter the size of the RSA key pair (in bits):");
|
||||
match io::stdin().read_line(&mut rsa_size) {
|
||||
Ok(n) => match n {
|
||||
0 => info!("No input provided"),
|
||||
_ => info!("{} bytes read", n),
|
||||
},
|
||||
Err(error) => println!("error: {error}"),
|
||||
}
|
||||
|
||||
let rsa = RSA::new(rsa_size.trim().parse().unwrap());
|
||||
|
||||
info!("Original: {}", message.trim());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue