Book typo fix: Comment should say 'while' instead of 'until'.
Book typo fix: Comments should say that the block size needs to be LESS than the key size.
Book typo fix: generateRandomKey() was not testing for relative primeness.