N1ghtF1re / Stream-ciphers

The implementation of the stream ciphers: LFSR, GEFFE, RC4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stream ciphers

Stars Total Downloads Latest Stable Version License

About the library

The library contains three stream ciphers: LFSR, Geffe, RC4

Class LFSR:

Constructors:

  • LFSR(long initRegister, int[] polinom)
  • LFSR(String initRegister) - default poinom (x^24 + x^4 + x^3 + x + 1)

Methods:

  • encrypt(byte[]) - return encoded bytes array.
  • decrypt(byte[]) - return decoded bytes array.
  • generateKey() - return bytes array of key

Class GEFFE:

Constructors:

  • Geffe(String initRegister1, String initRegister2, String initRegister3, int[] polinom1, int polinom2[], int polinom3[])
  • Geffe(String initRegister1, String initRegister2, String initRegister3) - default poinoms (x^24 + x^4 + x^3 + x + 1, x^32 + x^28 + x^27 + x + 1, x^40 + x^21 + x^19 + x^2 + 1)

Methods:

  • encrypt(byte[]) - return encoded bytes array.
  • decrypt(byte[]) - return decoded bytes array.
  • generateKey() - return bytes array of key

Class RC4:

Constructors:

  • RC4(String strKey)

Methods:

  • encrypt(byte[]) - return encoded bytes array.
  • decrypt(byte[]) - return decoded bytes array.
  • generateKey() - return bytes array of key

About

The implementation of the stream ciphers: LFSR, GEFFE, RC4

License:MIT License


Languages

Language:Java 100.0%