Skip to content

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

License

Notifications You must be signed in to change notification settings

N1ghtF1re/Stream-ciphers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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