Skip to main content

Python library to encipher & decipher a string using one of the simplest Substitution ciphers - 'Caesar's Cipher'

Project description


Python library to encipher & decipher a string using one of the simplest Substitution ciphers - "Caesar's Cipher"

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

This library contains an Encipher method and a Decipher method to encipher & decipher a string, respectively, using a shiftkey.

python -m pip install pycaesarcipher==1.3 (or) python -m pip install pycaesarcipher==1.4

Import the module
Create an instance of the class
call the function "encipher" or "decipher" as an object along with the instance of the class


import pycaesarcipher
variable_name = pycaesarcipher.pycaesarcipher() <br>
new_variable = variable_name.caesar_encipher("string",shiftkey) <br>
another_variable = variable_name.caesar_decipher(new_variable,shiftkey) <br>
print(new_variable) <br>


import pycaesarcipher
word = pycaesarcipher.pycaesarcipher()
new = word.caesar_encipher("i love python",12)
word2 = word.caesar_decipher("u xahq bkftaz",12)
print(new," is the enciphered text.\n")
print(word2," is the deciphered text.")

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

pycaesarcipher-1.5.tar.gz (2.9 kB view hashes)

Uploaded source

Supported by

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