changed random generation from openssl to /dev/random/