HyperSine / how-does-SecureCRT-encrypt-password

Transferred from https://github.com/DoubleLabyrinth/how-does-SecureCRT-encrypt-password
262 stars 98 forks source link

Make Error : **AttributeError: function 'SHA512_init' not found** #9

Closed Chunbinlai closed 11 months ago

Chunbinlai commented 11 months ago

Everyone , Im make securecrt_cipher.py after appear this Error information : AttributeError: function 'SHA512_init' not found , Please help me . Thank's.

  1. In below is command information :

PS E:\Database\python> python securecrt_cipher.py dec -2 --prefix 03 70e0ef15dd8c31f59988e0a2af0bdbe16a572e70157b414619f7c1352846821c1f59e1f19c42708c89a702a9bfc559e3ac861ddc6c2b4d497e437d001e7cd22a012cec2d84a9f270cba9f418c10daecb Traceback (most recent call last): File "E:\Database\python\securecrt_cipher_1.py", line 266, in print(getattr(cipher, operation)(args.PASSWORD, prefix = args.prefix)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Database\python\securecrt_cipher_1.py", line 166, in decrypt kdf_bytes = bcrypt_pbkdf2(self._config_passphrase, salt, 32 + AES.block_size, 16) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Database\python\securecrt_cipher_1.py", line 21, in bcrypt_pbkdf2 out = KDF.PBKDF2(password, salt, out_len, rounds, prf = bcrypt_hash) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Horry\AppData\Roaming\Python\Python311\site-packages\Crypto\Protocol\KDF.py", line 168, in PBKDF2 s = [ prf(password, salt + struct.pack(">I", i)) ] * 2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Database\python\securecrt_cipher_1.py", line 8, in bcrypt_hash password = SHA512.new(password).digest() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Horry\AppData\Roaming\Python\Python311\site-packages\Crypto\Hash\SHA512.py", line 177, in new return SHA512Hash(data, truncate) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Horry\AppData\Roaming\Python\Python311\site-packages\Crypto\Hash\SHA512.py", line 85, in init result = _raw_sha512_lib.SHA512_init(state.address_of(), ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python\Python311\Lib\ctypes__init.py", line 389, in getattr func = self.getitem(name) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python\Python311\Lib\ctypes\init.py", line 394, in getitem__ func = self._FuncPtr((name_or_ordinal, self)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: function 'SHA512_init' not found


Notie : my any version information Windows 11 x86-64bit Python 3.11.6 pip 23.2.1

Package version : PS C:\Users\Horry> pip list Package Version ------------ ------- pip 23.2.1 PyAudio 0.2.11 pycrypto 2.6.1 pycryptodome 3.19.0 setuptools 65.5.0 wheel 0.41.2