diff --git a/Caesar-Cipher-Decoder/README.md b/Caesar-Cipher-Decoder/README.md new file mode 100644 index 0000000..0badbcf --- /dev/null +++ b/Caesar-Cipher-Decoder/README.md @@ -0,0 +1,24 @@ +# Caesar Cipher Decoder +Caesar cipher decryption program in python. + + +# Installation + +
git clone https://github.com/vijaysahuofficial/Caesar-Cipher-Decoder.git+ +
cd Caesar-Cipher-Decoder+ +
sudo chmod +x ccdecoder.py+ +
./ccdecoder.py+ +
python3 ccdecoder.py+ +
pkg install python -y+
pkg install git -y+
git clone https://github.com/vijaysahuofficial/Caesar-Cipher-Decoder.git+
cd Caesar-Cipher-Decoder+
chmod +x ccdecoder.py+
./ccdecoder.py\ No newline at end of file diff --git a/Caesar-Cipher-Decoder/ccdecoder.py b/Caesar-Cipher-Decoder/ccdecoder.py new file mode 100644 index 0000000..09e9821 --- /dev/null +++ b/Caesar-Cipher-Decoder/ccdecoder.py @@ -0,0 +1,27 @@ +#! /usr/bin/python3 + +import string +alpha = string.ascii_lowercase + +def decrypt(x,y): + decrypted = "" + for i in x: + if i in alpha: + p = alpha.find(i) + v = (p - y) % 26 + z = alpha[v] + decrypted += z + else: + decrypted += i + print(decrypted) + +def userinput(): + try: + a = input("Enter the Encrypted Code \n>>>>").lower() + key = 0 + while key < 27: + decrypt(a, key) + key += 1 + except KeyboardInterrupt: + print("Pressed CTRL + C \nExiting...") +userinput() \ No newline at end of file