Skip to content

The library contains three simple ciphers: rail-fence, rotating square and wizner cipher

License

Notifications You must be signed in to change notification settings

N1ghtF1re/Simple-ciphers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple ciphers

Stars Total Downloads Latest Stable Version License

About the library

The library contains three simple ciphers: rail-fence, rotating square and wizner cipher

Class RailFence:

Methods:

  • encode(String message, int key) - return encoded message with a cipher "Rail-Fence" with the specified key.
  • decode(String message, int key) - return decoded message with a cipher "Rail-Fence" with the specified key.

Class VigenerCipher:

Constructors:

  • VigenerCipher() - default, RUSSIAN ALPHABET
  • VigenerCipher(String aplhaber) - With the assignment the alphabet. The characters are written consecutively by a string. Example: "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"

Methods:

  • encode(String message, str keyword) - return encoded message with a Vigener cipher with the specified keyword.
  • decode(String message, str keyword) - return decoded message with a Vigener cipher with the specified keyword.

Class RotatingSquare:

Constructors:

  • RotatingSquare() - default, used default key.
  • RotatingSquare(int[][] key) - With the assignment the key, key - the array of "holes" in the square of the format [ [x,y], [x,y], ..]. Example: {{0,0}, {3,1}, {2,2}, {1,3}}

Methods:

  • encode(String message) - return encoded message with a cipher "Rotating Square".
  • decode(String message) - return decoded message with a cipher "Rotating Square".