4/30/2023 0 Comments Runjs activation key![]() ![]() Making a good registration mechanism for your software from scratch is not recommended, electron makes it harder because the source code is relatively exposed. I built a software licensing architecture from scratch using crypto and the fs module, and it was quite a journey (year) !.If 90% of your users have internet access you should definitely go with the user accounts or some OAUTH 2.0 Plug and play thing (login with facebook/gmail/whatever).YES but concerning the software registration mechanism, IT IS HARD and it needs a lot of testing too.Happy to answer any other questions you have, as I've implemented licensing a few times now for Electron apps. I hope that answers your question and gives you a few insights. I recently put together an example of adding license key validation, as well as device activation and management, to an Electron app. In its simplest form, validating a license key with Keygen is as easy as hitting a single JSON API endpoint (feel free to run this in a terminal): curl -X POST \ It can be used in any programming language and with frameworks like Electron. there’s no software that you need to package with your app). Keygen is a typical HTTP JSON API service (i.e. you need additional user profile information, or you need to associate multiple licenses with a single user.īut in case you aren't particularly keen on writing and maintaining your own in-house licensing system, or you just don't want to deal with writing your own license key generator like the one above, I’m the founder of a software licensing API called Keygen which can help you get up and running quickly without having to write and host your own license server. I don't recommend user accounts unless you have a specific need for them, e.g. That's where a license server can come in.Ī license server can help manage a license's activation, expirations, among other things, such as user accounts used to associate multiple licenses or feature-licenses with a single user or team. Or perhaps the license key needs a renewable expiration date. 'valid' forever), or they call for more complicated licensing systems, such as one where only a limited number of devices (or seats) can use the app at one time. Sometimes requirements dictate that license keys are not perpetual (i.e. They're relatively simple, and they work great offline, but sometimes verifying that a license key is 'valid' isn't enough. Generating and verifying the authenticity of cryptographically signed license keys like this will work great for a lot of simple licensing needs. Verify the signature for the data using the public keyĬonst valid = verifier.verify(publicKey, signature, 'hex') ![]() Then, to validate the license key within your Electron app, you would want to cryptographically 'verify' the key's authenticity by embedding the public (not the private!) key generated above into your application code base: // Split the license key's data and the signatureĬonst = licenseKey.split('.')Ĭonst data = om(encoded, 'base64').toString()Ĭonst verifier = crypto.createVerify('rsa-sha256') ![]() Using Node, that would look something like this: const crypto = require('crypto')Ĭonst ) their order number or an email address, and create a 'signature' of it using RSA cryptography. This can be done using cryptography, or it can be done by generating a 'random' license key string and storing it in a database and then building a CRUD licensing server that can verify that a given license key is "valid."įor cryptographic license keys, you can take some information from the customer, e.g. First, you would want to somehow generate a license key for each user. For most Electron apps, license keys will do just fine.Īdding license key (synonymous with product key) validation to an Electron app can be pretty straight forward. I previously would almost always recommended utilizing user accounts for licensing Electron apps, but I've since changed my position to be a little more nuanced. Edit for 2021: I'd like to revise this answer, as it has generated a lot of inquiries on the comparison I made between license keys and user accounts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |