Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: nssec-keygen slowness
PostPosted: Tue Dec 21, 2010 9:50 am 
Offline
Newbie

Joined: Tue Dec 21, 2010 9:39 am
Posts: 3
Hi!

I am generating the following key through nssec-keygen (CentOS 32 bit):
dnssec-keygen -a HMAC-MD5 -b 256 -n HOST mykey

Having tested this throughout the day, most of the time this takes many minutes, but every once and again it is created immediately.

Is this time lag expected from a Cloud service like Linode?

Thanks!


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 10:59 am 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Sounds to me like you're running out of entropy.

Run this ...
Code:
watch -n1 cat /proc/sys/kernel/random/entropy_avail

... while you attempt your keygen.

-Chris


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 11:28 am 
Offline
Newbie

Joined: Tue Dec 21, 2010 9:39 am
Posts: 3
Quote:
watch -n1 cat /proc/sys/kernel/random/entropy_avail


Goes from 128 - 191 while NOT running keygen.
Goes from 6 - 59 while running keygen.

On my colocated server I see that it is over 3500 when not running keygen.

So are these numbers typical for the smallest Linode?
Are the numbers affected by the processing power of the given node, or the cloud setup itself?

Thanks! :)


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 2:09 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
Entropy comes from "random" events (like keyboard and mouse events) that the kernel uses to stir up the random generator sequence. On a server, there is very little randomness available to the kernel, and on a VPS it is even worse.

Most people just switch things to use /dev/urandom so that the key generation won't wait for "high quality" randomness. Otherwise you just need to wait it out or generate your keys somewhere besides your linode.


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 4:27 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
I believe adding "-r /dev/urandom" would solve your problem, as would "-r keyboard" (which will get the random entropy from your keyboard input).

Personally, I'd use /dev/urandom and move on.


Top
   
 Post subject:
PostPosted: Tue Dec 21, 2010 4:50 pm 
Offline
Newbie

Joined: Tue Dec 21, 2010 9:39 am
Posts: 3
Choosing the /dev/urandom is instantanious; will keep that in mind the next time:

./dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 256 -n HOST mykey

By now I have gotten a random based key, but thanks to all for feedback. Good to learn something new! :-)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: sjnorton and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group