April 05, 2010

Tutorial: Caesar Cipher

Another javascript tutorial for middle-schoolers, based on Shakeel's idea. The short file caesar-cipher.html implements a simple Caesar Cipher in javascript, rotating letters of cleartext into ciphertext by shifting them by a fixed number.

The idea of this tutorial is to be a gentle introduction to event-based programming. The encryption code runs every time a keyup event is received on any of the input boxes. (view source)

I decided to use indexOf/charAt instead of charCodeAt/fromCharCode do do the conversion between letters and numbers, because there are fewer edge cases in the code, and it means there's one fewer concept to worry about.

Posted by David at April 5, 2010 06:49 AM


Posted by: Devendra at October 10, 2010 08:44 AM

At the code you dont have the jquery file

Posted by: at October 20, 2015 10:21 AM
Post a comment

Remember personal info?