How To Generate Random Numbers In Linux

Generating random numbers can be seem odd. But it is very important for security. In security field whatever best chiper or algorithm you use if you can’t generate random numbers it is useless from point of view of security. So how can we generate random numbers in linux environment.

Generate With Urandom

First choise is to used /dev/urandom or /dev/random by using dd if=/dev/urandom of=/home/ismail/myrandom . But this random file will be binary.

Generate With Openssl

Second option is to use openssl which is core security library for a lot of application. openssl rand 256 command will generate 256 byte of random data with binary format. to generate more readable format like hex use -hex option openssl rand -hex 256