October 2016
Beginner to intermediate
650 pages
14h 43m
English
The Atbash cipher is a simple cipher that uses opposite values in the alphabet to transform words. For example, A is equal to Z and C is equal to X.
For this, we will only need the string module.
Since the Atbash cipher works by using the opposite value of a character in the alphabet, we can create a maketrans feature to substitute characters:
import string
input = raw_input("Please enter the value you would like to Atbash Cipher: ")
transform = string.maketrans(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba")
final = string.translate(input, transform)
print finalAfter importing the correct module, we request the input ...
Read now
Unlock full access