summaryrefslogtreecommitdiff
path: root/pipermail/pycrypto/2012q3.txt
blob: cd58c53370361a63606f9053bbd0908ce5a4f378 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
From randy.eastland at gmail.com  Sun Jul  8 02:45:27 2012
From: randy.eastland at gmail.com (Randy Eastland)
Date: Sun, 8 Jul 2012 00:45:27 -0600
Subject: [pycrypto] Unrecognized command line option '-mno-cygwin'
Message-ID: <000001cd5cd5$432a0870$c97e1950$@gmail.com>

I'm trying to build the pycrypto libarary. I browse to the folder where my
files are extracted an type 'make'. Things progress along just fine for
quite a few minutes when suddenly I get this error and the process halts:

 

Cc1.exe: error: unrecognized command line option '-mno-cygwin'

Error: command 'gcc' failed with exit status 1

 

I'm working in MinGW (not cygwin). Can anybody suggest how to fix this?
Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20120708/07972543/attachment.html>

From gooksankoo at hoiptorrow.mailexpire.com  Sun Jul  8 06:02:42 2012
From: gooksankoo at hoiptorrow.mailexpire.com (Legrandin)
Date: Sun, 8 Jul 2012 12:02:42 +0200
Subject: [pycrypto] Unrecognized command line option '-mno-cygwin'
In-Reply-To: <000001cd5cd5$432a0870$c97e1950$@gmail.com>
References: <000001cd5cd5$432a0870$c97e1950$@gmail.com>
Message-ID: <CAGfyce2PDLD2VF-A9VR22nZqX4rfbHosxcLkc3Znpko8vHf35w@mail.gmail.com>

> I?m trying to build the pycrypto libarary. I browse to the folder where my
> files are extracted an type ?make?. Things progress along just fine for
> quite a few minutes when suddenly I get this error and the process halts:*
> ***
>
> ** **
>
> Cc1.exe: error: unrecognized command line option '-mno-cygwin'****
>
> Error: command ?gcc? failed with exit status 1****
>
> ** **
>
> I?m working in MinGW (not cygwin). Can anybody suggest how to fix this?
> Thanks.
>

It is a known issue of distutils.

Edit C:\Python2.7.1\Lib\distutils\cygwincompiler.py and remove
'-mno-cygwin' everywhere.

See here:

http://www.secker.nl/2012/03/08/setup-python-2-7-2-and-mingw-on-windows-xp/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20120708/32692e65/attachment.html>

From yaronf.ietf at gmail.com  Mon Jul  9 02:38:11 2012
From: yaronf.ietf at gmail.com (Yaron Sheffer)
Date: Mon, 09 Jul 2012 09:38:11 +0300
Subject: [pycrypto] PyCrypto ElGamal code questions/comments
Message-ID: <4FFA7C53.2090306@gmail.com>

Hi,

I've been going over the code and I have a few questions. I realize that 
only few people are using this code, but hey, if it's good enough for a 
recent CVE :-)

  * The documentation of "generate" says that randfunc returns X random
    bytes. I think this should be bits.
  * The "generate" function is way too conservative. We construct p as
    2*q+1, where both p and q are prime. This makes p a classic "safe
    prime". It also makes two of the checks redundant: g cannot divide
    p-1, because only 2 and q divide it. g cannot be 2, and most likely
    will not be q during the lifetime of the universe. I believe that
    similarly, g**-1 cannot divide p-1, but my algebra skills are too
    rusty to prove it.
  * For the same reasons, there is no need for the loop when
    constructing K (the secret parameter), e.g. on line #342. You just
    need to ensure that it is an odd number, otherwise its GCD with p-1
    would be 2. So choose a random t, 2 < t < q-1, and let K=2*t+1. No
    need for a loop or for the GCD calculation.
  * An important check is missing: the message M needs to be less than
    p, both when signing and certainly when encrypting it.

Thanks,

     Yaron


From anil.philip at motorolasolutions.com  Thu Jul 12 12:15:15 2012
From: anil.philip at motorolasolutions.com (Philip Anil-QBW348)
Date: Thu, 12 Jul 2012 16:15:15 +0000
Subject: [pycrypto] problems with testing PyCrypto Module
In-Reply-To: <DD2926DBB985EB40ADF6462A09062EE508EFEBD9@SN2PRD0410MB359.namprd04.prod.outlook.com>
References: <DD2926DBB985EB40ADF6462A09062EE508EF8096@CH1PRD0410MB357.namprd04.prod.outlook.com>
 <DD2926DBB985EB40ADF6462A09062EE508EF849D@CH1PRD0410MB357.namprd04.prod.outlook.com>
 <DD2926DBB985EB40ADF6462A09062EE508EF84D0@CH1PRD0410MB357.namprd04.prod.outlook.com>
 <F08FBCAD-72C7-45E3-A57D-D91284AAB249@dell.com>
 <DD2926DBB985EB40ADF6462A09062EE508EFA6BA@SN2PRD0410MB359.namprd04.prod.outlook.com>
 <4FEC5A11.7010301@ramacher.at>
 <DD2926DBB985EB40ADF6462A09062EE508EFEBD9@SN2PRD0410MB359.namprd04.prod.outlook.com>
