• Stars
    star
    752
  • Rank 60,353 (Top 2 %)
  • Language Gherkin
  • License
    Other
  • Created over 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Keygen is a fair source software licensing and distribution API built with Ruby on Rails. For developers, by developers.
Keygen

Keygen CI Discord Community

Keygen

Keygen is an open, source-available software licensing and distribution API, built for developers, by developers. Use Keygen to add license key validation, entitlements, and device activation to your business's desktop apps, server applications, on-premise software, and other products.

Software licensing for everyone

Keygen comes in two editions. Keygen CE is our Community Edition, and is free (as in beer) to self-host for personal and commercial use. Keygen EE is our Enterprise Edition, and it requires a license key to use. Keygen EE comes with dedicated support, as well as enterprise-grade features like request logs, audit logs, permissions, environments, and more.

I built Keygen to make software licensing accessible to everyone.

Managed hosting with Keygen Cloud

The easiest way to get started with Keygen is with our official managed service in the cloud. We'll handle the hard stuff β€” high availability, backups, security, and maintenance β€” while you focus on product.

Our managed hosting can save a substantial amount of developer time and resources. For most businesses, this ends up being the best value option and the revenue goes to funding the maintenance and further development of Keygen. So you’ll be supporting open source software and getting a great service!

Self hosting with Keygen CE

Keygen is an open, source-available software licensing and distribution API, and we have a free (as in beer) self-hosted solution. Keygen Community Edition is exactly the same code base as our managed solution, Keygen Cloud, but with a less frequent release schedule (think of it as an LTS release).

Bug fixes and new features are released to Keygen Cloud several times per week. Features are battle-tested in Keygen Cloud which allows us to fix any bugs before the general self-hosted release. Every 6 months, we combine all the changes into a new self-hosted release.

Keygen CE does lack a few features from Keygen Cloud, which are available in Keygen EE.

Interested in self-hosting Keygen? Take a look at our self-hosting docs.

Self hosting with Keygen EE

Keygen is also enterprise-grade, battle-tested in Keygen Cloud with some of the best brands in the world. The following features are available in Keygen Enterprise Edition:

  • Request logs: keep a historical record of API requests, along with who made the request, the request body, response body, status code, IP address, and other information.
  • Event logs: keep an audit trail of every single event that happens on a Keygen account.
  • Environments: manage separate environments within a Keygen account, from test environments, to a sandbox, to QA, to production.
  • Permissions: enterprise-grade roles and permissions.
  • SSO/SAML: support for SSO/SAML coming soon.

Keygen uses Keygen EE in production to run Keygen Cloud, which is used to license Keygen EE. It's turtles Keygens all the way down (we love dogfooding our own products).

To obtain a license key, please reach out.

Sustainability

Our only sources of funding for Keygen is our premium, managed service for running Keygen in the Cloud, and Keygen EE. But if you're looking for an alternative way to support the project, we've put together some sponsorship options.

If you choose to self-host Keygen CE, you can become a sponsor, which is a great way to give back to the community and to contribute to the long-term sustainability of the project.

Support

Keygen CE is a community supported project and there are no guarantees that you will receive support from the creators of Keygen to troubleshoot your self-hosting issues. Keygen offers best-effort support for Keygen CE. There is a community-supported Discord server and a forum where you can ask for help with self-hosting.

If you do need support guantantees, consider becoming a Keygen Cloud customer, or purchasing Keygen EE.

Developing

Secrets

To generate a secret key for the application, run:

export SECRET_KEY_BASE="$(openssl rand -hex 64)"

To generate at-work encryption secrets, run:

export ENCRYPTION_DETERMINISTIC_KEY="$(openssl rand -base64 32)"
export ENCRYPTION_PRIMARY_KEY="$(openssl rand -base64 32)"
export ENCRYPTION_KEY_DERIVATION_SALT="$(openssl rand -base64 32)"

Setup

To install dependencies, run:

bundle

To setup Keygen, run:

bundle exec rails keygen:setup

Seeding

To seed the database with sample data, run (optional, takes about an hour):

bundle exec rails db:seed:development

Running

To start the server, run:

bundle exec rails server

To start a worker, run:

bundle exec sidekiq

Testing

To run the entire test suite, specs and features, run (takes about 20 mins on a 16-core CPU):

bundle exec rake test

To run Cucumber features, run:

bundle exec rake test:cucumber

To run Rspec specs, run:

bundle exec rake test:rspec

License

