/Dev/random vs/dev/urandom

Source: Internet
Author: User

If you want random data in a Linux/Unix type OS, the standard way to do so is to use/dev/random or/dev/urandom. these devices are special files. they can be read like normal files and the read data is generated via multiple sources of entropy in the system which provide the randomness.

/Dev/random will block after the entropy pool is exhausted. It will remain blocked until additional data has been collected from the sources of entropy that are available. This can slow down random data generation.

/Dev/urandom will not block. Instead it will reuse the internal pool to produce more pseudo-random bits.

/Dev/urandom is best used when:

  • You just want a large file with random data for some kind of testing.
  • You are using the dd command to wipe data off a disk by replacing it with random data.
  • Almost everywhere else where you don't have a really good reason to use/dev/random instead.

/Dev/random is likely to be the better choice when:

  • Randomness is critical to the security of cryptography in your application-one-time pads, key generation.

/Dev/random vs/dev/urandom

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.