linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: HIToC <hitoc_mail@yahoo.it>
To: Glynn Clements <glynn@gclements.plus.com>
Cc: Steve Graegert <graegerts@gmail.com>,
	linux-c-programming@vger.kernel.org
Subject: Re: How to use /dev/random
Date: Fri, 23 Sep 2005 18:31:35 +0200	[thread overview]
Message-ID: <200509231831.35430.hitoc_mail@yahoo.it> (raw)
In-Reply-To: <17204.8906.483808.168227@cerise.gclements.plus.com>

On Friday 23 September 2005 17:44, Glynn Clements wrote:
> HIToC wrote:
> > > You can also read a number of random bytes from /dev/(u)random with dd:
> > >
> > >         dd if=/dev/urandom of=/tmp/randnums bs=1 count=500
> > >
> > > This reads a sequence of 500 bytes from /dev/urandom and writes them
> > > to /tmp/randnums.
> >
> > I have read that the problem of /dev/random is mainly on boot, when there
> > are few iteration from the user. For this reason is useful first save on
> > a temporary_random file a 512 bytes block on shutdown of the system. Then
> > on the new booting, to put the 512 bytes saved on the
> > temporary_random file in the /dev/random device.
> > With this procedure we have the random device ready
> > afterwards boot.
> >
> > I have two questions:
> > 1) the size of /dev/random is 512 bytes, or the number of bytes
> > 	increase over the new iteration of the user (like mouse clicks,
> > 	key strokes, ecc..)?
>
> The size of the entropy pool is fixed at 512 bytes.
>
> > 2) Where can I put the scripts to read the random number on shutdown
> > 	or to write the previously saved bytes, on boot?
>
> Typically such scripts live in /etc/init.d. The format of the script
> needs to be compatible with your OS distribution. Look at existing
> scripts for clues. Most distributions already contain a suitable
> script (e.g. on Gentoo, it's /etc/init.d/urandom).
>
> There are a number of comments regarding saving and restoring entropy
> in drivers/char/random.c in the Linux kernel source code.

Thanks all for your useful help!!
-- 
With regards,


					HIToC
					hitoc_mail@yahoo.it

      reply	other threads:[~2005-09-23 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-22  9:11 How to use /dev/random HIToC
2005-09-22  9:42 ` Hagen Paul Pfeifer
2005-09-22  9:53 ` Steve Graegert
2005-09-23  9:16   ` HIToC
2005-09-23 15:44     ` Glynn Clements
2005-09-23 16:31       ` HIToC [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200509231831.35430.hitoc_mail@yahoo.it \
    --to=hitoc_mail@yahoo.it \
    --cc=glynn@gclements.plus.com \
    --cc=graegerts@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).