How To Safely Generate A Random Number
Use urandom Use urandom . Use urandom . Use urandom . Use urandom . Use urandom . Use urandom . But what about for crypto keys? Still urandom . Why not {SecureRandom, OpenSSL, havaged, &c}? These are userspace CSPRNGs. You want to use the kernel’s CSPRNG, because: The kernel has access to raw device entropy. It can promise not to share the same state between applications. A good kernel CSPRNG, like FreeBSD’s, can also promise not to feed you random data before it’s seeded. Study the last ten years of random
评论
?
参与讨论