Skip to content
/ ciphers Public

A python script implementing encryption, decryption and hacking of some simple encryption algorithms (Vigenere, Caesar, Vernam).

Notifications You must be signed in to change notification settings

ssnd/ciphers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Review task 1

A small python script implementing encryption, decryption and hacking of the most widespread encryption algorithms (Vigenere, Caesar, Vername).

Build the project

Run the build.sh script to build the project. It will create the virtual environment, activate it and install all the needed pip packages:
./build.sh

Usage

./encryptor.py --help - to display the help message.

Encode

Use this command to encode the text (read from stdio or a file) using the available ciphers and display the encrypted text or write it to a file.

Usage: encryptor.py encode [OPTIONS]

Options:
-c, --cipher [caesar|vigenere|vernam] -- Cipher type: Caesar, Vigenere or Vernam. [required]
-k, --key TEXT -- The key: integer for Caesar, string for Vigenere and Vernam. [required]
--input-file FILENAME -- The input file to read the text from.
--output-file FILENAME -- Output file to write the text to.

Decode

Use this command to decode the text (read from stdio or a file) using the available ciphers and display the encrypted text or write it to a file.

Usage: encryptor.py decode [OPTIONS]

Options:
-c, --cipher [caesar|vigenere|vernam]Cipher type: Caesar, vigenere or Vernam [required]
-k, --key TEXT The key: integer for Caesar, string for Vigenere and Vernam. [required]
--input-file FILENAME The input file to read the text from.
--output-file FILENAME Output file to write the text to.

Features

  • Encryption and decryption using the following ciphers:
    • Caesar cipher
    • Vegenere cipher
    • Vernam cipher
  • The characters allowed to use (e.g. that will be encrypted) are. The rest of the characters will be escaped and left unchanged: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZабвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ1234567890!"#$%&'()*+,-./:;<=>?@[\\]^_ `{|}~

Run the tests

pytest

About

A python script implementing encryption, decryption and hacking of some simple encryption algorithms (Vigenere, Caesar, Vernam).

Resources

Stars

Watchers

Forks