An open API service indexing awesome lists of open source software.

https://github.com/jakubriegel/geffe-generator

Functional style implemented Geffe cryptographic stream generator
https://github.com/jakubriegel/geffe-generator

cryptographic-keys cryptography functional-programming geffe-generator scala tailrecursion university

Last synced: 8 months ago
JSON representation

Functional style implemented Geffe cryptographic stream generator

Awesome Lists containing this project

README

          

# Geffe Generator

## about
Implementation of Geffe Generator using functional style Scala and lazy collections.
Application provides command line and graphical interfaces.

Features:
* generation of geffe stream
* implementation of statistical tests: long series, poker and monobit
* two types of LFSR: xor and custom Fibonacci
* random registers generation

## build
```
sbt
sbt:geffe> assembly
```
Generated jar will be available at `target/scala-2.13/geffe.jar`

## cli
> CLI was developed only for development purposes and has very limited features

### generate stream
Type: `java -jar geffe.jar stream `
CLI uses random registers of given size and type

Example: `java -jar geffe.jar stream 100 xor 25 xor 25 fib 25`

### run FIPS tests
Type: `java -jar geffe.jar test `
Stream file should consist of `1`s and `0`s. The application will run 4 FIPS tests.

Example: `java -jar geffe.jar test stream.txt`

## algorithm
### how it works?
Geffe Generator uses three LFSRs connected non-linearly by multiplexer. General equation for this stream is:
```
k = (a3 AND a1) OR ((NOT a1) AND a2)
```

### example
Using three 4-bit XOR registers:
* first with coefficients 0110 and initial state 1010
* second with coefficients 1101 and initial state 1111
* third with coefficients 1111 and initial state 0101

Generating 3-bit stream:
```
First bit:
LFSR1:
output: 1
next state: 0101
LFSR2:
output: 1
next state: 1111
LFSR3:
output: 0
next state: 1010

Bit: 0

Second bit:
LFSR1:
output: 1
next state: 1011
LFSR2:
output: 1
next state: 1111
LFSR3:
output: 1
next state: 0101

Bit: 1

Third bit:
LFSR1:
output: 1
next state: 0111
LFSR2:
output: 1
next state: 1111
LFSR3:
output: 0
next state: 1010

Bit: 0

Result: 010
```

## credits
This is a project for Data Protection Basics course at Poznan University of Technology.