Bis Project
Bis Project
Submitted by
Student of
Diploma In Engineering
in
computer Department
Project Overview:
The project will consist of:
A Python program to encrypt and decrypt messages.
A simple user interface (command-line) where the user can input a message and choose
to either encrypt or decrypt it using a key (shift value).
Encryption: The plaintext is shifted by a key value. For example, if the key is 3, 'A'
becomes 'D', 'B' becomes 'E', and so on.
Decryption: The ciphertext is shifted in the opposite direction by the same key to retrieve
the original message.
CODE(python):
# Caesar Cipher Encryption and Decryption
ciphertext = ''
if char.isalpha():
ciphertext += encrypted_char
else:
# Non-alphabet characters remain unchanged
ciphertext += char
return ciphertext
plaintext = ''
if char.isalpha():
plaintext += decrypted_char
else:
plaintext += char
return plaintext
def main():
while True:
if choice == '1':
break
else:
Encrypt Function:
The encrypt() function shifts each letter of the input message by the specified key
(integer). The shift is done modulo 26 to keep the result within the alphabet
range.
Decrypt Function:
The decrypt() function works similarly but shifts the letters back in the opposite
direction to recover the original message.
Main Program:
Depending on the user's choice, they are prompted to input the message and key
(shift value).
OUTPUT SCREENSHORT :