
Python용 자체 포함 암호화 라이브러리
.. image:: https://github.com/Legrandin/pycryptodome/workflows/Integration%20test/badge.svg :target: https://github.com/Legrandin/pycryptodome/actions
.. image:: https://badge.fury.io/py/pycryptodome.svg :target: https://pypi.org/project/pycryptodome
PyCryptodome는 저수준 암호화 프리미티브를 제공하는 자체 완결형 Python 패키지입니다. pip install 한 번이면 되고, 시스템 라이브러리가 필요 없으며, AES와 RSA부터 HPKE, KangarooTwelve, 양자 내성 ML-DSA에 이르기까지 폭넓고 일관된 API를 제공합니다.
Python 3.9 이상과 PyPy를 지원합니다.
다음과 같이 설치합니다::
pip install pycryptodome
모든 모듈은 Crypto 패키지 아래에 설치됩니다.
.. code-block:: python
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
key = get_random_bytes(32)
cipher = AES.new(key, AES.MODE_GCM) # a random nonce is generated
ciphertext, tag = cipher.encrypt_and_digest(b"attack at dawn")
receiver = AES.new(key, AES.MODE_GCM, nonce=cipher.nonce)
plaintext = receiver.decrypt_and_verify(ciphertext, tag) # raises ValueError if tampered
.. note::
버전 3.x까지는 이 라이브러리가 pycryptodomex 프로젝트로도 배포되었으며,
Cryptodome 패키지 아래에 설치되었습니다.
버전 4.0부터 pycryptodomex는 더 이상 배포되지 않으며,
Crypto가 유일한 패키지 이름입니다.
마이그레이션하려면 import에서 Cryptodome을 Crypto로 바꾸면 됩니다.
알고리즘과 형식의 전체 목록은 features page_를 참조하십시오.
그 외의 모든 내용은 homepage_를 참조하십시오.
보안 문제는 [email protected]로 이메일을 보내 주십시오.
모든 코드는 GitHub_에서 다운로드할 수 있습니다.
.. _homepage: https://www.pycryptodome.org
.. _features page: https://www.pycryptodome.org/src/features
.. _GitHub: https://github.com/Legrandin/pycryptodome