Project 2 - Cipher implementation in Python

profilemayue0116
caesar-encryption.py

#A python program to illustrate Caesar Cipher Technique def encrypt(text,s): result = "" # traverse text for i in range(len(text)): char = text[i] # Encrypt characters result += chr((ord(char) + s-65) % 26 + 65) return result #check the above function text = "THISISACLASSONSECURITY" s = 3 #WKLVLVDFODVVRQVHFXULWB print("Text: " + text) print("Key: " + str(s)) print("Encrypted code: " + encrypt(text,s) )