GPGenie is a high-performance PGP key generation and management tool, focusing on generating PGP key pairs with special fingerprint characteristics.
- π High-performance concurrent key generation
- π Intelligent scoring system
- π Detailed statistical analysis
- π Secure key export
- π Comprehensive logging
- π― Configurable filtering criteria
- Multi-worker concurrent key generation
- Configurable generation parameters
- Batch processing and storage
- Automatic scoring and filtering
Scores are based on the following fingerprint characteristics:
- Repeated character sequences
- Increasing sequences
- Decreasing sequences
- Special magic sequences
- Unique character count
- Score statistics analysis
- Unique character statistics
- Score component analysis
- Correlation analysis
- Export keys by fingerprint
- View highest scoring keys
- View keys with least unique characters
- ASCII Armor format support
go install github.com/iyuangang/gpgenie@latestCreate a config/config.json configuration file:
{
"environment": "development",
"database": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"user": "postgres",
"password": "your-password",
"dbname": "gpgenie",
"max_open_conns": 20,
"max_idle_conns": 5,
"conn_max_lifetime": 300,
"log_level": "warn"
},
"key_generation": {
"num_generator_workers": 4,
"num_scorer_workers": 2,
"total_keys": 1000,
"min_score": 100,
"max_letters_count": 8,
"batch_size": 50,
"name": "GPGenie Key",
"comment": "Generated by GPGenie",
"email": "[email protected]",
"encryptor_public_key": "path/to/public.key"
},
"logging": {
"log_level": "info",
"log_file": "logs/gpgenie.log"
}
}gpgenie generate -t 1000 -b 50gpgenie show-top -n 10gpgenie show-low-letter-count -n 10gpgenie export -f ABCDEF1234567890 -o ./exported_keys -agpgenie analyzegpgenie/
βββ cmd/ # Command line tools
βββ internal/
β βββ app/ # Application core
β βββ config/ # Configuration management
β βββ database/ # Database connection
β βββ key/ # Key-related
β β βββ domain/ # Domain logic
β β βββ service/ # Service layer
β βββ logger/ # Logging management
β βββ repository/ # Data access
βββ models/ # Data models
βββ config/ # Configuration files
- Go 1.21+
- GORM (Database ORM)
- Cobra (CLI framework)
- Viper (Configuration management)
- Zap Logger (Logging)
- go-crypto (Cryptography)
- Clone the repository
git clone https://github.com/iyuangang/gpgenie.git- Install dependencies
go mod download- Run tests
# all tests
go test ./... -v
# single package tests
go test ./internal/key/domain -v
# integration tests
go test ./tests/integration -v
# generate test coverage report
go test ./... -coverprofile=coverage
go tool cover -html=coverage- Build
go build -o gpgenie cmd/gpgenie/main.go- Uses worker pools for efficient key generation
- Configurable number of generator and scorer workers
- Batch processing for optimal database performance
The scoring system evaluates key fingerprints based on:
- Repeated sequences (e.g., "AAAA")
- Increasing sequences (e.g., "1234")
- Decreasing sequences (e.g., "DCBA")
- Magic sequences (special patterns)
- Unique character distribution
- PostgreSQL support with GORM
- SQLite support for development
- Connection pooling and optimization
- Transaction support for batch operations
- PGP encryption for private keys
- ASCII Armor support
- Secure file permissions for exported keys
- Configurable encryption settings
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- ProtonMail's go-crypto library
- The Go community
- All contributors to this project