Pure crypto geekery

Adam Langley alangley at gmail.com
Fri Jun 10 14:14:22 UTC 2005


The DH prime used in Tor is taken from rfc2049, section 6.2 and is
claimed to equal:
2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }

Of course, one should always check this to make sure that it hasn't
been chosen by the NSA to have nasty properties.

Well, here's a python script to do it. It prints out the calculated
value next to the reference value:

Calculated value on the left, reference on the right

0xFFFFFFFFFFFFFFFFC90FDAA22168C2     0xFFFFFFFFFFFFFFFFC90FDAA22168C2
34C4C6628B80DC1CD129024E088A67CC     34C4C6628B80DC1CD129024E088A67CC
74020BBEA63B139B22514A08798E3404     74020BBEA63B139B22514A08798E3404
DDEF9519B3CD3A431B302B0A6DF25F14     DDEF9519B3CD3A431B302B0A6DF25F14
374FE1356D6D51C245E485B576625E7E     374FE1356D6D51C245E485B576625E7E
C6F44C42E9A637ED6B0BFF5CB6F406B7     C6F44C42E9A637ED6B0BFF5CB6F406B7
EDEE386BFB5A899FA5AE9F24117C4B1F     EDEE386BFB5A899FA5AE9F24117C4B1F
E649286651ECE65381FFFFFFFFFFFFFF     E649286651ECE65381FFFFFFFFFFFFFF
FFL                                  FFL                             


AGL

-- 
Adam Langley                                      agl at imperialviolet.org
http://www.imperialviolet.org                       (+44) (0)7906 332512
PGP: 9113   256A   CC0F   71A6   4C84   5087   CDA5   52DF   2CB6   3D60
-------------- next part --------------
A non-text attachment was scrubbed...
Name: safeprime.py
Type: text/x-python
Size: 2089 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-talk/attachments/20050610/2e285602/attachment.py>


More information about the tor-talk mailing list