https://github.com/keygen-sh/example-js-cryptographic-license-files
Example of verifying cryptographically signed and encrypted license files using Web Crypto with Ed25519 and AES-256-GCM.
https://github.com/keygen-sh/example-js-cryptographic-license-files
Last synced: 3 months ago
JSON representation
Example of verifying cryptographically signed and encrypted license files using Web Crypto with Ed25519 and AES-256-GCM.
- Host: GitHub
- URL: https://github.com/keygen-sh/example-js-cryptographic-license-files
- Owner: keygen-sh
- License: mit
- Created: 2025-01-08T19:04:10.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-01-08T20:49:36.000Z (9 months ago)
- Last Synced: 2025-06-30T00:38:31.389Z (3 months ago)
- Language: HTML
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example JS Cryptographic License Files
This is an example of how to verify and decrypt [cryptographic license files](https://keygen.sh/docs/api/cryptography/#cryptographic-lic)
in a browser environment, using Ed25519 verification and AES-256-GCM encryption.> [!WARNING]
> **This example utilizes [Web Crypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).**
> You may need to enable certain flags in your browser if support has not
> landed yet, e.g. for Ed25519. For the best experience, use Firefox.This example verifies the `aes-256-gcm+ed25519` algorithm.
## Running the example
First up, install dependencies with [`yarn`](https://yarnpkg.com):
```
yarn
```Then run the server:
```bash
yarn start
```You can either manually input or upload the example license file, or input your
own values.The following will happen:
1. The license file's authenticity will be verified using Ed25519, by verifying
its signature using the provided public key.
1. The license file will be decrypted using the license key
as the decryption key.If everything checks out, the page will display the decrypted contents of
the license file — the license object, with any included data. If it
fails, review the error and check your inputs.## Questions?
Reach out at [support@keygen.sh](mailto:support@keygen.sh) if you have any
questions or concerns!