Cipher v3

Adding a shift to the cipher.

Skills: InputOutputVariablesIf StatementsLoopsArrays
0.75%

Brief

Make the encryption stronger and decryption more difficult by adding a shift that changes the character codes before saving them.

The user should be able to write any sentence they like into an input, click a button, and be given the encrypted output, or input any series of pipe-separated character codes, click a button, and be given the decrypted output.

Previously, the letter t might encrypt to 116. In this version, if you used a shift of 3 then t would become 119.

You can use the Svelte example below if you need help to get started. It contains all of the code for this program. If you can, try to complete the program without looking at it.


Sandbox

Feel free to play around with the example below to see how the web page reacts to your code changes in a consequence-free environment. You won't break or overwrite anything so go for gold.