Project Nayuki

Caesar cipher (JavaScript)



This JavaScript program encrypts and decrypts messages using the Caesar cipher. The shift value must be an integer between 0 and 25, inclusive. The default shift value of 13 corresponds to the ROT13 cipher. When encrypting or decrypting, the case is preserved, and non-letters are unchanged.

The Caesar cipher is a ridiculously weak cipher and should only be used for fun, not for anything serious! I even wrote a program that automatically decrypts messages that were encrypted with the Caesar cipher.

The source code is available for viewing.

More info