Implement the function caesar_encrypt(plaintext: str, shift: int) -> str that
takes a string plaintext and an integer shift as input, and returns the Caesar-
encrypted version of the input string.
To implement the Caesar cipher, you will need to do the following:
- Iterate through each character in the input string.
- Convert the character to its ASCII code using the ord function.
- Shift the ASCII code by the specified number of positions using addition.
- Convert the shifted ASCII code back to a character using the chr
function. - Repeat these steps for each character in the input string, and return the
resulting encrypted string.
Blog Reference:
A tutorial on the Caesar cipher:
https://www.tutorialspoint.com/cryptography_with_python/cryptography_
with_python_caesar_cipher.htm
A Python implementation of the Caesar cipher:
https://www.geeksforgeeks.org/caesar-cipher-in-python/