Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gpg --gen-key not generate in raspberry B whith raspbian

213 views
Skip to first unread message

BIG Umberto

unread,
Jan 6, 2017, 12:58:02 PM1/6/17
to
Not generate the key.

Connected over ssh on oher PC with debian.

gpg --gen-key
gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection?
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <hein...@duesseldorf.de>"

Real name: tester
Email address: tes...@example.com
Comment: example
You selected this USER-ID:
"tester (example) <tes...@example.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.

You don't want a passphrase - this is probably a *bad* idea!
I will do it anyway. You can change your passphrase at any time,
using this program with the option "--edit-key".

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 263 more bytes)

At this time, pressed other 4000 key, move mouse, wait ten minutes, nothing!

The string "Not enough random bytes available. ... (Need 263 more bytes)" is
displayed after approx 2 seconds after "We need to generate a lot of random
bytes...".

What is wrong?

Adrian Caspersz

unread,
Jan 6, 2017, 2:17:51 PM1/6/17
to
On 06/01/17 17:58, BIG Umberto wrote:

> The string "Not enough random bytes available. ... (Need 263 more bytes)" is
> displayed after approx 2 seconds after "We need to generate a lot of random
> bytes...".
>
> What is wrong?
>

Have a read through
https://bugs.launchpad.net/ubuntu/+source/gnupg/+bug/706011

Can you use another machine for this?

--
Adrian C

BIG Umberto

unread,
Jan 7, 2017, 4:07:07 AM1/7/17
to
Adrian Caspersz in data 20:17, venerdì 06 gennaio 2017, nel gruppo
comp.sys.raspberry-pi ha scritto:

> On 06/01/17 17:58, BIG Umberto wrote:
>
>> The string "Not enough random bytes available. ... (Need 263 more bytes)" is
>> displayed after approx 2 seconds after "We need to generate a lot of random
>> bytes...".
>>
>> What is wrong?
>>
>
> Have a read through
> https://bugs.launchpad.net/ubuntu/+source/gnupg/+bug/706011

No-one work.
I not install rng-tools because is deprecated in theared.
Added a usb-mouse and move it but the problem is the same.

Have tested with an:
dd if=/dev/urandom of=/dev/null bs=1M count=120 &
before generate key, but... nothing!

I think the problems are:
Raspberry has not monitor, not keyboard and not mouse.
Raspberry start whithout a user login, but is connect only with ssh.


> Can you use another machine for this?
In other machine (debian lenny, and old gpg) work perfect and fast.

druck

unread,
Jan 7, 2017, 12:28:39 PM1/7/17
to
On 07/01/2017 09:07, BIG Umberto wrote:
> Adrian Caspersz in data 20:17, venerdì 06 gennaio 2017, nel gruppo
> comp.sys.raspberry-pi ha scritto:
>
>> On 06/01/17 17:58, BIG Umberto wrote:
>>
>>> The string "Not enough random bytes available. ... (Need 263 more bytes)" is
>>> displayed after approx 2 seconds after "We need to generate a lot of random
>>> bytes...".

> Have tested with an:
> dd if=/dev/urandom of=/dev/null bs=1M count=120 &
> before generate key, but... nothing!

Generating pseudo random bytes like that wont help it's just an
algorithmic sequence, what it is lacking is entropy - external randomness.

> I think the problems are:
> Raspberry has not monitor, not keyboard and not mouse.
> Raspberry start whithout a user login, but is connect only with ssh.

That is the problem, keyboard and mouse events are sources of external
randomness which it can use to see it's pseudo random number generator.
Without these the pseudo random numbers generated, and hence keys
derived from them, are entirely predicable.

> Can you use another machine for this?
> In other machine (debian lenny, and old gpg) work perfect and fast.

You can use another desktop machine, otherwise you do need to use the
built-in hardware random number generator with rng-tools.

---druck


Rob Morley

unread,
Jan 7, 2017, 2:25:57 PM1/7/17
to
On Sat, 7 Jan 2017 17:28:33 +0000
druck <ne...@druck.org.uk> wrote:

> That is the problem, keyboard and mouse events are sources of
> external randomness which it can use to seed its pseudo random number
> generator. Without these the pseudo random numbers generated, and
> hence keys derived from them, are entirely predicable.

I'd have thought just pinging localhost a lot very fast would increase
the entropy available.

Peter J. Holzer

unread,
Jan 8, 2017, 9:33:00 AM1/8/17
to
AFAIK the Linux kernel doesn't use network input as a source of
entropy, because it might be controlled by an attacker. (I don't think
this is a good decision: While it is true that an attacker might get the
system to overestimate the entropy available, it wastes a nice source of
entropy).

hp


--
_ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
|_|_) | | Man feilt solange an seinen Text um, bis
| | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel

I R A Darth Aggie

unread,
Jan 10, 2017, 10:46:22 AM1/10/17
to
On Sat, 07 Jan 2017 10:07:06 +0100,
BIG Umberto <nom...@nospam.invalid>, in
<o4qb3q$10t6$1...@gioia.aioe.org> wrote:
> Adrian Caspersz in data 20:17, venerdì 06 gennaio 2017, nel gruppo
> comp.sys.raspberry-pi ha scritto:
>
> > On 06/01/17 17:58, BIG Umberto wrote:
> >
> >> The string "Not enough random bytes available. ... (Need 263 more bytes)" is
> >> displayed after approx 2 seconds after "We need to generate a lot of random
> >> bytes...".
> >>
> >> What is wrong?
> >>
> >
> > Have a read through
> > https://bugs.launchpad.net/ubuntu/+source/gnupg/+bug/706011
>
> No-one work.
> I not install rng-tools because is deprecated in theared.
> Added a usb-mouse and move it but the problem is the same.

You may find the haveged package will do what you need.

https://packages.debian.org/sid/haveged

haveged is a userspace entropy daemon which is not dependent
upon the standard mechanisms for harvesting randomness for the
system entropy pool. This is important in systems with high
entropy needs or limited user interaction (e.g. headless
servers).

Also: http://www.irisa.fr/caps/projects/hipsor/ for some light reading.
And Arch Linux has pretty good docs, in this case about rng-tools, but
still some useful bits.

https://wiki.archlinux.org/index.php/Rng-tools

rngd allows the use of faster entropy sources, mainly hardware
random number generators (TRNG), present in modern hardware
like recent AMD/Intel processors, Via Nano or even Raspberry
Pi.

Ah, and after looking thru that page, that's how I found the haveged
package.

If your system does not have an available TRNG consider using
haveged instead.

--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.
0 new messages