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@latest
Create 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": "key@gpgenie.local",
"encryptor_public_key": "path/to/public.key"
},
"logging": {
"log_level": "info",
"log_file": "logs/gpgenie.log"
}
}
gpgenie generate -t 1000 -b 50
gpgenie show-top -n 10
gpgenie show-low-letter-count -n 10
gpgenie export -f ABCDEF1234567890 -o ./exported_keys -a
gpgenie analyze
gpgenie/
├── 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