Skip to content

tofunmidavid/Python-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Python-Code

Cipher Text

Caesar Cipher Decipher Tool

This Python script is designed to decipher text encrypted with a Caesar cipher — a classical substitution cipher that shifts letters in the alphabet by a fixed number of positions. It automatically tests all 26 possible shifts to find the original message by looking for a known word provided by the user.

Features

Attempts all 26 possible Caesar cipher shifts automatically. Preserves uppercase and lowercase letters during decryption. Ignores non-alphabetic characters (spaces, punctuation, etc.). Stops and returns the first decoded text containing the known keyword. Returns "Invalid" if no valid decoding is found.

How It Works

The program defines a helper function shift_text() that shifts each character backward through the alphabet. It loops through all possible shift values (0–25). For each decoded attempt, it checks if the user-provided known word appears in the text. Once a match is found, the program outputs the decoded message.

Example

Input: Khoor Zruog World

Output: Hello World

About

Cipher Text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published