Re: Equivalent of get_random_bytes?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thread-index: AceCvvsCOb3WuO6yEduE0AAWy4i6sA== Thread-topic: Equivalent of get_random_bytes? User-agent: Microsoft-Entourage/11.3.3.061214 I think this is what the poster had in mind: openssl rand -out foo.dat 1024 makes a file containing 1024 bytes You can also base64 it: openssl rand -base64 1024 | wc Also, see 'man rand' Paul Nelson Thursby Software Systems, Inc. on 4/19/07 2:45 PM, Michael Smith at msmith@freebsd.org wrote:
is there an equivalent for Linux' get_random_bytes (1) other than reading /dev/random on darwin?
If you are inside the kernel, the BSD symbolset exports read_random() in <sys/random.h>.
In userspace, just read from /dev/random.
= Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/nelson%40thursby.com
This email sent to nelson@thursby.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Paul Nelson