Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ezPyCrypto keys

Reply
Thread Tools

ezPyCrypto keys

 
 
John Hunter
Guest
Posts: n/a
 
      08-27-2003

I have been playing around with ezPyCrypto. I generated and printed a
key with

>>> import ezPyCrypto
>>> k = ezPyCrypto.key(204
>>> print k.exportKey()


I noticed there were a lot of N's and M's, too many to occur by chance

s=k.exportKeyPrivate()
>>> s.count('N')/float(len(s))

0.09788189987163029
>>> s.count('M')/float(len(s))

0.11

I quit python and restarted it and generated a new key and found the
same thing. Ditto when I exported the private key. I also found the
keys generated in the two sessions to be quite similar (35% characters
at a given position identical).

What's going on? Is it abnormal for so many of the characters in the
exported string to be the same? The machine I am running on is a
server that rarely has anyone logged in directly. Is this a problem
with not enough randomness in /dev/random?

Thanks for any suggestions,
John Hunter

ezPyCrypto-0.1.1
pycrypto-1.9a6
python2.2
mother:/var/tmp/ezPyCrypto-0.1.1> uname -a
Linux mother.paradise.lost 2.4.9 #7 Fri Oct 12 15:20:49 CDT 2001 i686
unknown


 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      08-27-2003
In article <(E-Mail Removed)>,
John Hunter <(E-Mail Removed)> writes:

[snip]

> What's going on? Is it abnormal for so many of the characters in the
> exported string to be the same? The machine I am running on is a
> server that rarely has anyone logged in directly. Is this a problem
> with not enough randomness in /dev/random?


As Heiko suggests, it's just the serialization protocol that is creating
this effect. ezPyCrypto keeps the key as a Python long, pickles it along
with other information, then base64-encodes the resulting string. The
pickled representation of a long doesn't contain the raw bytes; it
contains the string representation, so the pickle contains a lot of
decimal digits rather than a full 0-255 range of bytes. Naturally, this
representation has redundancy which is made more apparent by the
base64-encoding.

All 2048 bits of entropy should still be there.

> Thanks for any suggestions,
> John Hunter


--
Robert Kern
http://www.velocityreviews.com/forums/(E-Mail Removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ezPyCrypto jlocc@fau.edu Python 3 09-14-2005 08:54 PM
ezPyCrypto confusion scott Python 0 05-11-2005 04:00 PM
serial keys/validation keys sandeep Kanwal C++ 1 10-29-2004 06:36 PM
ezPyCrypto support AES? Bill Seitz Python 0 09-20-2004 01:53 PM
keyboard keys replacing mouse keys? larry Computer Support 8 09-14-2003 07:32 PM



Advertisments