paranoid_crypto
Paranoid's library contains implementations of checks for well known weaknesses on cryptographic artifacts.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.5%) to scientific vocabulary
Keywords
Repository
Paranoid's library contains implementations of checks for well known weaknesses on cryptographic artifacts.
Basic Info
Statistics
- Stars: 795
- Watchers: 24
- Forks: 47
- Open Issues: 6
- Releases: 0
Topics
Metadata Files
README.md
Project Paranoid
Overview
Paranoid project checks for well known weaknesses on cryptographic artifacts such as public keys, digital signatures and general pseudorandom numbers. This library contains implementations and optimizations of existing work found in the literature. The existing work showed that the generation of these artifacts was flawed in some cases. The following are some examples of publications the library is based on.
Goal
The goal is to increase the confidence in cryptography use cases inside and outside Google.
When dealing with asymmetric encryption, crypto artifacts usually are:
- Generated by one of our own tools (e.g., at Google we use for example boringssl or tink); or,
- Generated by third party tools that we have access to (so these tools can be, for example, checked for vulnerabilities using wycheproof); or,
- Generated by third party tools and/or hardware or software black boxes that we do not have access to.
With Paranoid, any cryptographic artifact can be tested, but its primary motivation is to detect the usage of weak third party hardware or software black boxes. Hence, Paranoid can be used even if we are not able to inspect the source code (situation 3. listed above).
The project aims to detect known vulnerabilities as well as unknown ones. E.g., it tries to identify vulnerabilities caused by programming errors or the use of weak proprietary random number generators. Detecting new vulnerabilities is of course much more difficult than detecting known ones. Such detections may require large sets of artifacts or find weak ones only with a low probability.
Therefore, we are very interested to receive feedback and learn about the cryptographic library that generated weak cryptographic artifacts (See call for contributions ). The project is constantly work in progress. After learning about weak implementations the plan is to analyze and add detections targeting them.
Getting Started
Documentation for the current implemented checks is located at docs. The documentation will be populated with more content over time.
To learn how to use the checks, you can look at the examples folder or the unit tests (*test.py files). The examples demonstrate testing different crypto artifacts.
Installation
Clone the repository:
$ git clone https://github.com/google/paranoid_crypto.git && cd paranoid_crypto
NOTE: The commands below have been tested on Debian stable version
(bookworm). Make sure you will be using python3.11 or newer.
Install dependencies:
$ sudo apt update && sudo apt install python3 python3-full python3-pip python3-pybind11 python3-fpylll python3-gmpy2 protobuf-compiler
Create and activate a virtual environment:
$ python3 -m venv --system-site-packages ~/paranoid-venv
$ source ~/paranoid-venv/bin/activate
NOTE: If you know what you are doing, you can instead skip to the next step
and use --break-system-packages switch for pip.
Install paranoid_crypto python package:
$ python3 -m pip install .
To check whether the installation was successful, you can run the unit tests. For example:
``` $ cd paranoid_crypto && python3 -m unittest discover -b -p "*test.py"
.................................................................................................................................................................................................................................................................................................................
Ran 305 tests in 314.660s
OK ```
Docker
Alternatively, if you want to run it in a container, you can use our provided Dockerfile as shown below.
NOTE: Make sure you have docker installed.
After cloning the repository, build the docker image:
$ docker build -t paranoid-img .
Create and start the container:
$ docker run --name paranoid-container -it paranoid-img
paranoid-user@6191368b26b8:~$
To check whether the installation was successful, you can run the unit tests. For example:
``` paranoid-user@6191368b26b8:~$ cd paranoid_crypto && python3 -m unittest discover -b -p "*test.py"
.................................................................................................................................................................................................................................................................................................................
Ran 305 tests in 307.555s
OK ```
Preliminary results
Similar to other published works, we have been analyzing the crypto artifacts from Certificate Transparency (CT), which logs issued website certificates since 2013 with the goal of making them transparent and verifiable. Its database contains more than 7 billion certificates as of September 2022. For the Paranoid checks of EC public keys and ECDSA signatures, so far, we have not found any weak artifacts in CT. For the RSA public key checks with severities high or critical, we have the following results:
| TestName | Potentially Related CVEs | Severity | Number of Weak Artifacts | |:------------------------:|:----------------------------:|:-----------------:|:----------------------------:| | CheckOpensslDenylist | CVE-2008-0166 | SEVERITYCRITICAL | 3989 | | CheckROCA | CVE-2017-15361 | SEVERITYHIGH | 2875 | | CheckGCD | - | SEVERITYCRITICAL | 1860 | | CheckFermat | CVE-2022-26320 | SEVERITYCRITICAL | 36 | | CheckContinuedFractions | - | SEVERITYCRITICAL | 16 | | CheckBitPatterns | - | SEVERITYCRITICAL | 6 | | CheckPermutedBitPatterns | - | SEVERITYCRITICAL | 6 | | CheckKeypairDenylist | CVE-2021-41117 | SEVERITYCRITICAL | 4 | | CheckPollardpm1 | - | SEVERITY_CRITICAL | 1 |
Some of these certificates were already expired or revoked. For the ones that were still active (most of the CheckGCD ones), we immediately reported them to the Certificate Authorities to be revoked.
ABOUT
This library is developed and maintained by members of Google Security Team, but this is not an officially supported Google product. If you want to contribute, please read CONTRIBUTING and send us pull requests. You can also report bugs or file feature requests.
If you use Paranoid in your research, you can cite it using the following
BibTeX:
@software{Barbosa_Bleichenbacher_Paranoid_Crypto_2022,
author = {Barbosa, Pedro and Bleichenbacher, Daniel},
license = {Apache-2.0},
month = {8},
title = {{Paranoid Crypto}},
url = {https://github.com/google/paranoid_crypto},
year = {2022}
}
Owner
- Name: Google
- Login: google
- Kind: organization
- Email: opensource@google.com
- Location: United States of America
- Website: https://opensource.google/
- Twitter: GoogleOSS
- Repositories: 2,773
- Profile: https://github.com/google
Google ❤️ Open Source
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
abstract: "Paranoid Crypto is a library for checking crypto artifacts generated by black boxes at large scale"
authors:
- family-names: "Barbosa"
given-names: "Pedro"
- family-names: "Bleichenbacher"
given-names: "Daniel"
title: "Paranoid Crypto"
date-released: 2022-08-03
keywords:
- paranoid
- cryptography
license: Apache-2.0
type: software
url: "https://github.com/google/paranoid_crypto"
contact:
- email: paranoid@google.com
name: "Paranoid Team"
GitHub Events
Total
- Watch event: 12
- Pull request event: 2
- Fork event: 2
- Create event: 1
Last Year
- Watch event: 12
- Pull request event: 2
- Fork event: 2
- Create event: 1
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Pedro Barbosa | p****b@g****m | 23 |
| Daniel Bleichenbacher | b****n@g****m | 5 |
| Alexander Tereschenko | a****o@i****m | 3 |
| Paranoid Team | p****d@g****m | 3 |
| random | 5****h | 1 |
| bri3d | b****n@b****m | 1 |
| Harold | h****d@m****r | 1 |
| jonathan.grove | g****d@g****m | 1 |
| Fotis Loukos | f****l@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 10
- Total pull requests: 12
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Total issue authors: 7
- Total pull request authors: 8
- Average comments per issue: 2.0
- Average comments per pull request: 0.33
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 3
- Average time to close issues: 4 months
- Average time to close pull requests: 20 days
- Issue authors: 2
- Pull request authors: 3
- Average comments per issue: 3.0
- Average comments per pull request: 1.33
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- alext-w (3)
- rjfrjf (2)
- lhemerly (1)
- nightwatchcyber (1)
- legrego (1)
- Katt7767 (1)
- fabaff (1)
Pull Request Authors
- pedroysb (4)
- haroldm (2)
- jonathangrove3 (2)
- louis-simoneau (2)
- alext-w (2)
- dependabot[bot] (1)
- bri3d (1)
- fotisl (1)
- rand-tech (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- absl-py *
- cryptography *
- gmpy *
- protobuf ==3.20.
- scipy *
- sympy *
- debian latest build