473,657 Members | 2,316 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.exportKeyPr ivate() s.count('N')/float(len(s)) 0.0978818998716 3029 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 1911
In article <ma************ *************** ******@python.o rg>,
John Hunter <jd******@ace.b sd.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.ed u

"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
1185
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
1111
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 string that is empty instead of one that contains my message. The code is below with a few extra print statements and comments that hopefully make my problem clearer. Any help in getting it to work as expected is appreciated. System is Mac OS...
31
3367
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 customer subtypes: 1 - business, 2 - home, 3 - university
3
2319
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? My goal is to encrypt a nine-digit number so that it can be safely used as a student ID number.
0
1574
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". This MOSTLY works, however I am finding that not with all workstations. Does anyone know what kind of nuance might be involved here and how to avoid it? (I know it can be done because the CICS emulators on these same workstations are able to...
4
15218
by: pixel | last post by:
hi i just discovered something strange when i use in ProcessCmdKey this construction switch(keyData) { case Keys.Left: {
14
3452
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 list? I know that sets were introduced a lot later and lists/dictionaries were used instead but I think "the only correct way" now is for the dictionary keys and values to be sets. Presently {1:0,2:0,3:0}.keys() will produce but it could also...
2
3314
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 KeyDown event is fired, but not when I press a direction key. I want to see them in the KeyDown event so that I can respond as soon as the key is depressed, and I want to detect when the key is held down so that I can perform an action...
0
1189
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)' (http://tinyurl.com/47swaf) (4:15 5.86Mb 192kbps) *If I Ain't Got You 2004*
0
8411
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.