pycrypto issue?
Bryan Schmersal
bschmer at yahoo.com
Thu Jan 5 16:36:10 UTC 2017
I've run into a situation where verifying signatures against a key is throwing "Plaintext too large".
I've attached the code that I'm using.
Run against the stock pycrypto install, I get:==> ./check_rsa.pyCrypto version = 2.6.1Generating 15 keys....done Sig V Key > Sig > Key V+-E--EEE----E-E f= 8 e= 6 +-------------- f=14 e= 0 -+------------- f=14 e= 0 -+------------- f=14 e= 0 --+------------ f=14 e= 0 E-+----------E- f=12 e= 2 ---+----------- f=14 e= 0 ---+----------- f=14 e= 0 ----+---------- f=14 e= 0 ----+---------- f=14 e= 0 -----+--------- f=14 e= 0 E----+----E--E- f=11 e= 3 ------+-------- f=14 e= 0 E-----+------E- f=12 e= 2 -------+------- f=14 e= 0 E------+------- f=13 e= 1 --------+------ f=14 e= 0 --------+------ f=14 e= 0 ---------+----- f=14 e= 0 ---------+----- f=14 e= 0 -----E----+---- f=13 e= 1 ----------+---- f=14 e= 0 -----------+--- f=14 e= 0 -----------+--- f=14 e= 0 ------------+-- f=14 e= 0 E-----------+-- f=13 e= 1 --E--EE------+E f=10 e= 4 -------------+- f=14 e= 0 --------------+ f=14 e= 0 E------------E+ f=12 e= 2 ==>
+ means that the signature was verified, - means that verification failed and E means that the code caught "Plaintext too large".
So I grabbed the pycrypto sources, compiled the package and ran the tests there:(crypto)==> ./check_rsa.pyCrypto version = 2.6.1Generating 15 keys....done Sig V Key > Sig > Key V+-------------- f=14 e= 0 +-------------- f=14 e= 0 -+------------- f=14 e= 0 -+------------- f=14 e= 0 --+------------ f=14 e= 0 --+------------ f=14 e= 0 ---+----------- f=14 e= 0 ---+----------- f=14 e= 0 ----+---------- f=14 e= 0 ----+---------- f=14 e= 0 -----+--------- f=14 e= 0 -----+--------- f=14 e= 0 ------+-------- f=14 e= 0 ------+-------- f=14 e= 0 -------+------- f=14 e= 0 -------+------- f=14 e= 0 --------+------ f=14 e= 0 --------+------ f=14 e= 0 ---------+----- f=14 e= 0 ---------+----- f=14 e= 0 ----------+---- f=14 e= 0 ----------+---- f=14 e= 0 -----------+--- f=14 e= 0 -----------+--- f=14 e= 0 ------------+-- f=14 e= 0 ------------+-- f=14 e= 0 -------------+- f=14 e= 0 -------------+- f=14 e= 0 --------------+ f=14 e= 0 --------------+ f=14 e= 0 (crypto)==>
==> dpkg -p python-cryptoPackage: python-cryptoPriority: optionalSection: pythonInstalled-Size: 1384Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>Architecture: amd64Version: 2.6.1-4build1Provides: python2.7-cryptoDepends: python (<< 2.8), python (>= 2.7~), python:any (>= 2.7.5-5~), libc6 (>= 2.14), libgmp10Suggests: python-crypto-dbg, python-crypto-docBreaks: python-keyring (<= 0.7.1-1)Size: 239394Description: cryptographic algorithms and protocols for Python A collection of cryptographic algorithms and protocols, implemented for use from Python. Among the contents of the package: . * Hash functions: HMAC, MD2, MD4, MD5, RIPEMD160, SHA, SHA256. * Block encryption algorithms: AES, ARC2, Blowfish, CAST, DES, Triple-DES. * Stream encryption algorithms: ARC4, simple XOR. * Public-key algorithms: RSA, DSA, ElGamal. * Protocols: All-or-nothing transforms, chaffing/winnowing. * Miscellaneous: RFC1751 module for converting 128-bit keys into a set of English words, primality testing, random number generation.Original-Maintainer: Sebastian Ramacher <sramacher at debian.org>Homepage: http://www.pycrypto.org/
Any thoughts on why there's a difference between the two installs?
Thanks,Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20170105/09749ff3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_rsa.py
Type: text/x-python-script
Size: 2085 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20170105/09749ff3/attachment.bin>
More information about the Ubuntu-devel-discuss
mailing list