Coder Social home page Coder Social logo

jakubriegel / geffe-generator Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 833 KB

Functional style implemented Geffe cryptographic stream generator

Scala 100.00%
cryptography cryptographic-keys geffe-generator functional-programming scala university tailrecursion

geffe-generator's Introduction

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 <NUMBER_BITS_TO_GENERATE> <FIRST_LFSR_TYPE> <FIRST_LFSR_SIZE> <SECOND_LFSR_TYPE> <SECOND_LFSR_SIZE> <THIRD_LFSR_TYPE> <THIRD_LFSR_SIZE> 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 <FILE_WITH_STREAM_TO_TEST> Stream file should consist of 1s and 0s. 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.

geffe-generator's People

Contributors

jakubriegel avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.