Topic: wolfcrypt-py: AES-GCM, SHA3, RSA key-sharing


I have written a fully working program using the standard C wolfcrypt library, implementing AES-GCM, SHA3, and RSA-4096.

I am now trying to familiarise myself with the wolfcrypt python wrapper so I can replicate my program in python.

I've had some difficulty trying to implement these algorithms using the python wrapper, so I was wondering if I could please get some insight on the following queries:


Is AES-GCM available with the python wrapper? I can't seem to find any MODE_GCM in the source files, the closest is MODE_CTR, so is that equivalent to GCM? I also can't even use MODE_CTR, as it keeps giving the same error- I dug into the source files and found that the conditional that is producing this error seems to indicate that modes other than MODE_CBC are not supported, so is this the case? I've attached a screenshot of the relevant lines here.


Is SHA3 available with the python wrapper? I can't find any mention of it in the source files so I suspect not, but I wanted to confirm that there was no way to use it with the python wrapper before giving up on it.


What is the best way to share RSA keys with the python wrapper? In my C program I was making use of the methods that produce a DER file from a key so that I could transfer public keys, but that doesn't seem to be an option with the python wrapper, so I was wondering how I would go about sharing RSA keys in a similar manner?

Many thanks!

Post's attachments

wcpy.png 213.06 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.


Re: wolfcrypt-py: AES-GCM, SHA3, RSA key-sharing

Hi @strow089,

1) There are two separate wrappers, one for SSL/TLS and one for crypto.
Documentation for the crypto wrapper can be found here:
For AES see:

2) SHA3 has not been added yet unfortunately.

3) There are examples of setting up ones' keys in a buffer here:

Warm Regards,