encryption module

encryption.AES128CFB8(shared_secret)[source]

Creates a AES128 stream cipher using cfb8 mode

class encryption.PBEWithMD5AndDES(key)[source]

Bases: object

PBES1 implementation according to RFC 2898 section 6.1

COUNT = 5
SALT = '\x0c\x9dJ\xe4\x1e\x83\x15\xfc'
decrypt(ciphertext)[source]
encrypt(plaintext)[source]
class encryption.RC4(key)[source]

Bases: object

crypt(data)[source]
decrypt(data)
encrypt(data)
encryption.decode_public_key(bytes)[source]

Decodes a public RSA key in ASN.1 format as defined by x.509

encryption.decrypt_shared_secret(encrypted_key, private_key)[source]

Decrypts the PKCS#1 padded shared secret using the private RSA key

encryption.encode_public_key(key)[source]

Encodes a public RSA key in ASN.1 format as defined by x.509

encryption.encrypt_shared_secret(shared_secret, public_key)[source]

Encrypts the PKCS#1 padded shared secret using the public RSA key

encryption.encryption_for_version(version)[source]
encryption.generate_challenge_token()[source]

Generates 4 random bytes

encryption.generate_key_pair()[source]

Generates a 1024 bit RSA key pair

encryption.generate_random_bytes(length)[source]
encryption.generate_server_id()[source]

Generates 20 random hex characters

encryption.generate_shared_secret()[source]

Generates a 128 bit secret key to be used in symmetric encryption

This Page