Use crypto.randomBytes() for key generation

Definitely a nit but there is no reason to loop over `Math.random`.