6 Commits
4 changed files with 255 additions and 540 deletions

No files matched your search

Generated
+244 -529
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "fingerprunk" name = "fingerprunk"
version = "0.3.0" version = "0.4.1"
authors = ["Niklas Elsbrock <mail@nelsbrock.de>"] authors = ["Niklas Elsbrock <mail@nelsbrock.de>"]
edition = "2024" edition = "2024"
description = "CLI tool for brute-forcing OpenPGP keys with cool fingerprints" description = "CLI tool for brute-forcing OpenPGP keys with cool fingerprints"
@@ -13,7 +13,7 @@ categories = ["command-line-utilities"]
anyhow = "1.0.102" anyhow = "1.0.102"
clap = { version = "4.6.1", features = ["derive"] } clap = { version = "4.6.1", features = ["derive"] }
ctrlc = "3.5.2" ctrlc = "3.5.2"
fancy-regex = "0.18.0" fancy-regex = "0.19.2"
num-integer = "0.1.46" num-integer = "0.1.46"
rpassword = "7.5.2" rpassword = "7.5.2"
sequoia-openpgp = "2.2.0" sequoia-openpgp = "2.3.0"
+2 -2
View File
@@ -38,7 +38,7 @@ enum Message {
pub struct Config { pub struct Config {
pub regex: Regex, pub regex: Regex,
pub status_enabled: bool, pub status_enabled: bool,
pub stop_after: Option<NonZero<u64>>, pub count: Option<NonZero<u64>>,
pub password: Option<Password>, pub password: Option<Password>,
pub userids: Vec<UserID>, pub userids: Vec<UserID>,
pub workers: NonZero<usize>, pub workers: NonZero<usize>,
@@ -111,7 +111,7 @@ impl Fingerprunk {
// Increase "found" counter and stop if enough matches have been found // Increase "found" counter and stop if enough matches have been found
let prev = self.counter_found.fetch_add(1, Ordering::Relaxed); let prev = self.counter_found.fetch_add(1, Ordering::Relaxed);
if self.config.stop_after.is_some_and(|s| prev + 1 == s.get()) { if self.config.count.is_some_and(|s| prev + 1 == s.get()) {
break; break;
} }
} }
+6 -6
View File
@@ -14,8 +14,8 @@ use sequoia_openpgp::packet::UserID;
struct Args { struct Args {
/// Filter key fingerprints by using a regular expression. /// Filter key fingerprints by using a regular expression.
/// ///
/// This regex is matched against the hexadecimal representation of the fingerprint, without /// This regex is matched against the upper-case hexadecimal representation of the fingerprint,
/// spaces or other additional symbols. /// without spaces or other additional symbols.
/// ///
/// This is implemented using the fancy-regex library: <https://crates.io/crates/fancy-regex>. /// This is implemented using the fancy-regex library: <https://crates.io/crates/fancy-regex>.
/// You can test and debug your regex here: <https://fancy-regex.github.io/fancy-regex/>. /// You can test and debug your regex here: <https://fancy-regex.github.io/fancy-regex/>.
@@ -27,12 +27,12 @@ struct Args {
/// By default, status information is only shown if stderr is bound to a terminal and stdout is /// By default, status information is only shown if stderr is bound to a terminal and stdout is
/// *not* bound to a terminal. The latter in particular prevents found keys (which are printed /// *not* bound to a terminal. The latter in particular prevents found keys (which are printed
/// to stdin) from being "overwritten" by status information printed to stderr. /// to stdin) from being "overwritten" by status information printed to stderr.
#[arg(long, value_enum, default_value_t)] #[arg(long, value_enum, value_name = "WHEN", default_value_t)]
status: StatusEnabled, status: StatusEnabled,
/// Stop once the specified number of matching keys has been found. /// Stop once the specified number of matching keys has been found.
#[arg(long, value_name = "NUM")] #[arg(short = 'n', long, value_name = "NUM")]
stop_after: Option<NonZero<u64>>, count: Option<NonZero<u64>>,
/// Prompt for a password and use it to encrypt matching keys. /// Prompt for a password and use it to encrypt matching keys.
/// ///
@@ -120,7 +120,7 @@ fn main() -> anyhow::Result<()> {
let config = fingerprunk::Config { let config = fingerprunk::Config {
regex: args.regex, regex: args.regex,
status_enabled: args.status.evaluate(), status_enabled: args.status.evaluate(),
stop_after: args.stop_after, count: args.count,
password, password,
userids: args.userid, userids: args.userid,
workers, workers,