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.

最新文章

  1. Http请求
  2. 浅谈JDBC访问MySQL数据库
  3. C++学习笔记(3)
  4. Firebird数据库系统的开发团队
  5. Hive 一些便捷小查询
  6. java web 学习 --第一天(Java三级考试)
  7. NBU7.0.1迁移C:\Veritas\Netbackup\db到其他盘
  8. Linux 安装php
  9. 简单使用Junit
  10. Office2013版的破解之路
  11. 团体程序设计天梯赛-练习集L1-002. 打印沙漏
  12. QTP 11.05下载并完成+皴
  13. UE、UI、UCD、UED?职责划分?
  14. vue better-scroll用法
  15. electron-vue项目搭建
  16. 关于npm Vue
  17. 安卓工作室android studio 美化 ,设置背景图片。
  18. P2053 [SCOI2007]修车
  19. shiro实现动态权限管理
  20. Hystrix的回退和zuul的回退总结

热门文章

  1. nodejs 报错
  2. PyCharm使用技巧总结
  3. APKMirror - 直接下载google play里的应用
  4. 一篇文章理解JS数据类型、深拷贝和浅拷贝
  5. 【leetcode】447. Number of Boomerangs
  6. tensorflow函数介绍 (5)
  7. handy源码阅读(二):EventsImp类
  8. 4412 使用usb摄像头拍照YUYV格式
  9. web页面上传大文件有没有好的解决方案
  10. loj#500 「LibreOJ β Round」ZQC 的拼图