SSHCiphers represents all the encryption operations that need to occur
to encrypt and authenticate the SSH connection.

@cvar cipherMap: A dictionary mapping SSH encryption names to 3-tuples of
                 (<cryptography.hazmat.primitives.interfaces.CipherAlgorithm>,
                  <block size>, <cryptography.hazmat.primitives.interfaces.Mode>)
@cvar macMap: A dictionary mapping SSH MAC names to hash modules.

@ivar outCipType: the string type of the outgoing cipher.
@ivar inCipType: the string type of the incoming cipher.
@ivar outMACType: the string type of the incoming MAC.
@ivar inMACType: the string type of the incoming MAC.
@ivar encBlockSize: the block size of the outgoing cipher.
@ivar decBlockSize: the block size of the incoming cipher.
@ivar verifyDigestSize: the size of the incoming MAC.
@ivar outMAC: a tuple of (<hash module>, <inner key>, <outer key>,
    <digest size>) representing the outgoing MAC.
@ivar inMAc: see outMAC, but for the incoming MAC.
Method __init__ Undocumented
Method setKeys Set up the ciphers and hashes using the given keys,
Method encrypt Encrypt some data.
Method decrypt Decrypt some data.
Method makeMAC Create a message authentication code (MAC) for the given packet using the outgoing MAC values.
Method verify Verify an incoming MAC using the incoming MAC values.
Method _getCipher Creates an initialized cipher object.
Method _getMAC Gets a 4-tuple representing the message authentication code. (<hash module>, <inner hash value>, <outer hash value>, <digest size>)
def __init__(self, outCip, inCip, outMac, inMac): (source)
Undocumented
def setKeys(self, outIV, outKey, inIV, inKey, outInteg, inInteg): (source)

Set up the ciphers and hashes using the given keys,

ParametersoutIVthe outgoing initialization vector
outKeythe outgoing encryption key
inIVthe incoming initialization vector
inKeythe incoming encryption key
outIntegthe outgoing integrity key
inIntegthe incoming integrity key.
def _getCipher(self, cip, iv, key): (source)

Creates an initialized cipher object.

Parameterscipthe name of the cipher, maps into cipherMap
ivthe initialzation vector
keythe encryption key
Returnsthe cipher object.
def _getMAC(self, mac, key): (source)

Gets a 4-tuple representing the message authentication code. (<hash module>, <inner hash value>, <outer hash value>, <digest size>)

Parametersmaca key mapping into macMap (type: bytes)
keythe MAC key. (type: bytes)
ReturnsThe MAC components. (type: bytes)
def encrypt(self, blocks): (source)

Encrypt some data.

ParametersblocksThe data to encrypt. (type: bytes)
ReturnsThe encrypted data. (type: bytes)
def decrypt(self, blocks): (source)

Decrypt some data.

ParametersblocksThe data to decrypt. (type: bytes)
ReturnsThe decrypted data. (type: bytes)
def makeMAC(self, seqid, data): (source)

Create a message authentication code (MAC) for the given packet using the outgoing MAC values.

ParametersseqidThe sequence ID of the outgoing packet. (type: int)
dataThe data to create a MAC for. (type: bytes)
ReturnsThe serialized MAC. (type: str)
def verify(self, seqid, data, mac): (source)

Verify an incoming MAC using the incoming MAC values.

ParametersseqidThe sequence ID of the incoming packet. (type: int)
dataThe packet data to verify. (type: bytes)
macThe MAC sent with the packet. (type: bytes)
ReturnsTrue if the MAC is valid. (type: bool)
API Documentation for Twisted, generated by pydoctor at 2016-04-04 15:02:49.