17.5 Stream Cryptosystems

Module: sage.crypto.stream

Stream Cryptosystems.

Class: LFSRCryptosystem

class LFSRCryptosystem
Linear feedback shift register cryptosystem class
LFSRCryptosystem( self, [field=None])

Create a linear feedback shift cryptosystem.

Input: A string monoid over a binary alphabet.

Output:

       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 if limitated to the finite field of 2 elements only because of the dependence on binary strings.

Functions: encoding

Special Functions: __call__,$ \,$ __eq__,$ \,$ __init__,$ \,$ __repr__

__call__( self, key)

Create a LFSR cipher.

Input: A polynomial and inital state of the LFSR.

Class: ShrinkingGeneratorCryptosystem

class ShrinkingGeneratorCryptosystem
Shrinking generator cryptosystem class
ShrinkingGeneratorCryptosystem( self, [field=None])

Create a shrinking generator cryptosystem.

Input: A string monoid over a binary alphabet.

Output:

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

Functions: encoding

Special Functions: __call__,$ \,$ __init__,$ \,$ __repr__

__call__( self, 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.

See About this document... for information on suggesting changes.