Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Geffe Generator

A Java implementation of the Geffe generator - a keystream generator that combines three LFSRs through a nonlinear function.

What this is

The Geffe generator is a classic nonlinear combination generator used to build a stream-cipher keystream. A single linear-feedback shift register (LFSR) has low linear complexity and can be reconstructed from a short fragment of its output by solving a system of linear equations; the Geffe construction raises the linear complexity by combining three LFSRs of distinct lengths with the nonlinear function

f(x1, x2, x3) = x1·x2 ⊕ x2·x3 ⊕ x3

in which one register acts as a selector, passing one of the other two registers through to the output.

The implementation is split into small, focused classes:

  • Polynomial - builds a feedback polynomial from its tap positions.
  • LFSR - a Fibonacci-style shift register driven by a feedback polynomial: it outputs the low bit and feeds back the parity of the tapped bits.
  • GeffeGenerator - combines three LFSRs and emits the keystream (gamma).
  • Main - a demo harness that seeds three registers of degrees 30, 31 and 32, generates the keystream, prints each register's output stream, and checks the combined gamma against a bundled reference sequence (result.txt).

License

Released under the MIT License. See LICENSE.

About

Java implementation of a Geffe stream-cipher keystream generator built from three LFSRs

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages