summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2008q3/000020.html
blob: ad79b038db14e1eddef7aa1713032ac82c0cfe96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [pycrypto] RandomPool is now deprecated
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20RandomPool%20is%20now%20deprecated&In-Reply-To=">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000013.html">
   
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[pycrypto] RandomPool is now deprecated</H1>
    <B>Dwayne C. Litzenberger</B> 
    <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=%5Bpycrypto%5D%20RandomPool%20is%20now%20deprecated&In-Reply-To="
       TITLE="[pycrypto] RandomPool is now deprecated">dlitz at dlitz.net
       </A><BR>
    <I>Wed Sep 17 22:23:58 CST 2008</I>
    <P><UL>
        <LI>Previous message: <A HREF="000013.html">[pycrypto] Bug in Crypto.PublicKey.RSA?
</A></li>
        
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#20">[ date ]</a>
              <a href="thread.html#20">[ thread ]</a>
              <a href="subject.html#20">[ subject ]</a>
              <a href="author.html#20">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>At long last, using RandomPool now results in a DeprecationWarning.  The 
recommended way to get random bytes in new programs is to do something like 
this:

     from Crypto import Random
     ...
     rng = Random.new()      # rng is a file-like object
     ...
     data = rng.read(32)

This is okay too:

     from Crypto import Random
     ...
     data = Random.new().read(32)

If you need a drop-in replacement for old code that uses the RandomPool 
interface, you can replace this:

     from Crypto.Util.randpool import RandomPool

with this:

     from Crypto.Random import RandomPoolCompat as RandomPool

The new code will be included in the next release of PyCrypto, and is 
currently available in the git repository[1].  Please let me know if you 
find any problems.

On POSIX systems (where os.name == &quot;posix&quot;), we currently just read from 
/dev/urandom.  That should work well enough on the free *nix platforms 
(Linux, modern BSDs, etc.), but please let me know if there are any systems 
with bad /dev/urandom devices.

Cheers,
  - Dwayne

[1] <A HREF="git://git.pycrypto.org:9419/crypto/pycrypto-2.0.x.git">git://git.pycrypto.org:9419/crypto/pycrypto-2.0.x.git</A>
     <A HREF="http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.0.x.git">http://gitweb.pycrypto.org/?p=crypto/pycrypto-2.0.x.git</A>
     latest commit-id: 2d3846eefd728d6cf9fd9aa9f8e94d1a77107908

-- 
Dwayne C. Litzenberger &lt;<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">dlitz at dlitz.net</A>&gt;
  Key-signing key   - 19E1 1FE8 B3CF F273 ED17  4A24 928C EC13 39C2 5CF7
  Annual key (2008) - 4B2A FD82 FC7D 9E38 38D9  179F 1C11 B877 E780 4B45
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : <A HREF="http://lists.dlitz.net/pipermail/pycrypto/attachments/20080918/9f1e0a6c/attachment.pgp">http://lists.dlitz.net/pipermail/pycrypto/attachments/20080918/9f1e0a6c/attachment.pgp</A> 
</PRE>

<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000013.html">[pycrypto] Bug in Crypto.PublicKey.RSA?
</A></li>
	
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#20">[ date ]</a>
              <a href="thread.html#20">[ thread ]</a>
              <a href="subject.html#20">[ subject ]</a>
              <a href="author.html#20">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">More information about the pycrypto
mailing list</a><br>
</body></html>