Stream Cryptosystems.

class sage.crypto.stream.LFSRCryptosystem(field=None)

Linear feedback shift register cryptosystem class

__call__(key)

Create a LFSR cipher.

INPUT: A polynomial and initial state of the LFSR.

__eq__(right)
__init__(field=None)

Create a linear feedback shift cryptosystem.

INPUT: A string monoid over a binary alphabet.

OUTPUT:

EXAMPLES:

       sage: E = LFSRCryptosystem(FiniteField(2))
sage: E
       LFSR cryptosystem over Finite Field of size 2

TESTS:

sage: E = LFSRCryptosystem(FiniteField(2))
sage: E == loads(dumps(E))
True

TODO: Implement LFSR cryptosytem for arbitrary rings. The current implementation is limited to the finite field of 2 elements only because of the dependence on binary strings.

__repr__()
encoding(M)
class sage.crypto.stream.ShrinkingGeneratorCryptosystem(field=None)

Shrinking generator cryptosystem class

__call__(key)

Create a Shrinking generator cipher.

INPUT: A list or tuple consisting of two LFSR ciphers (e1,e2).

OUTPUT: The shrinking generator cipher with key stream generator e1 and decimating cipher e2.

__init__(field=None)

Create a shrinking generator cryptosystem.

INPUT: A string monoid over a binary alphabet.

OUTPUT:

EXAMPLES:

       sage: E = ShrinkingGeneratorCryptosystem()
sage: E
       Shrinking generator cryptosystem over Finite Field of size 2
__repr__()
encoding(M)

Previous topic

Mini-AES

Next topic

Stream Ciphers

This Page