Keygen is licensed under the Elastic License 2.0 (ELv2) license because it provides the best balance between freedom and protection. The ELv2 license is a permissive license that allows you to use, modify, and distribute Keygen as long as you follow a few simple rules:

  1. You may not provide Keygen's API to others as a managed service. For example, you cannot host Keygen yourself and sell it as a cloud-based licensing service, competing with Keygen Cloud. However, you can sell a product that directly exposes and utilizes Keygen's API, as long as Keygen cannot be used outside of your product for other purposes (such as your customer using an embedded Keygen EE instance to license their product in addition to your product).

  2. You may not circumvent the license key functionality or remove/obscure features protected by license keys. For example, our code contains license gates that unlock functionality for Keygen EE. You cannot remove or change the licensing code to, for example, unlock a Keygen EE feature in Keygen CE.

  3. You may not alter, remove, or obscure any licensing, copyright, or other notices.

Anything else is fair game. There's no clause that requires you to open source modifications made to Keygen or other derivative works.

You can self-host Keygen EE to license your enterprise application.

You can embed Keygen CE in your on-premise application.

You can run Keygen CE on a private network.

You can fork Keygen and go closed-source.

If the ELv2 license doesn't work for your company, please reach out.

The license is available here.

Contributing

If you discover an issue, or are interested in a new feature, please open an issue. If you want to contribute code, feel free to open a pull request. If the PR is substantial, it may be beneficial to open an issue beforehand to discuss.

The CLA is available here.

Security

We take security at Keygen very seriously. We perform annual pen-tests on our code base and infrastructure. In addition, we regularly perform code audits. Our most recent pen-test was performed by Greg Molnar, an OSCP-certified security researcher in the Ruby and Rails community.

If you believe you've found a vulnerability, please see our SECURITY.md file.

Is it any good?

Yes.

More Repositories

1

typed_params

An alternative to Rails strong_parameters. Define structured and strongly-typed parameter schemas for your Rails controllers.
Ruby
106
star
2

request_migrations

Write request and response migrations for Stripe-like versioning of your Ruby on Rails API. Make breaking changes without breaking things!
Ruby
105
star
3

keygen-go

Keygen reference SDK for Go. Integrate license activation, automatic updates and offline licensing for Go binaries.
Go
98
star
4

example-electron-license-activation

An example of how to implement software licensing and device activation in an Electron application
JavaScript
91
star
5

py-machineid

Get the unique machine ID of any host (without admin privileges).
Python
53
star
6

example-paddle-integration

An example Node.js app that integrates Keygen with Paddle for accepting payments.
JavaScript
33
star
7

example-electron-app

An example Electron app that uses Keygen for licensing and auto-updates.
JavaScript
33
star
8

air-gapped-activation-example

An example implementation of offline activation for air-gapped machines using QR codes, signed and encrypted license files, and a mobile device.
TypeScript
32
star
9

example-wordpress-plugin

An example WordPress plugin that uses Keygen for site-locked licensing.
PHP
24
star
10

example-stripe-integration

An example Node.js app that integrates Keygen with Stripe for accepting payments.
JavaScript
23
star
11

example-node-activation-server

An example Node server that performs license creation, activation and validation using Keygen.
JavaScript
21
star
12

example-python-machine-activation

An example implementation of a node-locked license activation flow using Keygen and Python
Python
19
star
13

basic-example-electron-app

A simplistic Electron app example that uses Keygen for license key validation.
HTML
19
star
14

keygen-cli

Official command line tool for publishing releases to Keygen's distribution API.
Go
18
star
15

example-electron-license-gate

An example of adding a license gate to an Electron app, requiring a valid license to "unlock" the main application window.
JavaScript
18
star
16

example-php-activation-server

An example PHP server that performs license creation, activation and validation using Keygen.
PHP
17
star
17

example-go-program

A self-updating Go program that uses Keygen for licensing and auto-updates.
Go
13
star
18

keygen-zapier

An official Zapier integration for Keygen.
TypeScript
12
star
19

keygen-relay

An offline-first on-premise licensing server backed by Keygen.
Go
11
star
20

example-python-cryptographic-verification

Example of verifying a license key's authenticity using Ed25519 and RSA-SHA256 with various padding schemes
Python
11
star
21

community

Join the Keygen community. Ask questions, talk about software development, discuss licensing, and show off your work!
9
star
22

example-gumroad-integration

An example Node.js app that integrates Keygen with Gumroad for accepting payments.
JavaScript
9
star
23

example-rust-license-validation

An example of making a simple license validation request from a Rust command line program
Rust
9
star
24

example-python-offline-validation-caching

An example of utilizing license validation caching and cryptographic verification for offline use
Python
9
star
25

example-python-machine-heartbeats

Example of node-locked machine activation with a heartbeat monitor.
Python
8
star
26

example-cpp-cryptographic-verification

Example of verifying a license key's authenticity using RSA-SHA256 with PKCS1 v1.5 padding
C++
8
star
27

example-rust-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using Rust, Ed25519 and AES-256-GCM
Rust
7
star
28

example-cpp-gui-license-validation

An example of making a simple license validation request from a Qt/C++ GUI program
C++
6
star
29

example-cpp-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using C++, OpenSSL, Ed25519 and AES-256-GCM.
C
6
star
30

