Skip to content

Code implementation of Ciphers taught in Information Security

Notifications You must be signed in to change notification settings

sarimbinwaseem/Ciphers

Repository files navigation

Code style: black Ruff linting: pylint

Cipher Implementaions

Caesar Cipher

How to run:

Encrypt:

python main.py -e -m "The message of secret" -k 8

Decrypt:

python main.py -d "APMHUM  IOMHWNH MKZMA" -k 8

Both:

python main.py -ed -m "The message of secret" -k 8
  • -k/--key is optional as it defaults to 3

Affine Cipher

Comming soon

Playfair Cipher

How to run:

Encrypt:

python main.py -e -m "charlemagne" -k "AACHEN"

Decrypt:

python main.py -d -m "HECQOCKHIEHY" -k "AACHEN"
  • Encryption is working.
  • Code needs optimization.
  • Spaces will break the code.
  • Double letters are not welcome in message at the moment.

Hill Cipher

How to run:

Encrypt:

python main.py -e -m "USMAN" -k "7 8 11 11"

Decrypt (Not implemented yet):

python main.py -d -m "" -k "7 8 11 11"
  • Support for space can be activated by changing mod to 27.
  • Mod value will be changed to 27 if space is present in message.
Image of Hill Cipher running and output. Image of Hill Cipher running and output with space in message.

SDES

Simplified Data Encryption Standard

  • Only key generation is implemented yet.
python main.py

Deffie Hellman

  • We have to check for repetition for ourselves (for now).
python main.py