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.14.tar.gz (14.4 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.14-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openpgpkeyanalyzer-0.1.14.tar.gz
  • Upload date:
  • Size: 14.4 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.14.tar.gz
Algorithm Hash digest
SHA256 be3842a59cbe11e8608c3b90bc4776a372b60a36396dad536fba6b7c45eb230a
MD5 23a76aa22717810984b22836eda577c9
BLAKE2b-256 2e24f8cf81abff0475cdafe76f0997b4645792bad8930c60f09827685b884584

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for OpenPGPKeyAnalyzer-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 7a7188c600f910c28615838391438526538a93c30277bf68d67f23384f8f33c2
MD5 ea6751471e784ca9c07c0cedfc555c11
BLAKE2b-256 5747d198f989707914f4f4f0030a03a36b12f889f668873cc21f9bd6ad0cfa19

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