Practical Cryptography: "Rail-fence Cipher"
Go through both examples (written and JavaScript) of the Rail-fence Cipher and then read about its cryptanalysis.
Click http://practicalcryptography.com/ciphers/classical-era/rail-fence/ link to open resource.