CRC Press has allowed Meneze et al. to make publicly available their Handbook of Applied Cryptography. This is an award-winning book and, of course, a must-have in your Computer Security library.
Here is the book and here is the source code of most of the algorithms in the book.