fourkitchens / czdap-tools

Tools for downloading zone data and authentication credentials from ICANN's CZDS application.
MIT License
124 stars 47 forks source link

error running test-decrypt.py #2

Open secure411dotorg opened 10 years ago

secure411dotorg commented 10 years ago
cd credentials-decrypt/test
ubuntu@x:/opt/czdap-tools/credentials-decrypt/test$ python test-decrypt.py
Traceback (most recent call last):
  File "test-decrypt.py", line 5, in <module>
    from Crypto.Cipher import PKCS1_v1_5
ImportError: cannot import name PKCS1_v1_5
secure411dotorg commented 10 years ago

After:

wget ftp://ftp.ubuntu.com/ubuntu/pool/main/g/gcj-4.7/libgcj-doc_4.7.2-1ubuntu1_all.deb

(requires gcj-4.7-base)

wget ftp://ftp.na.kde.org/pub/linuxmint-debian-repositories/pools/B/pool/main/g/gcj-4.7/gcj-4.7-base_4.7.2-3_amd64.deb

sudo dpkg -i gcj-4.7-base_4.7.2-3_amd64.deb 

sudo dpkg -i libgcj-doc_4.7.2-1ubuntu1_all.deb

The same error persists.

szilagyikinga commented 10 years ago

I just got the same problem. Any idea ?

koroban commented 10 years ago

Problem is Ubuntu 12.04 LTS - the python-crypto package on this Ubuntu release is still version 2.4.1 - and the required module PKCS1_v1_5.py is missing.

You could install it by manually download the deb package from http://packages.ubuntu.com/quantal/i386/python-crypto or http://packages.ubuntu.com/quantal/amd64/python-crypto

and install it

user@sys:~$ wget http://mirrors.kernel.org/ubuntu/pool/main/p/python-crypto/python-crypto_2.6-2_i386.deb
--2014-02-27 12:05:50--  http://mirrors.kernel.org/ubuntu/pool/main/p/python-crypto/python-crypto_2.6-2_i386.deb
Resolving mirrors.kernel.org (mirrors.kernel.org)... 149.20.20.135, 149.20.4.71
Connecting to mirrors.kernel.org (mirrors.kernel.org)|149.20.20.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 352420 (344K) [text/plain]
Saving to: `python-crypto_2.6-2_i386.deb'

100%[=========================================================================================================================>] 352,420      237K/s   in 1.5s    

2014-02-27 12:05:52 (237 KB/s) - `python-crypto_2.6-2_i386.deb' saved [352420/352420]

user@sys:~$ sudo dpkg -i python-crypto_2.6-2_i386.deb 
(Reading database ... 198907 files and directories currently installed.)
Preparing to replace python-crypto 2.4.1-1ubuntu0.1 (using python-crypto_2.6-2_i386.deb) ...
Unpacking replacement python-crypto ...
Setting up python-crypto (2.6-2) ...

Afterwards, error should be gone - btw. don't miss to install required python-requests package.

szilagyikinga commented 10 years ago

It's working now. Thanks a lot!

john-- commented 10 years ago

That's great help, thanks! Also if you're using a 64bit version of Ubuntu you can use:

wget http://mirrors.kernel.org/ubuntu/pool/main/p/python-crypto/python-crypto_2.6-2_amd64.deb sudo dpkg -i python-crypto_2.6-2_amd64.deb

ZLightning commented 9 years ago

Now that Ubuntu 13.10 is past the expiration date, the version of the package is not available for 12.04 LTS (14.xx version has several unmet dependencies on 12.04), the solution is to do the following:

cd /opt
#Optional: sudo chown `whoami` /opt
sudo apt-get install python-dev
git clone https://github.com/dlitz/pycrypto.git # May require sudo
cd pycrypto
# Version 2.6.1 works with czdap-tools and 2.7a1 does not
git checkout v2.6.1
./configure
python setup.py build
sudo python setup.py install