OpenPGP-Key-Analyzer
An Open Source Python CLI, which can parse keyfiles conforming to the OpenPGP standard and analyze them for vulnerability to known cryptographic weaknesses
Supported Formats
The Analyzer supports OpenPGP Key Files in ASCII-armored or Binary Format.
Both RFC 4880 and RFC 9580 are supported.
⚠️ If no warning is created for a given key this does not automatically make the key secure against any attack. It only indicates, that no weakness to the already implemented vulnerabilities could be detected!
Installation
The OpenPGP Key Analyzer can be installed via pip (it is encouraged to use a virtual environment):
pip install OpenPGPKeyAnalyzer
Alternatively you can execute the OpenPGPKeyAnalyzerApp.py file in the OpenPGPKeyAnalyzer Directory directly from this repository.
Usage
If installed via pip: Enter the command openpgp-analyze in a shell wherever you installed the application to.
⚠️ The first time you use this command a settings.json file will be created in an specified directory, if no settings.json yet exists there. This file will be read and written to by the application and can alter the workflow of evaluations. It therefore poses a potential security risk!
After starting the application, a Python CLI will start. At the moment, the following commands are supportet:
- ? or help: Displays the allowed commands of the cli as well as their docstring
- settings: Display the current settings and possibly alter them
- analyze: Enter an OpenPGP Keyfile and evaluate it for cryptographic vulnerabilities
- analyzedir: Enter the path to a directory and evaluate all OpenPGP Keyfiles in it. Only Keyfiles on the top level of the directory will be evaluated. No recursive check in subdirectories is currently implemented
- sources: Prints the sources for implemented vulnerabilities onto the command line.
Implemented Checks
- Deprecated Key Version: Checks if the version of a given Keyfile is deprecated according to the specified RFC
- Key lengths: Checks wether a given Keyfile has an key length that is considered insecure according to the NIST and BSI specifications. Additionally, users can specify an effective key length against which Keyfiles should be checked
- Deprecated algorithm; Checks, wether a given Keyfile uses an deprecated algorithm
- RSA specific checks:
- Fermat Factoring Algorithm: Checks an RSA key for vulnerability to Fermat's Factoring Algorithm
- Low private exponent: Checks an RSA secret key for low private exponent
- Low public exponent: Checks an RSA key for low public exponent
- ROCA: Checks an RSA key for the ROCA vulnerability
- Elgamal specific checks: No further checks implemented yet
- DSA specific checks: No further checks implemented yet
- ECC specific checks: No further checks implemented yet
Settings
| Setting | Allowed Values | Default Value | Purpose |
|---|---|---|---|
| RFCVersion | RFC4880, RFC9580 | RFC4880 | Specifies the RFC version a key should be checked against. |
| UserSpecifiedKeyLength | Integer values greater than 0 | -1 | Specifies the minimum effective key length a key must possess. |
| FermatFactoringCheckIncluded | Boolean values | True | Specifies whether the RSA key should be checked for vulnerabilities against Fermat's factoring algorithm. |
| FermatFactoringEffectiveLengthToCheck | Integer values greater than 0 | 120 | Specifies the minimum bit-length difference between p and q in RSA keys for Fermat checks with secret keys. |
| LowPrivateExponentCheckIncluded | Boolean values | True | Specifies if a given RSA secret key should be checked for a low private exponent. |
| LowPrivateExponentBound | Estimated Bound, Boneh and Durfee Bound | Estimated Bound | Specifies the bound to check the private exponent d of an RSA secret key against. |
| LowPublicExponentCheckIncluded | Boolean values | True | Specifies if a given RSA key should be checked for a low public exponent. |
| LowPublicExponentBound | Integer values greater than 3 | 65537 | Specifies the lower bound an RSA public exponent should have. |
| ROCACheckIncluded | Boolean values | True | Specifies if a given RSA key should be checked for the ROCA vulnerability. |
Metadata
Release files for OpenPGPKeyAnalyzer 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openpgpkeyanalyzer-0.1.14.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| OpenPGPKeyAnalyzer-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / openpgpkeyanalyzer-0.1.14.tar.gz
| Download URL | openpgpkeyanalyzer-0.1.14.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be3842a59cbe11e8608c3b90bc4776a372b60a36396dad536fba6b7c45eb230a
|
|
BLAKE2b-256 checksum How to use checksums |
2e24f8cf81abff0475cdafe76f0997b4645792bad8930c60f09827685b884584
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Release files / OpenPGPKeyAnalyzer-0.1.14-py3-none-any.whl
| Download URL | OpenPGPKeyAnalyzer-0.1.14-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a7188c600f910c28615838391438526538a93c30277bf68d67f23384f8f33c2
|
|
BLAKE2b-256 checksum How to use checksums |
5747d198f989707914f4f4f0030a03a36b12f889f668873cc21f9bd6ad0cfa19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|