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