A bunch of useful crypto functions.