Message-ID: <DD2926DBB985EB40ADF6462A09062EE508F24CC0@SN2PRD0410MB359.namprd04.prod.outlook.com>

With help from the mpir dev list, I built mpir.lib
Do you know where I should put it in pycrypto-2.6 ?
I ask because they are all python files so it is not clear where I should drop in a lib file.

-----Original Message-----
From: pycrypto-bounces at lists.dlitz.net [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of Philip Anil-QBW348
Sent: Friday, June 29, 2012 10:20 AM
To: PyCrypto discussion list
Subject: Re: [pycrypto] problems with testing PyCrypto Module

Thank you for replying. I am wondering whether to build and install the C++ mpir lib http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/
Will that fix the issue? But I am not sure which lib folder I should drop the static lib into, since they all contain python scripts only - not libs.


-----Original Message-----
From: pycrypto-bounces at lists.dlitz.net [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of Sebastian Ramacher
Sent: Thursday, June 28, 2012 8:20 AM
To: pycrypto at lists.dlitz.net
Subject: Re: [pycrypto] problems with testing PyCrypto Module

On 28/06/12 15:17, Philip Anil-QBW348 wrote:
> But what about the errors - anyone have any suggestions?

That's a known issue: https://bugs.launchpad.net/pycrypto/+bug/1004781

Kind regards
_______________________________________________
pycrypto mailing list
pycrypto at lists.dlitz.net
http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto





_______________________________________________
pycrypto mailing list
pycrypto at lists.dlitz.net
http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto






From anil.philip at motorolasolutions.com  Fri Jul 13 17:32:24 2012
From: anil.philip at motorolasolutions.com (Philip Anil-QBW348)
Date: Fri, 13 Jul 2012 21:32:24 +0000
Subject: [pycrypto] problems with testing PyCrypto Module
In-Reply-To: <DD2926DBB985EB40ADF6462A09062EE508F24CC0@SN2PRD0410MB359.namprd04.prod.outlook.com>
References: <DD2926DBB985EB40ADF6462A09062EE508EF8096@CH1PRD0410MB357.namprd04.prod.outlook.com>
 <DD2926DBB985EB40ADF6462A09062EE508EF849D@CH1PRD0410MB357.namprd04.prod.outlook.com>
 <DD2926DBB985EB40ADF6462A09062EE508EF84D0@CH1PRD0410MB357.namprd04.prod.outlook.com>
 <F08FBCAD-72C7-45E3-A57D-D91284AAB249@dell.com>
 <DD2926DBB985EB40ADF6462A09062EE508EFA6BA@SN2PRD0410MB359.namprd04.prod.outlook.com>
 <4FEC5A11.7010301@ramacher.at>
 <DD2926DBB985EB40ADF6462A09062EE508EFEBD9@SN2PRD0410MB359.namprd04.prod.outlook.com>
 <DD2926DBB985EB40ADF6462A09062EE508F24CC0@SN2PRD0410MB359.namprd04.prod.outlook.com>
Message-ID: <DD2926DBB985EB40ADF6462A09062EE508F25E2A@SN2PRD0410MB359.namprd04.prod.outlook.com>

D:\Cryptolibrary\pycrypto-2.6>python setup.py build
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

even after editing config.h to Case's thread:

/* Define to 1 if you have the declaration of `mpz_powm', and to 0 if you 
   don't. */ 
#define HAVE_DECL_MPZ_POWM 1 

/* Define to 1 if you have the declaration of `mpz_powm_sec', and to 0 if you 
   don't. */ 
#define HAVE_DECL_MPZ_POWM_SEC 0 

/* Define to 1 if you have the `gmp' library (-lgmp). */ 
#undef HAVE_LIBGMP 

/* Define to 1 if you have the `mpir' library (-lmpir). */ 
#define HAVE_LIBMPIR 1 

/* Define to 1 if you have the <stdint.h> header file. */ 
#define HAVE_STDINT_H 1

Anil

-----Original Message-----
From: pycrypto [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of Philip Anil-QBW348
Sent: Thursday, July 12, 2012 11:15 AM
To: PyCrypto discussion list
Subject: Re: [pycrypto] problems with testing PyCrypto Module

With help from the mpir dev list, I built mpir.lib
Do you know where I should put it in pycrypto-2.6 ?
I ask because they are all python files so it is not clear where I should drop in a lib file.

-----Original Message-----
From: pycrypto-bounces at lists.dlitz.net [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of Philip Anil-QBW348
Sent: Friday, June 29, 2012 10:20 AM
To: PyCrypto discussion list
Subject: Re: [pycrypto] problems with testing PyCrypto Module

Thank you for replying. I am wondering whether to build and install the C++ mpir lib http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/
Will that fix the issue? But I am not sure which lib folder I should drop the static lib into, since they all contain python scripts only - not libs.


-----Original Message-----
From: pycrypto-bounces at lists.dlitz.net [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of Sebastian Ramacher
Sent: Thursday, June 28, 2012 8:20 AM
To: pycrypto at lists.dlitz.net
Subject: Re: [pycrypto] problems with testing PyCrypto Module

On 28/06/12 15:17, Philip Anil-QBW348 wrote:
> But what about the errors - anyone have any suggestions?

That's a known issue: https://bugs.launchpad.net/pycrypto/+bug/1004781

Kind regards
_______________________________________________
pycrypto mailing list
pycrypto at lists.dlitz.net
http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto





_______________________________________________
pycrypto mailing list
pycrypto at lists.dlitz.net
http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto





_______________________________________________
pycrypto mailing list
pycrypto at lists.dlitz.net
http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto






From campadrenalin at gmail.com  Thu Jul 26 21:05:56 2012
From: campadrenalin at gmail.com (Philip Horger)
Date: Thu, 26 Jul 2012 18:05:56 -0700
Subject: [pycrypto] RSA output on long inputs can sometimes be gibberish
Message-ID: <CAHAkNZ3WBEBgMnDnPX6wKAxubE3EG9d94yBfizc=FRyKAq+22Q@mail.gmail.com>

I'm working on a project that includes a wrapper for cryptographic
encoding, which lets you express an "encryptor" as a JSON list. Of
course, this kinda hinges on the underlying cryptography code working,
and since I'm the sort of person who likes cryptographic privacy but
doesn't have an expert grasp on it, I make good use of my PyCrypto
dependency.

However, I *am* having issues regarding the RSA encryptor which delve
beyond my ken, and which may or may not indicate problems with the
underlying PyCrypto implementation. I wrote some test code and created
a bug report in my project:

https://github.com/campadrenalin/EJTP-lib-python/issues/9

The test involves the reversibility of the RSA process, using the
decrypt function on raw input as a bit of a hack to encrypt with the
private key (such that the public key can be used to decrypt it). This
matches the real-world functionality it will be used for, where data
at the innermost layer of encryption will be encrypted with the
sender's private key. This may seem silly, but it both acts as an
obfuscation and saves bandwidth (by accomplishing the intention of a
signature without the network overhead).

If sending raw data through the decrypt function is the problem, as I
suspect, then I can change the EJTP protocol to use proper signatures,
that's no biggy. But if this reveals problems in PyCrypto... I figured
you guys would want to know.

Anyways, my social anxiety and procrastination have delayed me from
this for long enough. Thank you for your time, and for PyCrypto being
excellent.

From sebastian+lists at ramacher.at  Fri Jul 27 06:15:58 2012
From: sebastian+lists at ramacher.at (Sebastian Ramacher)
Date: Fri, 27 Jul 2012 12:15:58 +0200
Subject: [pycrypto] RSA output on long inputs can sometimes be gibberish
In-Reply-To: <CAHAkNZ3WBEBgMnDnPX6wKAxubE3EG9d94yBfizc=FRyKAq+22Q@mail.gmail.com>
References: <CAHAkNZ3WBEBgMnDnPX6wKAxubE3EG9d94yBfizc=FRyKAq+22Q@mail.gmail.com>
Message-ID: <50126A5E.2050407@ramacher.at>

Running the tests fails most of the time with:

$ python -m ejtp.rsatest
key1 >> key2
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/EJTP-lib-python/ejtp/rsatest.py", line 33, in <module>
    test_run(key1, key2)
  File "/tmp/EJTP-lib-python/ejtp/rsatest.py", line 27, in test_run
    ciphertext = encode(plaintext, key1, key2)
  File "/tmp/EJTP-lib-python/ejtp/rsatest.py", line 19, in encode
    return reciever.encrypt(sender.decrypt(msg))
  File "ejtp/util/crypto/rsa.py", line 44, in encrypt
    value[marker:marker+self.blocksize], "")[0])
  File "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/RSA.py", line 150, in
encrypt
    return pubkey.pubkey.encrypt(self, plaintext, K)
  File "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.py", line 75,
in encrypt
    ciphertext=self._encrypt(plaintext, K)
  File "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/RSA.py", line 224, in
_encrypt
    return (self.key._encrypt(c),)
ValueError: Plaintext too large

The code in ejtp/util/crypto/rsa.py looks like you're not doing proper padding
and using fixed sized blocks that don't depend on the key parameters. That won't
work.

You might want to have a look at PKCS#1 OAEP and pycrypto's
Crypto.Cipher.PKCS1_OAEP module [1].

Kind regards

[1]
https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.PKCS1_OAEP-module.html

From campadrenalin at gmail.com  Fri Jul 27 12:19:48 2012
From: campadrenalin at gmail.com (Philip Horger)
Date: Fri, 27 Jul 2012 09:19:48 -0700
Subject: [pycrypto] RSA output on long inputs can sometimes be gibberish
In-Reply-To: <50126A5E.2050407@ramacher.at>
References: <CAHAkNZ3WBEBgMnDnPX6wKAxubE3EG9d94yBfizc=FRyKAq+22Q@mail.gmail.com>
 <50126A5E.2050407@ramacher.at>
Message-ID: <CAHAkNZ2Ffc9kbT2EXqyD1Y5EnFvfy6KCRwkKK5uHBowE9ciqJw@mail.gmail.com>

Fantastic! Thank you very much, this sounds like exactly what I was looking
for!

On Fri, Jul 27, 2012 at 3:15 AM, Sebastian Ramacher <
sebastian+lists at ramacher.at> wrote:

> Running the tests fails most of the time with:
>
> $ python -m ejtp.rsatest
> key1 >> key2
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
>     "__main__", fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
>     exec code in run_globals
>   File "/tmp/EJTP-lib-python/ejtp/rsatest.py", line 33, in <module>
>     test_run(key1, key2)
>   File "/tmp/EJTP-lib-python/ejtp/rsatest.py", line 27, in test_run
>     ciphertext = encode(plaintext, key1, key2)
>   File "/tmp/EJTP-lib-python/ejtp/rsatest.py", line 19, in encode
>     return reciever.encrypt(sender.decrypt(msg))
>   File "ejtp/util/crypto/rsa.py", line 44, in encrypt
>     value[marker:marker+self.blocksize], "")[0])
>   File "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/RSA.py", line
> 150, in
> encrypt
>     return pubkey.pubkey.encrypt(self, plaintext, K)
>   File "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/pubkey.py", line
> 75,
> in encrypt
>     ciphertext=self._encrypt(plaintext, K)
>   File "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/RSA.py", line
> 224, in
> _encrypt
>     return (self.key._encrypt(c),)
> ValueError: Plaintext too large
>
> The code in ejtp/util/crypto/rsa.py looks like you're not doing proper
> padding
> and using fixed sized blocks that don't depend on the key parameters. That
> won't
> work.
>
> You might want to have a look at PKCS#1 OAEP and pycrypto's
> Crypto.Cipher.PKCS1_OAEP module [1].
>
> Kind regards
>
> [1]
>
> https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.PKCS1_OAEP-module.html
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20120727/d0dc0285/attachment.html>

From gooksankoo at hoiptorrow.mailexpire.com  Sun Aug  5 09:55:25 2012
From: gooksankoo at hoiptorrow.mailexpire.com (Legrandin)
Date: Sun, 5 Aug 2012 15:55:25 +0200
Subject: [pycrypto] PyCrypto ElGamal code questions/comments
In-Reply-To: <4FFA7C53.2090306@gmail.com>
References: <4FFA7C53.2090306@gmail.com>
Message-ID: <CAGfyce3E8CeMkYVmJeigFu5fig+6ZnidMFM3aD4SQ=yYW6836w@mail.gmail.com>

Hi Yaron,

Some comments inline:


>  * The documentation of "generate" says that randfunc returns X random
>    bytes. I think this should be bits.
>

I am not 100% sure, but a common idiom in pycrypto is:

"
if randfunc is None:
     randfunc = Random.new().read
"

so randfunc(N) returns N bytes of full entropy.

 * The "generate" function is way too conservative. We construct p as
>    2*q+1, where both p and q are prime. This makes p a classic "safe
>    prime". It also makes two of the checks redundant: g cannot divide
>    p-1, because only 2 and q divide it. g cannot be 2, and most likely
>    will not be q during the lifetime of the universe. I believe that
>    similarly, g**-1 cannot divide p-1, but my algebra skills are too
>    rusty to prove it.
>

I contributed to that part with a patch. My intention was actually to list
in the loop
as many criteria as possible that a generator safe for both Elgamal
encryption and Elgamal signatures (because .generate() does not know how
the key will be used) must fulfill.

It's true they are redundant in practice, but I think it's good to leave a
track behind with the general conditions that one must check, regardless of
how the domain parameters are computed.

 * For the same reasons, there is no need for the loop when
>    constructing K (the secret parameter), e.g. on line #342. You just
>    need to ensure that it is an odd number, otherwise its GCD with p-1
>    would be 2. So choose a random t, 2 < t < q-1, and let K=2*t+1. No
>    need for a loop or for the GCD calculation.
>

In the _sign() method I see only a loop to ensure that residues remains in
the range 0..p-1. The loop does not contribute to GDC computation.


>  * An important check is missing: the message M needs to be less than
>    p, both when signing and certainly when encrypting it.
>

True. Note that M must not the message when signing with PyCrypto's
Elgamal. It must be really be the cryptographic hash of the message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20120805/4792d29c/attachment.html>

From ajabberwok at gmail.com  Wed Sep  5 11:02:11 2012
From: ajabberwok at gmail.com (Mike Anderson)
Date: Wed, 5 Sep 2012 10:02:11 -0500
Subject: [pycrypto] vcvarsall.bat?
Message-ID: <CA+UwFj19+QzDoPP9nfAOfjz+AXcWGirwZ7Nqs3OTokkqrAYLTQ@mail.gmail.com>

I just tried to install pycrypto on windows and saw this error:

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
error: Unable to find vcvarsall.bat


I didn't see this mentioned in the readme file, so I'm asking here.

Is there some software dependencies that pycrypto has?

Mike

From sebastian+lists at ramacher.at  Wed Sep  5 11:28:30 2012
From: sebastian+lists at ramacher.at (Sebastian Ramacher)
Date: Wed, 05 Sep 2012 17:28:30 +0200
Subject: [pycrypto] vcvarsall.bat?
In-Reply-To: <CA+UwFj19+QzDoPP9nfAOfjz+AXcWGirwZ7Nqs3OTokkqrAYLTQ@mail.gmail.com>
References: <CA+UwFj19+QzDoPP9nfAOfjz+AXcWGirwZ7Nqs3OTokkqrAYLTQ@mail.gmail.com>
Message-ID: <50476F9E.3090108@ramacher.at>

On 05/09/12 17:02, Mike Anderson wrote:
> I just tried to install pycrypto on windows and saw this error:
> 
> warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
> error: Unable to find vcvarsall.bat
> 
> 
> I didn't see this mentioned in the readme file, so I'm asking here.
> 
> Is there some software dependencies that pycrypto has?

Looks like you're facing the problem described at [1].

Kind regards

[1] http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

From ajabberwok at gmail.com  Wed Sep  5 12:31:31 2012
From: ajabberwok at gmail.com (Mike Anderson)
Date: Wed, 5 Sep 2012 11:31:31 -0500
Subject: [pycrypto] vcvarsall.bat?
Message-ID: <CA+UwFj2OsBAnqNPZubayLHziHNMCfZ9bJQ4frhi6w6S55B=9=g@mail.gmail.com>

> Looks like you're facing the problem described at [1].
> Kind regards
> [1] http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

So I have to install something called "mingw32" in order to install
pycrypto on windows, correct?

From sebastian+lists at ramacher.at  Wed Sep  5 12:39:33 2012
From: sebastian+lists at ramacher.at (Sebastian Ramacher)
Date: Wed, 05 Sep 2012 18:39:33 +0200
Subject: [pycrypto] vcvarsall.bat?
In-Reply-To: <CA+UwFj2OsBAnqNPZubayLHziHNMCfZ9bJQ4frhi6w6S55B=9=g@mail.gmail.com>
References: <CA+UwFj2OsBAnqNPZubayLHziHNMCfZ9bJQ4frhi6w6S55B=9=g@mail.gmail.com>
Message-ID: <50478045.8080601@ramacher.at>

On 05/09/12 18:31, Mike Anderson wrote:
> So I have to install something called "mingw32" in order to install
> pycrypto on windows, correct?

You need a C compiler. Visual Studio is also an option. There was a free version
around some years ago. I don't know if that's still the case.

From dmacinskas at geobridge.net  Wed Sep  5 12:46:58 2012
From: dmacinskas at geobridge.net (Dean Macinskas)
Date: Wed, 5 Sep 2012 12:46:58 -0400
Subject: [pycrypto] vcvarsall.bat?
In-Reply-To: <50478045.8080601@ramacher.at>
References: <CA+UwFj2OsBAnqNPZubayLHziHNMCfZ9bJQ4frhi6w6S55B=9=g@mail.gmail.com>
 <50478045.8080601@ramacher.at>
Message-ID: <8129C8D99AA86D4A9A8BEA3E7DCC806A71EB531B86@exch-mail.bridge.net>

Better, just install a pre-compiled version.  Here's a bunch: http://www.python.org/getit/

-----Original Message-----
From: pycrypto [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of Sebastian Ramacher
Sent: Wednesday, September 05, 2012 12:40 PM
To: pycrypto at lists.dlitz.net
Subject: Re: [pycrypto] vcvarsall.bat?

On 05/09/12 18:31, Mike Anderson wrote:
> So I have to install something called "mingw32" in order to install 
> pycrypto on windows, correct?

You need a C compiler. Visual Studio is also an option. There was a free version around some years ago. I don't know if that's still the case.
_______________________________________________
pycrypto mailing list
pycrypto at lists.dlitz.net
http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto

From ajabberwok at gmail.com  Wed Sep  5 12:48:42 2012
From: ajabberwok at gmail.com (Mike Anderson)
Date: Wed, 5 Sep 2012 11:48:42 -0500
Subject: [pycrypto] chmod error in Windows 7, when trying to install
Message-ID: <CA+UwFj3jKkP4P0T9os01VbXwF2RPn8f+zFTTHxjuDczPomiU2w@mail.gmail.com>

I'm using Windows 7 Ultimate, and trying to install pycrypto, but
getting an error "'chmod' is not recognized as an internal or external
command."

It happens like so:
> pip install ssh
   ...
copying lib\Crypto\Signature\__init__.py -> build\lib.win32-2.7\Crypto\Signature


running build_ext

running build_configure

'chmod' is not recognized as an internal or external command,

operable program or batch file.

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\Users\killer\build\pycrypto\setup.py", line 456, in <module>

    core.setup(**kw)

  File "C:\Python27\lib\distutils\core.py", line 152, in setup

    dist.run_commands()

  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 53, i
n run

    return _install.run(self)

  File "C:\Python27\lib\distutils\command\install.py", line 563, in run

    self.run_command('build')

  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Python27\lib\distutils\command\build.py", line 127, in run

    self.run_command(cmd_name)

  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Users\killer\build\pycrypto\setup.py", line 251, in run

    self.run_command(cmd_name)

  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "C:\Users\killer\build\pycrypto\setup.py", line 273, in run

    raise RuntimeError("chmod error")

RuntimeError: chmod error

From andyhhp at gmail.com  Wed Sep  5 19:21:04 2012
From: andyhhp at gmail.com (Andrew Cooper)
Date: Thu, 06 Sep 2012 00:21:04 +0100
Subject: [pycrypto] chmod error in Windows 7, when trying to install
In-Reply-To: <CA+UwFj3jKkP4P0T9os01VbXwF2RPn8f+zFTTHxjuDczPomiU2w@mail.gmail.com>
References: <CA+UwFj3jKkP4P0T9os01VbXwF2RPn8f+zFTTHxjuDczPomiU2w@mail.gmail.com>
Message-ID: <5047DE60.3040004@gmail.com>


On 05/09/2012 17:48, Mike Anderson wrote:
> I'm using Windows 7 Ultimate, and trying to install pycrypto, but
> getting an error "'chmod' is not recognized as an internal or external
> command."
>
> It happens like so:
>> pip install ssh
>    ...
> copying lib\Crypto\Signature\__init__.py -> build\lib.win32-2.7\Crypto\Signature
>
>
> running build_ext
>
> running build_configure
>
> 'chmod' is not recognized as an internal or external command,
>
> operable program or batch file.
>
> Traceback (most recent call last):
>
>   File "<string>", line 1, in <module>
>
>   File "C:\Users\killer\build\pycrypto\setup.py", line 456, in <module>
>
>     core.setup(**kw)
>
>   File "C:\Python27\lib\distutils\core.py", line 152, in setup
>
>     dist.run_commands()
>
>   File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
>
>     self.run_command(cmd)
>
>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>
>     cmd_obj.run()
>
>   File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 53, i
> n run
>
>     return _install.run(self)
>
>   File "C:\Python27\lib\distutils\command\install.py", line 563, in run
>
>     self.run_command('build')
>
>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>
>     self.distribution.run_command(command)
>
>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>
>     cmd_obj.run()
>
>   File "C:\Python27\lib\distutils\command\build.py", line 127, in run
>
>     self.run_command(cmd_name)
>
>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>
>     self.distribution.run_command(command)
>
>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>
>     cmd_obj.run()
>
>   File "C:\Users\killer\build\pycrypto\setup.py", line 251, in run
>
>     self.run_command(cmd_name)
>
>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>
>     self.distribution.run_command(command)
>
>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>
>     cmd_obj.run()
>
>   File "C:\Users\killer\build\pycrypto\setup.py", line 273, in run
>
>     raise RuntimeError("chmod error")
>
> RuntimeError: chmod error

This is because you are on windows and setup.py is trying to run unix
commands.

To a cursory glance, it appears to be a bug in pycrypto's setup.py  It
should either provide a windows compatible way of performing autoconf
and friends (unlikely), or provide a windows alternative way of
configuring stuff and conditionally invoke the correct one for the system.

~Andrew

> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto


From campadrenalin at gmail.com  Wed Sep  5 19:23:04 2012
From: campadrenalin at gmail.com (Philip Horger)
Date: Wed, 5 Sep 2012 16:23:04 -0700
Subject: [pycrypto] chmod error in Windows 7, when trying to install
In-Reply-To: <5047DE60.3040004@gmail.com>
References: <CA+UwFj3jKkP4P0T9os01VbXwF2RPn8f+zFTTHxjuDczPomiU2w@mail.gmail.com>
 <5047DE60.3040004@gmail.com>
Message-ID: <CAHAkNZ1ZOZEVihY3+sU0YFbBg-r-K9TAbgfE-GTKL3BO6FNLgQ@mail.gmail.com>

As I understand it, compiling and setting PyCrypto up from source on Windows
requires MinGW. It might also support Cygwin. But some sort of UNIX-y layer to
work with as common ground.

On Wed, Sep 5, 2012 at 4:21 PM, Andrew Cooper <andyhhp at gmail.com> wrote:
>
> On 05/09/2012 17:48, Mike Anderson wrote:
>> I'm using Windows 7 Ultimate, and trying to install pycrypto, but
>> getting an error "'chmod' is not recognized as an internal or external
>> command."
>>
>> It happens like so:
>>> pip install ssh
>>    ...
>> copying lib\Crypto\Signature\__init__.py -> build\lib.win32-2.7\Crypto\Signature
>>
>>
>> running build_ext
>>
>> running build_configure
>>
>> 'chmod' is not recognized as an internal or external command,
>>
>> operable program or batch file.
>>
>> Traceback (most recent call last):
>>
>>   File "<string>", line 1, in <module>
>>
>>   File "C:\Users\killer\build\pycrypto\setup.py", line 456, in <module>
>>
>>     core.setup(**kw)
>>
>>   File "C:\Python27\lib\distutils\core.py", line 152, in setup
>>
>>     dist.run_commands()
>>
>>   File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
>>
>>     self.run_command(cmd)
>>
>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>
>>     cmd_obj.run()
>>
>>   File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 53, i
>> n run
>>
>>     return _install.run(self)
>>
>>   File "C:\Python27\lib\distutils\command\install.py", line 563, in run
>>
>>     self.run_command('build')
>>
>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>
>>     self.distribution.run_command(command)
>>
>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>
>>     cmd_obj.run()
>>
>>   File "C:\Python27\lib\distutils\command\build.py", line 127, in run
>>
>>     self.run_command(cmd_name)
>>
>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>
>>     self.distribution.run_command(command)
>>
>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>
>>     cmd_obj.run()
>>
>>   File "C:\Users\killer\build\pycrypto\setup.py", line 251, in run
>>
>>     self.run_command(cmd_name)
>>
>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>
>>     self.distribution.run_command(command)
>>
>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>
>>     cmd_obj.run()
>>
>>   File "C:\Users\killer\build\pycrypto\setup.py", line 273, in run
>>
>>     raise RuntimeError("chmod error")
>>
>> RuntimeError: chmod error
>
> This is because you are on windows and setup.py is trying to run unix
> commands.
>
> To a cursory glance, it appears to be a bug in pycrypto's setup.py  It
> should either provide a windows compatible way of performing autoconf
> and friends (unlikely), or provide a windows alternative way of
> configuring stuff and conditionally invoke the correct one for the system.
>
> ~Andrew
>
>> _______________________________________________
>> pycrypto mailing list
>> pycrypto at lists.dlitz.net
>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto

From andyhhp at gmail.com  Wed Sep  5 19:29:31 2012
From: andyhhp at gmail.com (Andrew Cooper)
Date: Thu, 06 Sep 2012 00:29:31 +0100
Subject: [pycrypto] chmod error in Windows 7, when trying to install
In-Reply-To: <CAHAkNZ1ZOZEVihY3+sU0YFbBg-r-K9TAbgfE-GTKL3BO6FNLgQ@mail.gmail.com>
References: <CA+UwFj3jKkP4P0T9os01VbXwF2RPn8f+zFTTHxjuDczPomiU2w@mail.gmail.com>
 <5047DE60.3040004@gmail.com>
 <CAHAkNZ1ZOZEVihY3+sU0YFbBg-r-K9TAbgfE-GTKL3BO6FNLgQ@mail.gmail.com>
Message-ID: <5047E05B.1010204@gmail.com>


On 06/09/2012 00:23, Philip Horger wrote:
> As I understand it, compiling and setting PyCrypto up from source on Windows
> requires MinGW. It might also support Cygwin. But some sort of UNIX-y layer to
> work with as common ground.

I could have sworn that I had managed in the past, but it appears that I
used pre-compiled for windows and did the building sensibly on Linux.

Apologies.

~Andrew

>
> On Wed, Sep 5, 2012 at 4:21 PM, Andrew Cooper <andyhhp at gmail.com> wrote:
>> On 05/09/2012 17:48, Mike Anderson wrote:
>>> I'm using Windows 7 Ultimate, and trying to install pycrypto, but
>>> getting an error "'chmod' is not recognized as an internal or external
>>> command."
>>>
>>> It happens like so:
>>>> pip install ssh
>>>    ...
>>> copying lib\Crypto\Signature\__init__.py -> build\lib.win32-2.7\Crypto\Signature
>>>
>>>
>>> running build_ext
>>>
>>> running build_configure
>>>
>>> 'chmod' is not recognized as an internal or external command,
>>>
>>> operable program or batch file.
>>>
>>> Traceback (most recent call last):
>>>
>>>   File "<string>", line 1, in <module>
>>>
>>>   File "C:\Users\killer\build\pycrypto\setup.py", line 456, in <module>
>>>
>>>     core.setup(**kw)
>>>
>>>   File "C:\Python27\lib\distutils\core.py", line 152, in setup
>>>
>>>     dist.run_commands()
>>>
>>>   File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
>>>
>>>     self.run_command(cmd)
>>>
>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>>
>>>     cmd_obj.run()
>>>
>>>   File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 53, i
>>> n run
>>>
>>>     return _install.run(self)
>>>
>>>   File "C:\Python27\lib\distutils\command\install.py", line 563, in run
>>>
>>>     self.run_command('build')
>>>
>>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>>
>>>     self.distribution.run_command(command)
>>>
>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>>
>>>     cmd_obj.run()
>>>
>>>   File "C:\Python27\lib\distutils\command\build.py", line 127, in run
>>>
>>>     self.run_command(cmd_name)
>>>
>>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>>
>>>     self.distribution.run_command(command)
>>>
>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>>
>>>     cmd_obj.run()
>>>
>>>   File "C:\Users\killer\build\pycrypto\setup.py", line 251, in run
>>>
>>>     self.run_command(cmd_name)
>>>
>>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>>
>>>     self.distribution.run_command(command)
>>>
>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>>
>>>     cmd_obj.run()
>>>
>>>   File "C:\Users\killer\build\pycrypto\setup.py", line 273, in run
>>>
>>>     raise RuntimeError("chmod error")
>>>
>>> RuntimeError: chmod error
>> This is because you are on windows and setup.py is trying to run unix
>> commands.
>>
>> To a cursory glance, it appears to be a bug in pycrypto's setup.py  It
>> should either provide a windows compatible way of performing autoconf
>> and friends (unlikely), or provide a windows alternative way of
>> configuring stuff and conditionally invoke the correct one for the system.
>>
>> ~Andrew
>>
>>> _______________________________________________
>>> pycrypto mailing list
>>> pycrypto at lists.dlitz.net
>>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>> _______________________________________________
>> pycrypto mailing list
>> pycrypto at lists.dlitz.net
>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto


From nod at nym.hush.com  Fri Sep  7 13:10:02 2012
From: nod at nym.hush.com (nod at nym.hush.com)
Date: Fri, 07 Sep 2012 10:10:02 -0700
Subject: [pycrypto] chmod error in Windows 7, when trying to install
Message-ID: <20120907171002.D71CEE6739@smtp.hushmail.com>

I created a binary installer for the latest version of pycrypto if 
you would like it, let me know. If you don't trust meh bits(lul) 
then I have these notes from when I compiled pycrypto on windows:

Download the MinGW installer here: 
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-
inst/mingw-get-inst-20120426/
Delete all references to -mno-cygwin in distutils\cygwinccompiler.py

>From within the pycrypto folder run: python setup.py build -c 
mingw32
Then run: python setup.py bdist_wininst
You will now have a compiled binary in: dist 

Run the binary on your host your ant pycrypto on and you should be 
all set.


On Wed, 05 Sep 2012 16:29:42 -0700 Andrew Cooper 
<andyhhp at gmail.com> wrote:
>On 06/09/2012 00:23, Philip Horger wrote:
>> As I understand it, compiling and setting PyCrypto up from 
>source on Windows
>> requires MinGW. It might also support Cygwin. But some sort of 
>UNIX-y layer to
>> work with as common ground.
>
>I could have sworn that I had managed in the past, but it appears 
>that I
>used pre-compiled for windows and did the building sensibly on 
>Linux.
>
>Apologies.
>
>~Andrew
>
>>
>> On Wed, Sep 5, 2012 at 4:21 PM, Andrew Cooper 
><andyhhp at gmail.com> wrote:
>>> On 05/09/2012 17:48, Mike Anderson wrote:
>>>> I'm using Windows 7 Ultimate, and trying to install pycrypto, 
>but
>>>> getting an error "'chmod' is not recognized as an internal or 
>external
>>>> command."
>>>>
>>>> It happens like so:
>>>>> pip install ssh
>>>>    ...
>>>> copying lib\Crypto\Signature\__init__.py -> build\lib.win32-
>2.7\Crypto\Signature
>>>>
>>>>
>>>> running build_ext
>>>>
>>>> running build_configure
>>>>
>>>> 'chmod' is not recognized as an internal or external command,
>>>>
>>>> operable program or batch file.
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>   File "<string>", line 1, in <module>
>>>>
>>>>   File "C:\Users\killer\build\pycrypto\setup.py", line 456, in 
><module>
>>>>
>>>>     core.setup(**kw)
>>>>
>>>>   File "C:\Python27\lib\distutils\core.py", line 152, in setup
>>>>
>>>>     dist.run_commands()
>>>>
>>>>   File "C:\Python27\lib\distutils\dist.py", line 953, in 
>run_commands
>>>>
>>>>     self.run_command(cmd)
>>>>
>>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in 
>run_command
>>>>
>>>>     cmd_obj.run()
>>>>
>>>>   File "C:\Python27\lib\site-
>packages\setuptools\command\install.py", line 53, i
>>>> n run
>>>>
>>>>     return _install.run(self)
>>>>
>>>>   File "C:\Python27\lib\distutils\command\install.py", line 
>563, in run
>>>>
>>>>     self.run_command('build')
>>>>
>>>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in 
>run_command
>>>>
>>>>     self.distribution.run_command(command)
>>>>
>>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in 
>run_command
>>>>
>>>>     cmd_obj.run()
>>>>
>>>>   File "C:\Python27\lib\distutils\command\build.py", line 127, 
>in run
>>>>
>>>>     self.run_command(cmd_name)
>>>>
>>>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in 
>run_command
>>>>
>>>>     self.distribution.run_command(command)
>>>>
>>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in 
>run_command
>>>>
>>>>     cmd_obj.run()
>>>>
>>>>   File "C:\Users\killer\build\pycrypto\setup.py", line 251, in 
>run
>>>>
>>>>     self.run_command(cmd_name)
>>>>
>>>>   File "C:\Python27\lib\distutils\cmd.py", line 326, in 
>run_command
>>>>
>>>>     self.distribution.run_command(command)
>>>>
>>>>   File "C:\Python27\lib\distutils\dist.py", line 972, in 
>run_command
>>>>
>>>>     cmd_obj.run()
>>>>
>>>>   File "C:\Users\killer\build\pycrypto\setup.py", line 273, in 
>run
>>>>
>>>>     raise RuntimeError("chmod error")
>>>>
>>>> RuntimeError: chmod error
>>> This is because you are on windows and setup.py is trying to 
>run unix
>>> commands.
>>>
>>> To a cursory glance, it appears to be a bug in pycrypto's 
>setup.py  It
>>> should either provide a windows compatible way of performing 
>autoconf
>>> and friends (unlikely), or provide a windows alternative way of
>>> configuring stuff and conditionally invoke the correct one for 
>the system.
>>>
>>> ~Andrew
>>>
>>>> _______________________________________________
>>>> pycrypto mailing list
>>>> pycrypto at lists.dlitz.net
>>>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>>> _______________________________________________
>>> pycrypto mailing list
>>> pycrypto at lists.dlitz.net
>>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>> _______________________________________________
>> pycrypto mailing list
>> pycrypto at lists.dlitz.net
>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
>_______________________________________________
>pycrypto mailing list
>pycrypto at lists.dlitz.net
>http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto


From artem.rizhov at gmail.com  Fri Jul 13 12:05:14 2012
From: artem.rizhov at gmail.com (Artem)
Date: Fri, 13 Jul 2012 16:05:14 -0000
Subject: [pycrypto] random.uniform() method
Message-ID: <3562448.YMP7aB9TP8@artem-portable>

Hi!

Tell me please, is there a way to use random.uniform() or random.random() with 
PyCrypto?

--
Artem