Crypto/X509 certificate parsing libraries for Python

Any recommended crypto libraries for Python. I know I've asked something similar in x509 certificate parsing libraries for Java, but I should've split the question in two.

What I need is the ability to parse X.509 Certificates to extract the information contained in them.

Looking around, I've found two options:

Of the two, pyOpenSSL seems to be the most "maintained", but I'd like some feedback on anybody who might have experience with them?

Asked by: Kellan598 | Posted: 27-01-2022

Answer 1

Use M2Crypto, it is the most complete tool IMHO

Answered by: Adelaide419 | Posted: 28-02-2022

Answer 2

You might want to try keyczar as mentioned by me in your other post, since that library actually has implementations for both python and java. That would make it easier to use it in both contexts.

A word of warning: I have not actually used this library 8(, so please take this with a grain of salt.

Answered by: Kellan278 | Posted: 28-02-2022

Answer 3

My experience is that most crypto libraries are focused on a particular workflow - making a certain set of tasks easier and others hard or perhaps impossible. The exception to this would be ones that have really been around a long time and have matured (e.g. openssl, bounceycastle, but none of the python libraries in my experience). So, you really need to evaluate libraries in the context of what you are trying to do.

More specifically, I've used pyOpenSSL for simple generation of private keys and certificates requests (i.e. being a client to a CA) and am quite happy with it.

Answered by: Anna288 | Posted: 28-02-2022

Answer 4

The keyczar project is deprecated. You can check out tink.

Answered by: Miranda773 | Posted: 28-02-2022

Similar questions

cryptography - How to sign a document in python with M2Crypto using particular padding technique?

I need to digitally sign some text in python using a private key stored in a .pem file. It seems like M2Crypto is the preferred way to do that these days, so that's what I'm using. I think I get most of it, but I'm confused about how to configure padding. To be specific, I need to verify the signature in an iPhone app, using a padding scheme called kSecPaddingPKCS1SHA1 and described like this:

c# - Free Cryptography libraries

What are the most stable and useful Cryptography libraries, that they are: written with/for python, c++, c#, .net opensource, GNU, or other free license

Lightweight cryptography toolkit(s) for C++ and Python

I'm looking to do some basic encryption of server messages which would be encrypted with C++ and decrypted using Python server side. I was wondering if anyone knew if there were good solutions that were simpler or more lightweight than Keyczar. I see that supports both C++ and python, but would using Crypto++ and PyCrypto be simpler for a newbie that just wants to get something up and running for the time being? ...

cryptography - DSA module in Python

Does anyone know of a pure DSA module in Python for signing messages?

cryptography - what python package for rsa algorithm

looking to do RSA encryption on a short string in python. This is for a piece of user data that I want to store without staff (incl myself) being able to see it. The private key will be on a thumbdrive in my safety deposit box for when we get subpoenaed. my question: is there a 'probably correct' python package for asymmetric-key RSA? Will I be safer to use a C library (if so which one).

Cryptography tools for python 3

I'm writing a program in python 3 which needs encryption functions (at least aes and rsa). I've found PyCrypto which seems to work only on 2.x versions. Is there any good tool available for python 3 or should I rather start translating my program to be compatible with python 2 (or any other solution) ? Thank you Upd...

cryptography - Python Script for Encryption and Decryption of files

i was going through one of the python recipes in active state and found the following code. I've come up with the following 4 questions. Will be very grateful for any guidance and explanations. Q::Im unable to exactly figure out as to why is a "key-random seed" taken from the user at the first place in line "k=long(sys.argv[2])" ? especially since, this value 'k' doesnt seemed to be used in the later part of the co...

encryption - PyECC Example - Python Elliptic Curve Cryptography

I am working with PyECC - it is the only elliptic curve cryptography module for python that I can find. I was wondering if anyone had an example of how to use the module? I'll try reading the source, but I couldn't find anything on Stack Overflow on the topic regarding python. Thanks!

cryptography - Index of Coincidence (python)

Hia guys, I'm helping out a friend with some code and so am trying to wrap my head around "Index of Coincidence" as seen here: Essentially: I have a string output coming out of a for loop, and I want to calculate its index of coincidence, eventually I'll have it only displaying outp...

cryptography - python crypto rsa issue

There seems to be a problem with RSA encryption/decryption in python Crypto package: from Crypto.PublicKey import RSA from os import urandom def test(keylen, datalen, rand_len): k = RSA.generate(keylen) ok, fail = (0,0) for i in range(1000): a = urandom(datalen) if a == k.decrypt(k.encrypt(a, urandom(rand_len))): ok += 1 else: fail += 1 return ...

Still can't find your answer? Check out these communities...

PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python