Skip to main content

Preserving History Through Code- Caesar Cipher

Project description

Preserving History Through Code- Julius Caesar's Shift Cipher

Gaius Julius Caesar

From Wikipedia, the free encyclopedia
In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code, or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.

The Caesar cipher is named for Julius Caesar, who used an alphabet where decrypting would shift three letters to the left..
Julius Caesar (100-44 BCE)
Source: Wikipedia

Caesar cipher using a left rotation of three places

Expectations

Plain : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW

Plaintext : THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD


The action of a Caesar cipher is to replace each plaintext letter with a different one a fixed number of places down the alphabet. The cipher illustrated here uses a left shift of three, so that (for example) each occurrence of E in the plaintext becomes B in the ciphertext.
The action of a Caesar cipher
Source: Wikipedia

Caesar cipher disk was invented over a millemium after Julius Caesar

But we would borrow Alberti's disc to also visualize the Caesar's Cipher


CipherDisk2000

CipherDisk2000 invented by Leon Battista Alberti 1404 - 1472

Source: Wikipedia

Caesar cipher using a left rotation of three places

With a left shift of 3, D would be replaced by A, E would become B, and so on.

The cipher disk illustration was inspired by Alberti's cipher disk, although his disk had the outer disk as the rotating disk and it was also in the reverse order compared to the inner disk.


CipherDisk in 0 position 0 Shift
CipherDisk in 0 position 0 Shift

CipherDisk with 3 left rotations or -3 Shift
Cipher disc 3 left rotations

Focus

This caesar cipher program encrypts only uppercase letters and no other characters. Modelled closely to the caesar cipher used before common era.

Install

pip install jc-cipher

Run in command/terminal

jc-cipher

Import modules

from caesar_cipher import encryption as ce
from caesar_cipher import decryption as de

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jc-cipher-0.0.9.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jc_cipher-0.0.9-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file jc-cipher-0.0.9.tar.gz.

File metadata

  • Download URL: jc-cipher-0.0.9.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for jc-cipher-0.0.9.tar.gz
Algorithm Hash digest
SHA256 2c65bb36e42f0b85a85cf409cd6d7d4fea827f91f4c5faf937a94f7aa4fe3c12
MD5 2f60a1c9a0380e845760e542f0f53cc3
BLAKE2b-256 8d192a3d93484f593830e809c3428b640c2001afe97e67ce9819ace55e93e38a

See more details on using hashes here.

File details

Details for the file jc_cipher-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: jc_cipher-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for jc_cipher-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4e53ee8b976b9acc10b5dc2ae14aea3e92325fb6abee20c7e72b7d7fe2899e7b
MD5 92909628adbc7abac521f16e83d520de
BLAKE2b-256 7aefd38e76fbb77d0bc536386ca8dcb1a2249ece2440181310c83c79297f0248

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page