I'm appreciate to provide venv version and I would like to share my solution for Ubuntu 18.04.
Actually, ubuntu have ancient version of cryptography package from repo: python3-cryptography_2.1.4-1ubuntu1.4_amd64.deb
But version from requirements.txt doesn't work for me:
Downgrade version in requirements.txt (I'm picked up v40.0.2)
By installing 'cryptography' I have stuggles with dependency 'setuptools_rust' (tried to add it to requirements.txt, but no results). I have used command to manual 'setuptools_rust' installation: pip3 install setuptools_rust
Now, it seems that we can eventually install 'cryptography', but "This package requires Rust >=1.41.0". The solution is: "If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.": pip3 install --upgrade pip
Full sequence of cmds:
* downgrade version of cryptography in requirements.txt
python3 -m venv .venv
source .venv/bin/activate
pip3 install setuptools_rust
pip3 install --upgrade pip
pip3 install -r requirements.txt
Now, by running ./verilog_decrypt.py I realized the root of issue: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6. and script has been failed:
Traceback (most recent call last):
File "./verilog_decrypt.py", line 93, in <module>
main()
File "./verilog_decrypt.py", line 59, in main
aes = Cipher(algorithms.AES(encryption_key), modes.CBC(aes_iv)).decryptor()
File "/home/doka/proj/2023/verilog_decrypt/.venv/lib/python3.6/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py", line 34, in __init__
self.key = _verify_key_size(self, key)
File "/home/doka/proj/2023/verilog_decrypt/.venv/lib/python3.6/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py", line 21, in _verify_key_size
len(key) * 8, algorithm.name
ValueError: Invalid key size (504) for AES.
Okay, I have just downoladed and unpacked python v3.9.7 into /opt/python-3.9.7. Try again:
I'm appreciate to provide venv version and I would like to share my solution for Ubuntu 18.04.
Actually, ubuntu have ancient version of cryptography package from repo:
python3-cryptography_2.1.4-1ubuntu1.4_amd64.deb
But version fromrequirements.txt
doesn't work for me:requirements.txt
(I'm picked up v40.0.2)pip3 install setuptools_rust
pip3 install --upgrade pip
Full sequence of cmds:
Now, by running ./verilog_decrypt.py I realized the root of issue: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6. and script has been failed:
Okay, I have just downoladed and unpacked python v3.9.7 into
/opt/python-3.9.7
. Try again:and have the same issue (on cryptography==41.0.1): ValueError: Invalid key size (504) for AES
..to be continued