473,505 Members | 13,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ezPyCrypto keys


I have been playing around with ezPyCrypto. I generated and printed a
key with
import ezPyCrypto
k = ezPyCrypto.key(2048)
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
Jul 18 '05 #1
1 1904
In article <ma*********************************@python.org> ,
John Hunter <jd******@ace.bsd.uchicago.edu> 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
ke**@caltech.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1175
by: Bill Seitz | last post by:
pyCrypto says it does, but nowhere in the ezPyCrypto docs do I see a reference to it, though I see other protocols specified.
0
1102
by: scott | last post by:
I am experimenting with ezPyCrypto ( http://www.freenet.org.nz/ezPyCrypto/ ). Having difficulty making the key portable (ie put in a file). I don't get an error message, I just recover a message...
31
3335
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
3
2315
by: jlocc | last post by:
Hi!! I finally decided to use ezPyCrypto for my project but I can't download it from http://www.freenet.org.nz/ezPyCrypto/ ... Does anyone know of a different mirror? Maybe a similar wrapper?...
0
1572
by: OC | last post by:
Because of the requirements on a high-speed data entry form, I need to reliably trap certain keys (specifically the "/", "*", "-", and "+") keys on the 10-key pad and treat them as "Function keys"....
4
15211
by: pixel | last post by:
hi i just discovered something strange when i use in ProcessCmdKey this construction switch(keyData) { case Keys.Left: {
14
3437
by: vatamane | last post by:
This has been bothering me for a while. Just want to find out if it just me or perhaps others have thought of this too: Why shouldn't the keyset of a dictionary be represented as a set instead of a...
2
3304
by: Charles Law | last post by:
I'll kick myself when you tell me, but ... I have a user control on a form, and I want the user control to see the arrow keys when I press them. If I press just about any other key the control's...
0
1186
by: Menlalen | last post by:
K E Y S , A L I C I A M P 3 D O W N L O A D *Fallin 2001* 'Keys, Alicia - Fallin' (http://tinyurl.com/4zg3sr) (3:30 4.82Mb 192kbps) 'Keys, Alicia - Fallin (ft BustaRhymes and Rampage)'...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.