API reference and usage examples are available at docs.rs.
cargo install pkcs12cracker
# Brew tap (macOS)
brew tap wowinter13/pkcs12cracker
brew install pkcs12cracker
# Or build from source
git clone https://github.com/wowinter13/pkcs12cracker
cd pkcs12cracker
cargo build --release
- Memory-mapped file handling for efficient dictionary processing
- Parallel processing with configurable thread count
- Cache-friendly chunk-based password cracking
- Optimized string handling and memory allocation
- Multiple attack strategies support
- Benchmarks (memory, CPU, time, and operations per second).
- Implement tests for all modules.
- OS related performance optimizations.
- Explore advanced multithreading techniques (try scoped threads or another raw threading approach).
Fast, multi-threaded PKCS#12 password cracker
Usage: pkcs12cracker [OPTIONS] <FILE>...
Arguments:
<FILE>... Path to the PKCS#12 (.p12/.pfx) file to crack
Options:
-d, --dictionary <FILE> Use dictionary-based attack with the specified wordlist file
-p, --pattern <PATTERN> Use pattern-based attack (e.g., 'Pass@@rd' where '@' marks variable positions)
-s, --pattern-symbol <CHAR> Symbol to mark variable positions in pattern [default: @] [default: @]
-m, --min-length <NUM> Minimum password length for brute force attack [default: 1] [default: 1]
--max-length <NUM> Maximum password length for brute force attack [default: 6] [default: 6]
-b, --brute-force Enable brute force attack mode
-c, --charset <SETS> Character sets to use in brute force attack
--custom-chars <CHARS> Custom character set for brute force attack
--delimiter <CHAR> Dictionary file entry delimiter [default: newline] [default: "\n"]
-t, --threads <NUM> Number of cracking threads [default: number of CPU cores] [default: 1]
-h, --help Print help (see more with '--help')
-V, --version Print version
Uses a wordlist file to crack passwords:
# Basic usage with newline-separated dictionary
pkcs12cracker -d wordlist.txt cert.p12
Cracks passwords matching a specific pattern:
# Custom symbol for variable positions
pkcs12cracker -p "Pass##rd" -s "#" cert.p12
# Custom character sets
pkcs12cracker -b -c aAn cert.p12 # alphanumeric
The -c
flag supports combining multiple character sets:
a
- lowercase letters (a-z)A
- uppercase letters (A-Z)n
- digits (0-9)s
- special characters (!@#$%^&*...)x
- all of the above
Examples:
# Uppercase + numbers
pkcs12cracker -b -c An cert.p12
# All characters except special
pkcs12cracker -b -c aAn cert.p12
# Everything
pkcs12cracker -b -c x cert.p12
For specific requirements, use --custom-chars
:
# Combine with standard sets
pkcs12cracker -b -c an --custom-chars="!@#" cert.p12
This project is licensed under the MIT License - see the LICENSE file for details.