rotor alternative?

Bengt Richter bokr at oz.net
Thu Nov 20 20:15:56 CET 2003


On 20 Nov 2003 18:25:29 GMT, bokr at oz.net (Bengt Richter) wrote:

>On 18 Nov 2003 11:05:04 -0800, Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:
>
>>Robin Becker <robin at jessikat.fsnet.co.uk> writes:
>>> It seems that the rotor module is being deprecated in 2.3, but there
>>> doesn't seem to be an obvious alternative. I'm using it just for
>>> obfuscation. It seems we have ssl available in 2.3 for sockets, but
>>> there seems no obvious way to use that from python code.
>>> 
>>> Is an alternative to rotor planned? 
>>
>>Yes, Python should get some real encryption functions sooner or later.
>>Meanwhile here's something you can use:
>>
>>  http://www.nightsong.com/phr/crypto/p3.py
>
>Just noticed your using time.time.
>
>I believe clock has more bits than time, at least on windows:
>
> >>> from time import time,clock
> >>> min([abs(time()-time()) for i in xrange(1000)])
> 0.0
> >>> min([abs(time()-time()) for i in xrange(1000)])
> 0.0
> >>> min([abs(clock()-clock()) for i in xrange(1000)])
> 5.8666657726975935e-006
> >>> min([abs(clock()-clock()) for i in xrange(1000)])
> 5.866665771847579e-006
> >>> min([abs(clock()-clock()) for i in xrange(1000)])
> 5.866665771847579e-006
>
>I don't know if it's worth anything, but the change would be easy ;-)
>
Better, if you have a faster machine:

 >>> from time import time,clock
 >>> min(filter(None,[abs(time()-time()) for i in xrange(100000)]))
 0.0099999904632568359
 >>> min(filter(None,[abs(clock()-clock()) for i in xrange(100000)]))
 5.8666657594130811e-006

time() seems to be getting the basic NT4 scheduling slice time on my box.

Regards,
Bengt Richter




More information about the Python-list mailing list