tlslite.utils.cipherfactory module¶
Factory functions for symmetric cryptography.
- tlslite.utils.cipherfactory.createAES(key, IV, implList=None)¶
Create a new AES object.
- Parameters:
key (str) – A 16, 24, or 32 byte string.
IV (str) – A 16 byte string
- Return type:
tlslite.utils.AES
- Returns:
An AES object.
- tlslite.utils.cipherfactory.createAESGCM(key, implList=None)¶
Create a new AESGCM object.
- Parameters:
key (bytearray) – A 16 or 32 byte byte array.
- Return type:
tlslite.utils.AESGCM
- Returns:
An AESGCM object.
- tlslite.utils.cipherfactory.createCHACHA20(key, implList=None)¶
Create a new CHACHA20_POLY1305 object.
- Parameters:
key (bytearray) – a 32 byte array to serve as key
- Return type:
tlslite.utils.CHACHA20_POLY1305
- Returns:
A ChaCha20/Poly1305 object
- tlslite.utils.cipherfactory.createRC4(key, IV, implList=None)¶
Create a new RC4 object.
- Parameters:
key (str) – A 16 to 32 byte string.
IV (object) – Ignored, whatever it is.
- Return type:
tlslite.utils.RC4
- Returns:
An RC4 object.
- tlslite.utils.cipherfactory.createTripleDES(key, IV, implList=None)¶
Create a new 3DES object.
- Parameters:
key (str) – A 24 byte string.
IV (str) – An 8 byte string
- Return type:
tlslite.utils.TripleDES
- Returns:
A 3DES object.