Skip to content

Commit 3ed314b

Browse files
committed
use pycryptodomex as preferred crypto library. #154
1 parent 2dee984 commit 3ed314b

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

Exscript/protocols/ssh2.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
import select
3232
import socket
3333
import paramiko
34-
import Crypto
34+
try:
35+
import Cryptodome as Crypto
36+
except ImportError:
37+
import Crypto
3538
from binascii import hexlify
3639
from paramiko import util
3740
from paramiko.ssh_exception import SSHException, AuthenticationException, \

Exscript/servers/sshd.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
import base64
2929
import socket
3030
import threading
31-
import Crypto
31+
try:
32+
import Cryptodome as Crypto
33+
except ImportError:
34+
import Crypto
3235
import paramiko
3336
from copy import deepcopy
3437
from paramiko import ServerInterface

Exscript/util/crypt.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
import sys
3232
import string
3333
import random
34-
from Crypto.Hash import MD4
34+
try:
35+
from Cryptodome.Hash import MD4
36+
except ImportError:
37+
from Crypto.Hash import MD4
3538

3639
_VALIDSEEDCHARACTERS = string.ascii_letters + string.digits
3740

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
future
22
configparser
3-
pycrypto
3+
pycryptodomex
44
paramiko>=1.17

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
package_data = {},
2424
packages = find_packages(),
2525
scripts = ['scripts/exscript', 'scripts/otp'],
26-
install_requires = ['future', 'configparser', 'paramiko', 'pycrypto'],
26+
install_requires = ['future', 'configparser', 'paramiko', 'pycryptodomex'],
2727
extras_require = {},
2828
keywords = ' '.join(['exscript',
2929
'telnet',

0 commit comments

Comments
 (0)