zoukankan      html  css  js  c++  java
  • /dev/random vs /dev/urandom

    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.
  • 相关阅读:
    表单序列化
    创建.ignore文件
    头条数学救火队长马丁的一道中山大学研究生入学考试数学分析题
    实数理论
    方法
    目标
    闭区间有限覆盖定理
    零值定理的确界原理证明方法,来自百度
    各种范例
    零值定理
  • 原文地址:https://www.cnblogs.com/bittorrent/p/4083581.html
Copyright © 2011-2022 走看看