Help with connecting libraries + decryption

Hey all!
First post here, if this is not the category i should have place the post in, so i’m sorry :slight_smile: its related to a plugin i’m working on.

So, I’m working on a licensing system for the plugin, and this is what i came up with:
I’m generating licenses (using python) → the user upload (through the plugin) the license file to the activation server (from now on it will be called acs) via API-> the acs response with json, add to db with a valid response + return JSON of the decrypted data, and on invalid its returns the error as json.
the response is affect the plugin behaviour.

This is in simple terms, and i did it because i haven’t managed to make a decryption method in JUCE because i couldn’t figure out how to add libraries! i tried to use openssl but it hasn’t worked for me.

Can you please write what is the easiest-to-work-with/easiest-to-install library for cpp out there and how to connect it to the project? please also add what are your favorite libs for cryptography.

Thank you all.

Never used it, but I’ve heard good things about libsodium. Last time I checked, it looked like it followed the same conventions as Python cryptography.

If you’re using Projucer, there is an ‘external libraries to link’ box. A quick search for cmake + libsodium got me here Usage | libsodium, where there is a link to a cmake file from Facebook.

If you don’t want to bother with external libraries, Juce does come with some RSA tools, like this: JUCE: RSAKey Class Reference

Using RSA keys, you can fairly easily decrypt or verify RSA signatures locally in the plugin, if you search on the forum there are others that have posted some sample implementations.

When building a licensing system it’s important to use some asymmetric key cryptography, and ship the public key with the plugin, and then use this when decrypting or verifying the integrity of what you get back from the server. Spoofing server responses is pretty easy, so it’s not a big protection, you need to bake something more into the plugins.

Happy to help you out if you have more questions, I’ve built several of these systems in the past. :slight_smile: