Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.85 KB

README.md

File metadata and controls

44 lines (34 loc) · 1.85 KB

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