def auto_encrypt_bytes(data, chain_size, plain_text=b''):
    """Encrypt data with automatically generated key and primer.

    This function automates key and primer creation and encrypts the
    data with them. The two arguments following the data allow some
    simple customizations of the key and primer generation process."""
    key = Key.new(set(data) - set(plain_text), chain_size)
    primer = Primer.new(key)
    return Encrypter(key, primer).process(data), key, primer
Encrypt data with automatically generated key and primer.

    This function automates key and primer creation and encrypts the
    data with them. The two arguments following the data allow some
    simple customizations of the key and primer generation process.
recipes/Python/578075_Markov_Encryption_Module/recipe-578075.py