Just use RAND_bytes() for generating random bytes