Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
Question
Book Icon
Chapter 5, Problem 7PE
Program Plan Intro

Program to encode and decode caesar cipher

Program plan

  • Inside the “main()” function,
    • Declare “plaintext” and “key” and get input from the user.
    • Declare “ciphertext” and then encode the plaintext into ciphertext.
    • Print the encoded message.
  • Call the “main()”  function.

Blurred answer
Students have asked these similar questions
A Caesar cipher is a simple substitution cipher based on the idea of shiftingeach letter of the plaintext message a fixed number (called the key) ofpositions in the alphabet. For example, if the key value is 2, the word"Sourpuss" would be encoded as "Uqwtrwuu." The original message canbe recovered by "reencoding" it using the negative of the key.Write a program that can encode and decode Caesar ciphers. The input to the program will be a string of plaintext and the value of the key.The output will be an encoded message where each character in the original message is replaced by shifting it key characters in the Unicode character set. For example, if ch is a character in the string and key is theamount to shift, then the character that replaces ch can be calculated as:chr (ord(ch) + key) .
Simple python code
Python question Simple python program
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education