Python library to encipher & decipher a string using one of the simplest Substitution ciphers - 'Caesar's Cipher'
Project description
CaesarCipher
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.
INSTALLATION:
python -m pip install pycaesarcipher==1.3 (or) python -m pip install pycaesarcipher==1.4
ALGORITHM :
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
USAGE :
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>
EXAMPLE PROGRAM:
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
File details
Details for the file pycaesarcipher-1.5.tar.gz
.
File metadata
- Download URL: pycaesarcipher-1.5.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 319cb1ce1f279cb883031548f2abe6a30c9b7fd6199bba296a604634ba01c508 |
|
MD5 | f552ad9dee2864ebf259ed3043af76e2 |
|
BLAKE2b-256 | 088738656892fe97d06a3611dcd51d2a746c520700839863d08006933fafd1ef |