Skip to main content

Check OpenPGP Key files for known cryptographic vulnerabilities

Project description

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.

:warning: 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.

:warning: 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:

  1. ? or help: Displays the allowed commands of the cli as well as their docstring
  2. settings: Display the current settings and possibly alter them
  3. analyze: Enter an OpenPGP Keyfile and evaluate it for cryptographic vulnerabilities
  4. 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
  5. sources: Prints the sources for implemented vulnerabilities onto the command line.

Implemented Checks

  1. Deprecated Key Version: Checks if the version of a given Keyfile is deprecated according to the specified RFC
  2. 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
  3. Deprecated algorithm; Checks, wether a given Keyfile uses an deprecated algorithm
  4. RSA specific checks:
    1. Fermat Factoring Algorithm: Checks an RSA key for vulnerability to Fermat's Factoring Algorithm
    2. Low private exponent: Checks an RSA secret key for low private exponent
    3. Low public exponent: Checks an RSA key for low public exponent
    4. ROCA: Checks an RSA key for the ROCA vulnerability
  5. Elgamal specific checks: No further checks implemented yet
  6. DSA specific checks: No further checks implemented yet
  7. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openpgpkeyanalyzer-0.1.11.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

OpenPGPKeyAnalyzer-0.1.11-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file openpgpkeyanalyzer-0.1.11.tar.gz.

File metadata

  • Download URL: openpgpkeyanalyzer-0.1.11.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for openpgpkeyanalyzer-0.1.11.tar.gz
Algorithm Hash digest
SHA256 3f28332262b5d27347f0fd2226b0adaa4c23488eb3f38da11cf9c63747cdaba7
MD5 bbf7820a818257a593b06f387ccdb247
BLAKE2b-256 57fda0c62ad085a1f6b5fe13000c708925e2ac9d68dcc0c5dad5ac87c8a5d6d2

See more details on using hashes here.

File details

Details for the file OpenPGPKeyAnalyzer-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for OpenPGPKeyAnalyzer-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 8bcceba9d6d9ca526f6ebe11b7079fa8d3c34b2044c33ed42dca9917a0b90c49
MD5 27315ecc9f54d2a354f8b0b716b96fcf
BLAKE2b-256 0071c7414f0465a6b7b3f816fb62ea75d6002e4063cf196e0bb09ee5043a477e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page