example-python-cryptographic-machine-files

Example of verifying cryptographically signed and encrypted machine files using Python, Ed25519 and AES-256-GCM.
Python
6
star
31

example-csharp-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using C#, NSec, Bouncy Castle, Ed25519 and AES-256-GCM.
C#
6
star
32

example-node-machine-activation

An example implementation of a typical machine activation flow using Keygen
JavaScript
6
star
33

example-fastspring-integration

An example Node.js app that integrates Keygen with FastSpring for accepting payments.
JavaScript
6
star
34

example-csharp-cryptographic-verification

Example of verifying cryptographically signed license keys using C#, Bouncy Castle and RSA PSS-SHA256
C#
6
star
35

example-csharp-license-activation

An example implementation of a node-locked license activation flow using Keygen and C# .NET
C#
5
star
36

example-react-licensing-portal

An example customer-facing licensing portal built using Keygen's API and React
JavaScript
5
star
37

example-cpp-license-validation

An example of making a simple license validation request from a C++ command line program
C++
5
star
38

example-embedded-license-key-data

An example implementation of embedding data inside of cryptographically signed license keys using RSA cryptography, for use in offline licensing models.
JavaScript
5
star
39

example-private-npm-package

An example of publishing a private Node package to a private npm registry hosted by Keygen
JavaScript
5
star
40

example-dart-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using Dart, Ed25519 and AES-256-GCM
Dart
5
star
41

example-cpp-user-authentication

Example of authenticating as a user and interacting with Keygen's API
C++
5
star
42

example-react-license-validation

An example implementation of validating a license key from within a React component.
JavaScript
4
star
43

example-sendowl-integration

An example Node.js app that integrates Keygen with SendOwl for accepting payments.
JavaScript
4
star
44

example-node-response-signature-verification

An example implementation of verifying response signatures using cryptography to prevent tampering with cache payloads, replay attacks and MITM attacks.
JavaScript
4
star
45

example-csharp-license-validation

An example of making a simple license validation request from a C# .NET console application
C#
4
star
46

example-csharp-user-authentication

An example implementation of user authentication using Keygen and C# .NET
C#
4
star
47

example-cryptographic-verification

An example implementation of cryptographically verifying license key authenticity using ECC and RSA cryptography, for use in offline licensing models.
JavaScript
4
star
48

example-cpp-response-signature-verification

Example of verifying response signatures using portable Ed25519
C
4
star
49

example-csharp-validation-caching

An example of license validation caching for a C# .NET 5 console application
C#
3
star
50

example-multi-tenant-licensing-server

An example of how to implement a multi-tenant node-locked licensing server.
JavaScript
3
star
51

example-csharp-hybrid-online-offline-licensing

An example of implementing a hybrid online/offline licensing system using Keygen
C#
3
star
52

example-validation-caching

An example command line script that caches validation responses to the filesystem for offline licensing.
JavaScript
3
star
53

example-bash-license-activation

Example of secure license key activation in a Bash script.
Shell
3
star
54

example-go-license-validation

An example of making a simple license validation request from a Go command line program
Go
2
star
55

example-duplicate-machine-suspension-job

An example job which suspends licenses based on duplicate machine instances
Python
2
star
56

example-python-release-upload

Example of using Python to create a new release and upload a release artifact.
Python
2
star
57

example-python-activation-proof-verification

Example of verifying signed machine activation proofs using RSA PKCS1 v1.5 padding with a SHA256 digest.
Python
2
star
58

example-bash-cryptographic-verification

Example of verifying a license key's authenticity using RSA-SHA256 with PKCS1 PSS padding with Bash.
Shell
2
star
59

example-java-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using Java, Bouncy Castle, Ed25519 and AES-256-GCM
Java
2
star
60

example-java-cryptographic-license-keys

Example of verifying cryptographically signed license keys using Java, Bouncy Castle and Ed25519
Java
2
star
61

fcl.dev

The website for the Fair Core License. Fair Core is to Fair Source what Open Core is to Open Source.
HTML
2
star
62

example-webhook-handler

An example Node.js app that handles webhook events from Keygen
JavaScript
1
star
63

example-password-reset-fulfillment

An example of fulfilling password reset requests with your own domain and email provider
JavaScript
1
star
64

example-csv-importer

An example script that imports a collection of users into Keygen from a CSV dataset
JavaScript
1
star
65

example-node-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using Node, Ed25519 and AES-256-GCM.
JavaScript
1
star
66

example-moonclerk-integration

An example Node.js app that integrates Keygen with MoonClerk for accepting payments.
JavaScript
1
star
67

example-python-bulk-machine-deactivation

An example of deactivating a license's machines in bulk using Keygen's API
Python
1
star
68

example-dist-proxy

An example Node.js app that proxies release downloads from Keygen Dist.
JavaScript
1
star