pycryptodome API reference
171 public APIs from pycryptodome (Legrandin/pycryptodome) — 67 classes, 45 functions, 59 methods. Signatures extracted by static analysis of the actual source.
Repository: Legrandin/pycryptodome
| Kind | Count |
|---|---|
| Classes | 67 |
| Functions | 45 |
| Methods | 59 |
API list
func
Doc.sphinx_rtd_theme.get_html_theme_path()Return list of HTML theme paths.
func
lib.Crypto.Cipher.AES.new(key, mode, *args, **kwargs)Create a new AES cipher.
func
lib.Crypto.Cipher.ARC2.new(key, mode, *args, **kwargs)Create a new RC2 cipher.
class
lib.Crypto.Cipher.ARC4.ARC4CipherARC4 cipher object.
method
lib.Crypto.Cipher.ARC4.ARC4Cipher.decrypt(ciphertext)Decrypt a piece of data.
method
lib.Crypto.Cipher.ARC4.ARC4Cipher.encrypt(plaintext)Encrypt a piece of data.
func
lib.Crypto.Cipher.ARC4.new(key, *args, **kwargs)Create a new ARC4 cipher.
class
lib.Crypto.Cipher.ChaCha20.ChaCha20CipherChaCha20 (or XChaCha20) cipher object.
method
lib.Crypto.Cipher.ChaCha20.ChaCha20Cipher.decrypt(ciphertext, output=None)Decrypt a piece of data.
method
lib.Crypto.Cipher.ChaCha20.ChaCha20Cipher.encrypt(plaintext, output=None)Encrypt a piece of data.
func
lib.Crypto.Cipher.DES.new(key, mode, *args, **kwargs)Create a new DES cipher.
func
lib.Crypto.Cipher.DES3.adjust_key_parity(key_in)Set the parity bits in a TDES key.
func
lib.Crypto.Cipher.DES3.new(key, mode, *args, **kwargs)Create a new Triple DES cipher.
class
lib.Crypto.Cipher.PKCS1_OAEP.PKCS1OAEP_CipherCipher object for PKCS#1 OAEP.
class
lib.Crypto.Cipher.Salsa20.Salsa20CipherSalsa20 cipher object.
method
lib.Crypto.Cipher.Salsa20.Salsa20Cipher.decrypt(ciphertext, output=None)Decrypt a piece of data.
method
lib.Crypto.Cipher.Salsa20.Salsa20Cipher.encrypt(plaintext, output=None)Encrypt a piece of data.
class
lib.Crypto.Cipher._mode_cbc.CbcMode*Cipher-Block Chaining (CBC)*.
class
lib.Crypto.Cipher._mode_ccm.CcmModeCounter with CBC-MAC (CCM).
method
lib.Crypto.Cipher._mode_ccm.CcmMode.digest()Compute the *binary* MAC tag.
method
lib.Crypto.Cipher._mode_ccm.CcmMode.hexdigest()Compute the *printable* MAC tag.
method
lib.Crypto.Cipher._mode_ccm.CcmMode.verify(received_mac_tag)Validate the *binary* MAC tag.
class
lib.Crypto.Cipher._mode_cfb.CfbMode*Cipher FeedBack (CFB)*.
class
lib.Crypto.Cipher._mode_ctr.CtrMode*CounTeR (CTR)* mode.
class
lib.Crypto.Cipher._mode_eax.EaxMode*EAX* mode.
method
lib.Crypto.Cipher._mode_eax.EaxMode.digest()Compute the *binary* MAC tag.
method
lib.Crypto.Cipher._mode_eax.EaxMode.hexdigest()Compute the *printable* MAC tag.
method
lib.Crypto.Cipher._mode_eax.EaxMode.verify(received_mac_tag)Validate the *binary* MAC tag.
class
lib.Crypto.Cipher._mode_ecb.EcbMode*Electronic Code Book (ECB)*.
class
lib.Crypto.Cipher._mode_gcm.GcmModeGalois Counter Mode (GCM).
method
lib.Crypto.Cipher._mode_gcm.GcmMode.hexdigest()Compute the *printable* MAC tag.
method
lib.Crypto.Cipher._mode_gcm.GcmMode.verify(received_mac_tag)Validate the *binary* MAC tag.
class
lib.Crypto.Cipher._mode_kw.KWModeKey Wrap (KW) mode.
method
lib.Crypto.Cipher._mode_kw.KWMode.seal(plaintext:Union[bytes, bytearray]) -> bytesEncrypt and authenticate (wrap) a cryptographic key.
method
lib.Crypto.Cipher._mode_kw.KWMode.unseal(ciphertext:Union[bytes, bytearray]) -> bytesDecrypt and authenticate (unwrap) a cryptographic key.
class
lib.Crypto.Cipher._mode_kwp.KWPModeKey Wrap with Padding (KWP) mode.
method
lib.Crypto.Cipher._mode_kwp.KWPMode.seal(plaintext:Union[bytes, bytearray]) -> bytesEncrypt and authenticate (wrap) a cryptographic key.
method
lib.Crypto.Cipher._mode_kwp.KWPMode.unseal(ciphertext:Union[bytes, bytearray]) -> bytesDecrypt and authenticate (unwrap) a cryptographic key.
class
lib.Crypto.Cipher._mode_ocb.OcbModeOffset Codebook (OCB) mode.
method
lib.Crypto.Cipher._mode_ocb.OcbMode.digest()Compute the *binary* MAC tag.
method
lib.Crypto.Cipher._mode_ocb.OcbMode.hexdigest()Compute the *printable* MAC tag.
method
lib.Crypto.Cipher._mode_ocb.OcbMode.update(assoc_data)Process the associated data.
method
lib.Crypto.Cipher._mode_ocb.OcbMode.verify(received_mac_tag)Validate the *binary* MAC tag.
class
lib.Crypto.Cipher._mode_ofb.OfbMode*Output FeedBack (OFB)*.
class
lib.Crypto.Cipher._mode_openpgp.OpenPgpModeOpenPGP mode.
class
lib.Crypto.Cipher._mode_siv.SivModeSynthetic Initialization Vector (SIV).
method
lib.Crypto.Cipher._mode_siv.SivMode.digest()Compute the *binary* MAC tag.
method
lib.Crypto.Cipher._mode_siv.SivMode.hexdigest()Compute the *printable* MAC tag.
method
lib.Crypto.Cipher._mode_siv.SivMode.verify(received_mac_tag)Validate the *binary* MAC tag.
class
lib.Crypto.Hash.BLAKE2b.BLAKE2b_HashA BLAKE2b hash object.
method
lib.Crypto.Hash.BLAKE2b.BLAKE2b_Hash.new(**kwargs)Return a new instance of a BLAKE2b hash object.
func
lib.Crypto.Hash.BLAKE2b.new(**kwargs)Create a new hash object.
class
lib.Crypto.Hash.BLAKE2s.BLAKE2s_HashA BLAKE2s hash object.
func
lib.Crypto.Hash.BLAKE2s.new(**kwargs)Create a new hash object.
class
lib.Crypto.Hash.CMAC.CMACA CMAC hash object.
method
lib.Crypto.Hash.CMAC.CMAC.copy()Return a copy ("clone") of the CMAC object.
func
lib.Crypto.Hash.CMAC.new(key, msg=None, ciphermod=None, cipher_params=None, mac_len=None, update_after_digest=False)Create a new MAC object.
class
lib.Crypto.Hash.HMAC.HMACAn HMAC hash object.
func
lib.Crypto.Hash.HMAC.new(key, msg=b'', digestmod=None)Create a new MAC object.
class
lib.Crypto.Hash.KMAC128.KMAC_HashA KMAC hash object.
func
lib.Crypto.Hash.KMAC128.new(**kwargs)Create a new KMAC128 object.
func
lib.Crypto.Hash.KMAC256.new(**kwargs)Create a new KMAC256 object.
class
lib.Crypto.Hash.KangarooTwelve.K12_XOFA KangarooTwelve hash object.
method
lib.Crypto.Hash.KangarooTwelve.K12_XOF.read(length)Produce more bytes of the digest.
method
lib.Crypto.Hash.KangarooTwelve.K12_XOF.update(data)Hash the next piece of data.
class
lib.Crypto.Hash.MD2.MD2HashAn MD2 hash object.
func
lib.Crypto.Hash.MD2.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.MD4.MD4HashClass that implements an MD4 hash
class
lib.Crypto.Hash.MD5.MD5HashA MD5 hash object.
method
lib.Crypto.Hash.MD5.MD5Hash.new(data=None)Create a fresh SHA-1 hash object.
func
lib.Crypto.Hash.MD5.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.Poly1305.Poly1305_MACAn Poly1305 MAC object.
func
lib.Crypto.Hash.Poly1305.new(**kwargs)Create a new Poly1305 MAC object.
class
lib.Crypto.Hash.RIPEMD160.RIPEMD160HashA RIPEMD-160 hash object.
func
lib.Crypto.Hash.RIPEMD160.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.SHA1.SHA1HashA SHA-1 hash object.
method
lib.Crypto.Hash.SHA1.SHA1Hash.new(data=None)Create a fresh SHA-1 hash object.
func
lib.Crypto.Hash.SHA1.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.SHA224.SHA224HashA SHA-224 hash object.
method
lib.Crypto.Hash.SHA224.SHA224Hash.new(data=None)Create a fresh SHA-224 hash object.
func
lib.Crypto.Hash.SHA224.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.SHA256.SHA256HashA SHA-256 hash object.
method
lib.Crypto.Hash.SHA256.SHA256Hash.new(data=None)Create a fresh SHA-256 hash object.
func
lib.Crypto.Hash.SHA256.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.SHA384.SHA384HashA SHA-384 hash object.
method
lib.Crypto.Hash.SHA384.SHA384Hash.new(data=None)Create a fresh SHA-384 hash object.
func
lib.Crypto.Hash.SHA384.new(data=None)Create a new hash object.
class
lib.Crypto.Hash.SHA3_224.SHA3_224_HashA SHA3-224 hash object.
func
lib.Crypto.Hash.SHA3_224.new(*args, **kwargs)Create a new hash object.
class
lib.Crypto.Hash.SHA3_256.SHA3_256_HashA SHA3-256 hash object.
func
lib.Crypto.Hash.SHA3_256.new(*args, **kwargs)Create a new hash object.
class
lib.Crypto.Hash.SHA3_384.SHA3_384_HashA SHA3-384 hash object.
func
lib.Crypto.Hash.SHA3_384.new(*args, **kwargs)Create a new hash object.
class
lib.Crypto.Hash.SHA3_512.SHA3_512_HashA SHA3-512 hash object.
func
lib.Crypto.Hash.SHA3_512.new(*args, **kwargs)Create a new hash object.
func
lib.Crypto.Hash.SHA512.new(data=None, truncate=None)Create a new hash object.
class
lib.Crypto.Hash.SHAKE128.SHAKE128_XOFA SHAKE128 hash object.
class
lib.Crypto.Hash.SHAKE256.SHAKE256_XOFA SHAKE256 hash object.
class
lib.Crypto.Hash.TupleHash128.TupleHashA Tuple hash object.
func
lib.Crypto.Hash.TupleHash128.new(**kwargs)Create a new TupleHash128 object.
func
lib.Crypto.Hash.TupleHash256.new(**kwargs)Create a new TupleHash256 object.
class
lib.Crypto.Hash.TurboSHAKE128.TurboSHAKEA TurboSHAKE hash object.
func
lib.Crypto.Hash.TurboSHAKE128.new(**kwargs)Create a new TurboSHAKE128 object.
func
lib.Crypto.Hash.TurboSHAKE256.new(**kwargs)Create a new TurboSHAKE256 object.
class
lib.Crypto.Hash.cSHAKE128.cSHAKE_XOFA cSHAKE hash object.
class
lib.Crypto.Hash.keccak.Keccak_HashA Keccak hash object.
method
lib.Crypto.Hash.keccak.Keccak_Hash.new(**kwargs)Create a fresh Keccak hash object.
func
lib.Crypto.Hash.keccak.new(**kwargs)Create a new hash object.
func
lib.Crypto.IO.PEM.decode(pem_data, passphrase=None)Decode a PEM block into binary.
class
lib.Crypto.Math._IntegerGMP.IntegerGMPA fast, arbitrary precision integer
method
lib.Crypto.Math._IntegerGMP.IntegerGMP.jacobi_symbol(a, n)Compute the Jacobi symbol
class
lib.Crypto.Math._IntegerNative.IntegerNativeA class to model a natural integer (including zero)
class
lib.Crypto.Protocol.HPKE.MODEHPKE modes
class
lib.Crypto.Protocol.SecretSharing.ShamirShamir's secret sharing scheme.
method
lib.Crypto.Protocol.SecretSharing.Shamir.split(k, n, secret, ssss=False)Split a secret into ``n`` shares.
class
lib.Crypto.PublicKey.DSA.DsaKeyClass defining an actual DSA key.
method
lib.Crypto.PublicKey.DSA.DsaKey.domain()The DSA domain parameters.
method
lib.Crypto.PublicKey.DSA.DsaKey.export_key(format='PEM', pkcs8=None, passphrase=None, protection=None, randfunc=None)Export this DSA key.
method
lib.Crypto.PublicKey.DSA.DsaKey.has_private()Whether this is a DSA private key
method
lib.Crypto.PublicKey.DSA.DsaKey.public_key()A matching DSA public key.
func
lib.Crypto.PublicKey.DSA.generate(bits, randfunc=None, domain=None)Generate a new DSA key pair.
func
lib.Crypto.PublicKey.DSA.import_key(extern_key, passphrase=None)Import a DSA key.
class
lib.Crypto.PublicKey.ECC.EccKeyClass defining an ECC key.
method
lib.Crypto.PublicKey.ECC.EccKey.export_key(**kwargs)Export this ECC key.
method
lib.Crypto.PublicKey.ECC.EccKey.public_key()A matching ECC public key.
class
lib.Crypto.PublicKey.ElGamal.ElGamalKeyClass defining an ElGamal key.
method
lib.Crypto.PublicKey.ElGamal.ElGamalKey.publickey()A matching ElGamal public key.
class
lib.Crypto.PublicKey.RSA.RsaKeyClass defining an RSA key, private or public.
method
lib.Crypto.PublicKey.RSA.RsaKey.blind(M, B):meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.decrypt(ciphertext):meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.encrypt(plaintext, K):meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.exportKey(*args, **kwargs):meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.has_private()Whether this is an RSA private key
method
lib.Crypto.PublicKey.RSA.RsaKey.public_key()A matching RSA public key.
method
lib.Crypto.PublicKey.RSA.RsaKey.publickey():meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.sign(M, K):meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.size():meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.size_in_bits()Size of the RSA modulus in bits
method
lib.Crypto.PublicKey.RSA.RsaKey.unblind(M, B):meta private:
method
lib.Crypto.PublicKey.RSA.RsaKey.verify(M, signature):meta private:
func
lib.Crypto.PublicKey.RSA.generate(bits, randfunc=None, e=65537)Create a new RSA key pair.
class
lib.Crypto.PublicKey._point.EccPointA class to model a point on an Elliptic Curve.
method
lib.Crypto.PublicKey._point.EccPoint.copy()Return a copy of this point.
method
lib.Crypto.PublicKey._point.EccPoint.size_in_bits()Size of each coordinate, in bits.
func
lib.Crypto.SelfTest.run(module=None, verbosity=0, stream=None, tests=None, config=None, **kwargs)Execute self-tests.
func
lib.Crypto.SelfTest.st_common.b2a_hex(s)Convert binary to hexadecimal
class
lib.Crypto.Signature.DSS.DssSigSchemeA (EC)DSA signature object.
class
lib.Crypto.Signature.eddsa.EdDSASigSchemeAn EdDSA signature object.
class
lib.Crypto.Signature.pkcs1_15.PKCS115_SigSchemeA signature object for ``RSASSA-PKCS1-v1_5``.
class
lib.Crypto.Signature.pss.PSS_SigSchemeA signature object for ``RSASSA-PSS``.
func
lib.Crypto.Util.Padding.pad(data_to_pad, block_size, style='pkcs7')Apply standard padding.
func
lib.Crypto.Util.Padding.unpad(padded_data, block_size, style='pkcs7')Remove standard padding.
class
lib.Crypto.Util._raw_api.SmartPointerClass to hold a non-managed piece of memory
class
lib.Crypto.Util._raw_api.VoidPointer_cffiModel a newly allocated pointer to void
class
lib.Crypto.Util._raw_api.VoidPointer_ctypesModel a newly allocated pointer to void
func
lib.Crypto.Util._raw_api.c_size_t(x)Convert a Python integer to size_t
func
lib.Crypto.Util._raw_api.c_ulong(x)Convert a Python integer to unsigned long
func
lib.Crypto.Util._raw_api.get_raw_buffer(buf)Convert a C buffer into a Python byte sequence
class
lib.Crypto.Util.asn1.DerBitStringClass to model a DER BIT STRING.
class
lib.Crypto.Util.asn1.DerBooleanClass to model a DER-encoded BOOLEAN.
class
lib.Crypto.Util.asn1.DerIntegerClass to model a DER INTEGER.
class
lib.Crypto.Util.asn1.DerNullClass to model a DER NULL element.
class
lib.Crypto.Util.asn1.DerObjectBase class for defining a single DER object.
class
lib.Crypto.Util.asn1.DerObjectIdClass to model a DER OBJECT ID.
class
lib.Crypto.Util.asn1.DerOctetStringClass to model a DER OCTET STRING.
class
lib.Crypto.Util.asn1.DerSequenceClass to model a DER SEQUENCE.
class
lib.Crypto.Util.asn1.DerSetOfClass to model a DER SET OF.
method
lib.Crypto.Util.asn1.DerSetOf.add(elem)Add an element to the set.
func
lib.Crypto.Util.number.bytes_to_long(s)Convert a byte string to a long integer (big endian).
func
lib.Crypto.Util.number.getPrime(N, randfunc=None)Return a random N-bit prime number.
func
lib.Crypto.Util.number.isPrime(N, false_positive_prob=1e-06, randfunc=None)Test if a number *N* is a prime.
About this data
These signatures were extracted from the public source of Legrandin/pycryptodome
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.