Message Encryption and Decryption Using Caesar Cipher DEPT: ECE SUB: Networks and Security Thanthai periyar government institute of technology
Introduction This project demonstrates the implementation of a simple encryption and decryption system using the Caesar Cipher technique. The Caesar Cipher is one of the oldest known encryption techniques, where each letter in the plaintext is shifted a certain number of places down or up the alphabet.
Principle of the Project The core principle behind this project is the Caesar Cipher, a type of substitution cipher. In this cipher, each letter in the plain text is shifted a certain number of positions down or up the alphabet. The encryption function shifts characters forward by the specified number, while the decryption function shifts characters backward.
How the Code Works Encrypting a Message: The function encrypt_message takes a plaintext message and a shift value as input. It iterates over each character in the message.If the character is an alphabet letter (either uppercase or lowercase), it calculates the encrypted character by shifting it by the specified number of positions.Non -alphabet characters are not changed.The result is the encrypted message.
Decryption is the process of converting an encrypted message back to its original (readable) format. The function decrypt_message takes an encrypted message and the same shift value as input. It uses the encrypt_message function with a negative shift value to reverse the Decrypting a Message:
Conclusion This project illustrates the basic concept of the Caesar Cipher and provides a simple implementation in Python. The encryption and decryption processes are straightforward, making it an excellent example of how substitution ciphers work.