crandas.crypto¶
- crandas.crypto.cipher.AES_128(key)¶
AES 128 cypher
- Parameters:
key (Bytestring) – AES key
- Returns:
Cipher object with the relevant round keys
- Return type:
- crandas.crypto.cipher.AES_192(key)¶
AES 192 cypher
- Parameters:
key (Bytestring) – AES key
- Returns:
Cipher object with the relevant round keys
- Return type:
- crandas.crypto.cipher.AES_256(key)¶
AES 256 cypher
- Parameters:
key (Bytestring) – AES key
- Returns:
Cipher object with the relevant round keys
- Return type:
- class crandas.crypto.cipher.Cipher(name, round_keys)¶
Bases:
object
Cipher object, contains the round keys needed for encryption of a message using the
encrypt
method. Currently only AES-128, AES-192 and AES-256 are supported for 16 byte messages.- encrypt(message)¶
Encrypt the message given the round keys of the Cipher object
- Parameters:
message (Bytestring) – Message to be encrypted, currently must be 16 bytes
- Returns:
Message encrypted with the key belonging to the
Cipher
- Return type:
Bytestring