-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for PQC algs #421
Comments
You know, I've played with that idea myself a few years ago, but I ended up not doing anything with it for lack of time. I think this is worth pursuing, but there are a few things you have to know:
So, in summary: I wholeheartedly support this experiment and I think it's quite doable, but given that interoperability with other implementations is just not achievable at this point, I don't think I can merge a contribution of that nature (yet). It'd make for a nice showcase, dependent lib, and/or advanced usage example. What do you think? |
Hey @MatthiasValvekens, thanks so much for the detailed answer!
A list of OIDs can be found here, but they are not final and probably will change in the future. Other projects, e.g. wolfSSL use the same OIDs.
I was talking before in «I am quite interested in having PQC, but any support landing in main will probably be predicated on the finalization of FIPS 203-205 and OpenSSL actually landing it in core. Until then experiments with the oqs provider are a good idea though!»
Alright, thanks for pointing in the right direction ;)
Of course, of course. I agree it doesn't make sense to implement and support this already as a "main" feature. I just wanted to do a quick experiment/demo. For some PDF readers (maybe not mainstream) to support PQC signatures, first other libraries have to support them. For example, KDE Okular and Gnome Document Viewer (Evince) both use poppler, which relies on NSS and gpgme to support cryptographic signatures. I guess these libraries will start to support PQC sooner than later. Regarding the HSM support for PQC keys, you can check this table from the PKI Consortium. I think most of the big players will suport PQC keys by the end of this year. Then probably by 2026 we will start to see the first CAs supporting PQC algs.
Yes, I think signing is simple, I was more worried about the CMS object and PDF peculiarities, that I'm not familiar at all. So I guess I could start trying that, just focusing on the signing process.
Sounds good! I think if I manage to make this to work it could be added to oqs-demos. |
Hi @iyanmv, I also took liboqs for a spin last weekend. With a bit of hacking I was able to get it to produce & validate Dilithium signatures in PDFs... Now that I have a bit of time to write down my findings, I figured I'd post them here :). The good news is that the areas of the codebase that would have to change to accommodate this are actually fairly reasonable to generalise in a way that makes it possible to "plug in" something liboqs-capable without having to ship PQC support in-tree. OID registration in asn1crypto (as discussed above)The only thorny thing here is that the
(also in pyhanko-certvalidator) Making validation pluggableWe could make the validator use a generic interface that just takes an ASN.1 SigningOnce I had the OID plumbing set up correctly, it was trivial to create a Open questions
Test data |
Wow! So cool! I also did some experiments but I didn't arrive to touch anything in pyHanko, I was playing around with pypa/cryptography to use the oqsprovider. Could you push the branch where you did all those changes so I can have a look? Regarding your first open question: Yes, Regarding the second open questions, I think we have to wait for the final versions of FIPS 203, 204 and 205. NIST will define the OIDs there. |
Is your feature request related to a problem? Please describe.
I would to try the new PQC algs to generate PDF signatures
Describe the solution you'd like
I would like to work on this, but probably I would need to get some hints in what direction this could be done based on your experience with PDF signatures and other Python libraries.
Describe alternatives you've considered
liboqs
is a C library developed by the Open Quantum Safe project that provides a common API to try the new PQC algorithms for KEM and DS. There is also an official Python wrapper for the library and a provider for OpenSSL 3.x. This provider can be used to issue certificates with the new algs with the exactly same commands as traditional algs. For example, this command can be used to generated a self-signed certificate using the hybrid ML-DSA 87 (Dilithium5) + Curve448 mode:And OpenSSL can also be used to generate CMS signatures. For example, with:
I wonder how difficult it would be to integrate pyHanko with
liboqs
.Additional context
Add any other context or screenshots about the feature request here.
When I try to use the CLI to sign using this hybrid certificate I get the following error:
So after checking that module I guess the relevant packages used that implement the signature algorithms are
asn1crypto
andpyca/cryptography
.So I guess the questions is: would these packages need to support PQC algs, or is it possible to integrate pyHanko directly with
liboqs
. Perhaps this could be behind a--experimental
flag?The text was updated successfully, but these errors were encountered: