did a quick check of the the new cryptography package...seems it needs a relative recent openssl fileset but it let me install without informing me about a incompatible openssl version which leads to this...
>>> from cryptography.fernet import Fernet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/freeware/lib64/python3.9/site-packages/cryptography/fernet.py", line 14, in <module>
from cryptography.exceptions import InvalidSignature
File "/opt/freeware/lib64/python3.9/site-packages/cryptography/exceptions.py", line 9, in <module>
from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
ImportError: Symbol PEM_read_bio_DSA_PUBKEY (number 1117) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Symbol PEM_read_bio_ECPrivateKey (number 1116) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Symbol PEM_write_bio_ECPrivateKey (number 1115) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Symbol PEM_read_bio_EC_PUBKEY (number 1114) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Symbol PEM_read_bio_DHparams (number 1113) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Symbol HMAC_CTX_new (number 1084) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Symbol HMAC_CTX_free (number 1083) is not exported from dependent
module /usr/lib/libcrypto.a(libcrypto.so.3).
Additional errors occurred but are not reported.
Examine .loader section symbols with the 'dump -Tv' command.
openssl version was:
root@aixtest01: /root # lslpp -l | grep openssl
openssl.base 3.0.7.1000 COMMITTED Open Secure Socket Layer
openssl.license 3.0.7.1000 COMMITTED Open Secure Socket License
openssl.man.en_US 3.0.7.1000 COMMITTED Open Secure Socket Layer
openssl.base 3.0.7.1000 COMMITTED Open Secure Socket Layer
with openssl 3.0.10.1001 it worked...
Python 3.9.19 (main, Apr 5 2024, 05:08:51)
[GCC 10.3.0] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.fernet import Fernet
>>> key = Fernet.generate_key()
>>> f = Fernet(key)
>>> token = f.encrypt(b"my deep dark secret")
>>> token
b'gAAAAABm2VEPdbwHP8oeYLYWfCdkePpU0cYNDhEKcV9lwkZqEMFa1qBePYqzZa7mry5sxPGKoPlXkIaXYB89G0r1wSlDn43RnUaN-AxW-LquMA7ASn5DpAM='
>>> f.decrypt(token)
b'my deep dark secret'
------------------------------
I regret starting this entire conversation
------------------------------
Original Message:
Sent: Thu August 29, 2024 08:09 AM
From: Aditya Kamath
Subject: Regarding Clamav and Cryptography updates.
Hi all,
Packages like Python3-cryptography (43.0.0) and Clamav (1.0.6), in their recent versions, have code written in Rust apart from C/C++. We will be uploading these new versions in AIX Toolbox soon. In AIX, Rust compiled binaries has runtime dependency on libunwind library.
If one encounters the issue "requires libunwind.a(libunwind.so.2)" while installing the rpms , one needs to install libunwind.rte and run the updtvpkg command.
And then try to install these RPMs. Users can get the runtime libraries from the below URL: https://www.ibm.com/support/pages/fix-list-xl-cc-runtime-aix The latest version at the time of writing is IBM_OPEN_XL_CPP_RUNTIME_17.1.1.8_AIX.tar.Z Users can extract the above tar file and need only libc++.rte, libc++abi.rte and libunwind.rte filesets to be installed.
Also, the minimum Os level requirement for the same will be 7.2.
------------------------------
Aditya Kamath
------------------------------