
Paranoid의 라이브러리에는 암호화 아티팩트에 대한 알려진 취약점 검사 구현이 포함되어 있습니다.
Paranoid 프로젝트는 공개 키, 디지털 서명, 일반적인 의사 난수와 같은 암호화 아티팩트에서 잘 알려진 취약점을 검사합니다. 이 라이브러리는 문헌에서 찾을 수 있는 기존 연구의 구현과 최적화를 포함합니다. 기존 연구는 이러한 아티팩트의 생성이 일부 경우에 결함이 있음을 보여주었습니다. 다음은 이 라이브러리가 기반으로 하는 출판물의 몇 가지 예입니다.
목표는 Google 내부와 외부의 암호화 사용 사례에 대한 신뢰를 높이는 것입니다.
비대칭 암호화를 다룰 때, 암호화 아티팩트는 보통 다음과 같습니다:
Paranoid를 사용하면 모든 암호화 아티팩트를 테스트할 수 있지만, 주된 동기는 취약한 타사 하드웨어 또는 소프트웨어 블랙박스의 사용을 탐지하는 것입니다. 따라서 Paranoid는 소스 코드를 검사할 수 없는 경우(위에 나열된 상황 3)에도 사용할 수 있습니다.
이 프로젝트는 알려진 취약점뿐만 아니라 알려지지 않은 취약점도 탐지하는 것을 목표로 합니다. 예를 들어, 프로그래밍 오류나 취약한 독점 난수 생성기의 사용으로 인한 취약점을 식별하려고 시도합니다. 새로운 취약점을 탐지하는 것은 물론 알려진 취약점을 탐지하는 것보다 훨씬 어렵습니다. 이러한 탐지에는 대규모 아티팩트 집합이 필요하거나 낮은 확률로만 취약한 것을 찾을 수 있습니다.
따라서 우리는 취약한 암호화 아티팩트를 생성한 암호화 라이브러리에 대한 피드백과 정보를 받는 것에 매우 관심이 있습니다 (기여 요청 참조). 이 프로젝트는 지속적으로 진행 중입니다. 취약한 구현에 대해 알게 된 후에는 이를 분석하고 대상으로 하는 탐지를 추가할 계획입니다.
현재 구현된 검사에 대한 문서는 docs에 있습니다. 문서는 시간이 지남에 따라 더 많은 내용으로 채워질 것입니다.
검사 사용 방법을 배우려면 examples 폴더나 단위 테스트(*test.py 파일)를 살펴볼 수 있습니다. 예제는 다양한 암호화 아티팩트를 테스트하는 방법을 보여줍니다.
저장소를 복제합니다:
$ 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 libgmp-dev 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 .
설치가 성공했는지 확인하려면 단위 테스트를 실행할 수 있습니다. 예를 들어:
$ cd paranoid_crypto && python3 -m unittest discover -b -p "*test.py"
.................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 305 tests in 314.660s
OK
또는 컨테이너에서 실행하려면 아래와 같이 제공된 Dockerfile을 사용할 수 있습니다.
참고: docker가 설치되어 있는지 확인하세요.
저장소를 복제한 후 docker 이미지를 빌드합니다:
$ 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
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 | SEVERITY_CRITICAL | 3989 |
| CheckROCA | CVE-2017-15361 | SEVERITY_HIGH | 2875 |
| CheckGCD | - | SEVERITY_CRITICAL | 1860 |
| CheckFermat | CVE-2022-26320 | SEVERITY_CRITICAL | 36 |
| CheckContinuedFractions | - | SEVERITY_CRITICAL | 16 |
| CheckBitPatterns | - | SEVERITY_CRITICAL | 6 |
| CheckPermutedBitPatterns | - | SEVERITY_CRITICAL | 6 |
| CheckKeypairDenylist | CVE-2021-41117 | SEVERITY_CRITICAL | 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.
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}
}