Tools related to asymmetric ciphers¶
Tools for asymmetric ciphers common to all the backends.
- class pyflocker.ciphers.backends.asymmetric.MGF1(hashfunc: BaseHash = <factory>)[source]
Bases:
BaseMGF
Mask Generation Function.
- Parameters:
hashfunc – A
BaseHash
object. Defaults to ‘sha256’.
- hashfunc: BaseHash
- class pyflocker.ciphers.backends.asymmetric.OAEP(mgf: BaseMGF = <factory>, hashfunc: BaseHash = <factory>, label: bytes | None = None)[source]
Bases:
BaseAsymmetricPadding
PKCS#1 OAEP is an asymmetric cipher based on RSA and OAEP padding. It can encrypt messages slightly shorter than RSA modulus.
- Parameters:
mgf – Mask Generation Function. Defaults to MGF1.
hashfunc – A
BaseHash
object. Defaults to ‘sha256’. Can be created frominterfaces.Hash.new()
function.label – A label to apply to this encryption. Defaults to
None
.
- mgf: BaseMGF
- hashfunc: BaseHash
- class pyflocker.ciphers.backends.asymmetric.PSS(mgf: ~pyflocker.ciphers.base.BaseMGF = <factory>, salt_length: int | None = None)[source]
Bases:
BaseAsymmetricPadding
Probabilistic Digital Signature Scheme.
- Parameters:
mgf – A Mask Generation Function. Defaults to MGF1.
salt_length – Length of the salt, in bytes. It must be greater than 0. Defaults to
None
.
- mgf: BaseMGF
- class pyflocker.ciphers.backends.asymmetric.ECDSA[source]
Bases:
BaseEllepticCurveSignatureAlgorithm
Elleptic Curve Digital Signature Algorithm.
- class pyflocker.ciphers.backends.asymmetric.ECDH[source]
Bases:
BaseEllepticCurveExchangeAlgorithm
Elleptic Curve Diffie Hellmann Algorithm.
- class pyflocker.ciphers.backends.asymmetric.EdDSA(mode: str = 'rfc8032', context: bytes | None = None)[source]
Bases:
BaseEllepticCurveSignatureAlgorithm
Edwards-curve Digital Signature Algorithm.
- Parameters:
mode – A string that is currently equal to
"rfc8032"
.context – Up to 255 bytes of context, which is a constant byte string to segregate different protocols or different applications of the same key.
- mode: str = 'rfc8032'