Navigation

Caesar cipher (JavaScript)

Program

This requires JavaScript, which is not supported by your browser or is disabled.

Text:

Shift:

Description

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.