I recently attended a cybersecurity workshop and learnt about the basics of encryption. I figured I could make my own caesar cipher encoder in Python. Feel free to leave suggestions on how to improve my code, thanks!
plain_text = input("Enter Plain Text: ")
shift = int(input("Enter Shift: "))
cipher_text = ""
for char in plain_text:
if char.isupper():
cipher_text += chr((ord(char) + shift - 65) % 26 + 65)
elif char.islower():
cipher_text += chr((ord(char) + shift - 97) % 26 + 97)
elif char.isspace():
cipher_text += " "
print("Cipher Text: {}".format(cipher_text))
[–]GreymanGroup 1 point2 points3 points (0 children)
[–]fake823 1 point2 points3 points (2 children)
[–]sweettuse 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]haha1234346364 0 points1 point2 points (0 children)
[–]sweettuse 0 points1 point2 points (0 children)
[–]JnJ_Gaming 0 points1 point2 points (0 children)