Use OpenSSL's RAND_bytes() instead of glibc's rand()

glibc's rand() is predictable. It is designed for speed, not for security. It should not be used in cryptographic.