Skip to content

Commit

Permalink
Update for new Digits
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpclark committed Oct 10, 2017
1 parent 81407e8 commit d5ff1ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "abrute"
version = "0.0.5"
version = "0.0.6"
authors = ["Daniel P. Clark <[email protected]>"]
description = "AESCrypt Brute force attempter."
documentation = "http:https://danielpclark.github.io/abrute/index.html"
Expand All @@ -13,6 +13,6 @@ categories = ["cryptography"]

[dependencies]
clap = "^2.26"
digits = "^0.3.5"
digits = "^0.3.6"
num_cpus = "^1.0"
rayon = "0.8.2"
11 changes: 6 additions & 5 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ fn chunk_sequence(d: &mut Digits, qty: usize, adj: Option<&str>) -> Vec<String>
let mut result = vec![];
loop {
if counter >= qty { break; }

if let Some(a) = adj {
if d.base() > 3 {
result.push(d.next_non_adjacent(a.parse::<u8>().unwrap() as usize).to_s());
} else {
result.push(d.succ().to_s());
result.push(d.step_non_adjacent(a.parse::<u8>().unwrap() as usize).to_s());
counter += 1;
continue;
}
} else {
result.push(d.succ().to_s());
}

result.push(d.succ().to_s());
counter += 1;
}
result
Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ USE OF THIS BINARY FALLS UNDER THE MIT LICENSE (c) 2017").
let target = matches.value_of("TARGET").unwrap();
let adjacent = matches.value_of("adjacent");

let seq_base = sequencer.base();
if let &Some(num) = &adjacent {
if seq_base > 3 {
validate_is_digit(num.to_string()).ok();
sequencer.prep_non_adjacent(num.parse::<usize>().unwrap());
}
}

if !Path::new(&target).exists() {
writeln!(io::stderr(), "Error: File {:?} does not exist.", target).err();
return Err("Please verify last argument is the proper filename.".to_string())
Expand Down

0 comments on commit d5ff1ca

Please sign in to comment.