Use crypto.randomBytes rather than using OpenSSL directly