Question: Create a JavaScript function that accepts three parameters, and returns the Caesar Cipher encrypted text. Reference the Caesar Cipher Wikipedia page to learn more about
Create a JavaScript function that accepts three parameters, and returns the Caesar Cipher encrypted text. Reference the Caesar Cipher Wikipedia page to learn more about the technical specifications of the Caesar Cipher.
Function name: CaesarEncrypt(clearText, shiftNum, shiftLeft)
Parameters:
- clearText: the unencrypted string
- shiftNum: the integer number of positions to shift, default to two positions shift
- shiftLeft: the Boolean value of whether the shifting is left (true), or right (false), default to left shift is true
Return: Encrypted text using the parameter values.
Output: No output
You will ONLY encrypt (i.e., shift) uppercase or lowercase alphabetic characters, and numbers. All other characters are returned unshifted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
