Caesar Cipher

Theory

The Caesar cipher is a simple substitution cipher, where each letter in the plaintext is shifted a certain number of places down the alphabet.

It is a general case of rot13, and a special case of a Monoalphabetic substitution cipher

Pseudo Code

            
function caesarCipher(text, shift){
    return text.map((char) => char.match(/[a-z]/)) ?
    let a = "a".charCodeAt(0);
    char = (char - a + shift) % 26 + a : char; 
}
            

Encrypt/Decrypt