A simple JavaScript program that decodes a Caesar‑shifted string. This project takes an encoded message and shifts each letter backward through the alphabet to reveal the original text. Built as part of the freeCodeCamp JavaScript Algorithms and Data Structures curriculum.
-
Fully decrypts Caesar‑encoded text
-
Preserves spaces and punctuation
-
Handles uppercase and lowercase letters
-
Uses modular arithmetic to wrap around the alphabet
-
Runs in the browser or via Node.js
The Caesar Cipher encodes text by shifting letters forward. Your program reverses that shift:
-
Encoded: "GHI"
-
Shift: 2
-
Output: "EFG"
Your script loops through each character, checks if it’s a letter, shifts it backward, and reconstructs the decoded message.
-
JavaScript (ES6)
-
Node.js (optional for running locally)
-
HTML/CSS (if you add a UI later)
Clone the repository:
Code git clone https://github.com/Romie321/Cipher.git Navigate into the project folder:
Code cd Cipher Run the script with Node:
Code node script.js
👉 Live Site: https://romie321.github.io/Cipher/
-
Add a simple UI for entering encoded text
-
Add an “encrypt” mode
-
Add support for non‑Latin alphabets
-
Add animations or visual feedback