Write a function named caesardecipher that accepts a key


Question: Write a function named caesarDecipher that accepts a key value (the Caesar shift value) as its first command-line parameter, and a string (the ciphertext) for its second parameter. Your caesarDecipher function should look like this:

caesarDecipher (shift, ciphertext):

''Returns plaintext obtained by transforming every letter in the ciphertext by a Caesar cipher by the specified shift. Non-letter characters should remain unchanged in the plaintext.''

[Your code goes here]

return [something]

Testing

To see if your code works properly, you should first try to encrypt and then decrypt a given message, and make sure it does it right.

Here are a few things for you to try to decrypt. Note that non-letters (spaces and the single quote) are copied as-is to the ciphertext.

"gduwk ydghu lv oxnh vnbzdonhu'v idwkhu" (key is 3)

"v fnirq n ybg ba zl nhgb vafhenapr ol fjvgpuvat gb trvxb" (key is 13)

Solve this question in details and provide examples to support your rationale.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a function named caesardecipher that accepts a key
Reference No:- TGS0946526

Expected delivery within 24 Hours