{"id":22422122,"url":"https://github.com/abumq/licensepp","last_synced_at":"2025-04-05T06:08:05.709Z","repository":{"id":41176454,"uuid":"116748226","full_name":"abumq/licensepp","owner":"abumq","description":"Software licensing and registration using digital signatures and public cryptography 🪪","archived":false,"fork":false,"pushed_at":"2023-12-19T15:34:51.000Z","size":382,"stargazers_count":387,"open_issues_count":7,"forks_count":98,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-29T05:07:55.314Z","etag":null,"topics":["licensing","security","software-license","software-licensing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abumq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["abumq"]}},"created_at":"2018-01-09T01:17:20.000Z","updated_at":"2025-03-21T01:19:30.000Z","dependencies_parsed_at":"2024-12-05T17:11:50.858Z","dependency_job_id":"531b4664-89c5-4a2e-93ee-7967dee6c860","html_url":"https://github.com/abumq/licensepp","commit_stats":null,"previous_names":["abumq/licensepp","amrayn/licensepp"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Flicensepp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Flicensepp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Flicensepp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abumq%2Flicensepp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abumq","download_url":"https://codeload.github.com/abumq/licensepp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294539,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["licensing","security","software-license","software-licensing"],"created_at":"2024-12-05T17:11:47.184Z","updated_at":"2025-04-05T06:08:05.689Z","avatar_url":"https://github.com/abumq.png","language":"C++","funding_links":["https://github.com/sponsors/abumq"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  ﷽\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/abumq/licensepp\"\u003e\n      \u003cimg width=\"400px\" src=\"https://github.com/abumq/licensepp/raw/master/licensepp.png?\" /\u003e\n    \u003c/a\u003e\n    \u003cp align=\"center\"\u003eSoftware licensing using digital signatures 🪪\u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"Version\" href=\"https://github.com/abumq/licensepp/releases/latest\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/github/release/abumq/licensepp.svg?style=for-the-badge\u0026labelColor=000000\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"License\" href=\"https://github.com/abumq/licensepp/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"Apache 2.0\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge\u0026labelColor=220000\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nLicense++ is a cross platform software licensing library that uses digital signatures to secure use of your application and its licensing.\n\n## Abstract\nI created a concept of digital software licence and implemented it under this project. The digital licence would be issued by an issuing authority with a digital signature. The whole process is protected by public-key cryptography signing scheme. This guarantees that the generation of new licenses is restricted, and any attempts to tamper with an issued license are prevented, similar to how we are issued with driver's licence, or better.\n\n## Features\n\n * RSA-Based signing to prevent alteration\n * Custom license keys for your software\n * Anyone can check the license validity\n * Restricted issuance of new licenses\n * Disable issuing authority at anytime\n\n## Getting Started\n\n### Dependencies\n\n  * C++11 (C++14 if you are also building tests, since latest Google C++ Testing Library requires C++14)\n  * [Crypto++](https://www.cryptopp.com/) v5.6.5+ [with Pem Pack](https://abumq.github.io/downloads/pem_pack.zip)\n  * [cmake](https://cmake.org/) v2.8.12+\n  * [Ripe](https://github.com/abumq/ripe)\n\n### Installation\n * Clone the repo\n    ```\n     git clone git@github.com:abumq/licensepp.git\n    ```\n * Install Crypto++\n     ```\n      wget https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/cryptocpp.tar.gz\n      tar xf cryptocpp.tar.gz\n      cd cryptopp-CRYPTOPP_5_6_5\n      wget https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/pem_pack.zip\n      unzip pem_pack.zip\n      cmake .\n      make\n      sudo make install\n     ```\n * Install Ripe (if this fails, refer to full [build instructions](https://github.com/abumq/ripe/tree/master#build) on the github)\n    ```\n      git clone git@github.com:abumq/ripe.git\n      mkdir build\n      cd build\n      cmake ..\n      make\n      sudo make install\n    ```\n * Use CMake to build the project\n     ```\n     cd licensepp\n     mkdir build\n     cd build\n     cmake ..\n     make\n     sudo make install\n\n     ## build with test (make sure you have Google C++ Testing Library)\n     cmake -Dtest=ON ..\n     make\n     sudo make install\n     ./licensepp-unit-tests\n     ```\n * You can build [cli](/cli) tool to ensure license++ is installed properly\n\n### Integration\n Once you have license++ properly installed please check out [sample](/sample) code for integration\n\n\n## Generate New Authority Key\n Authority key is what is in [key register](/cli/licensing/license-manager-key-register.cc) (`LICENSE_ISSUING_AUTHORITIES`) You will need to generate a custom key for your software. This key is used to sign the digital license.\n\n Authority key is essentially RSA keypair with `:` seperator. Format of this key can be defined as:\n\n ```\n base64_encode(\n  pem_format(\n    rsa_private_key\n  )\n ):base64_encode(\n  pem_format(\n    rsa_public_key\n  )\n )\n ```\n\nYou can use [ripe](https://github.com/abumq/ripe) command to generate new authority key or you can use openssl CLI tool to do so\n```\nripe -g --rsa --length 2048 [--secret \u003csecret\u003e]\n```\n\nThis will generate something like:\n\n```\nLS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb2dJQkFBS0NBUUVBM0NGOENidXQyUlIvdXo4T3JmZ1VVNGtmTUdRZWtTNDQzbVVxQkFTeUpibjU3bmhPCllQbjA3N0hSaXZVNk9mYWp6YWFVRFVOZGFseDlFVmJ1YnYwNGQ0KzBHeTFMbDRPUXFITTg3eVRXSG81Z1JYbGcKNGlCeUFDRnVYMGVaNm1iSC9SWmFQcjZHT2ZrVTdJMVJ6V1dDUlYwc1IyN0N5Q1VkM0lScnduS2JSdzRUQkt0Tgpkakk5M3BncDZGWXN1UjFtU3FWSlVqWjhPY29EWTd1MHJUOStadEhMckQyeGh4YWE5N2RFOEtiMEJhbnlwMThaCmFORmY4M2pRbVZia0xra0F6c1RZczdyekRyVDNCbXN2SG1uTFlUTHBUSjM5SktLRmMvWXZBbjFQN3VWMDlXaG8KSTVPL2pyWXFoRmNEYTN0dkVCTkJPT3Z3aUhZZVZ2bjJuWW5QUXdJQkVRS0NBUUFNOHVrdHY3N3VwdHBXVHdEZApEcGZJcmJhS1lENElpaitVbklvQVBJTHpLUTZ6ckxsUS82VC9Dblc4NFQrcERvSWJKK3FYWGxES0JYREV5T0RaCldqQi9nT3g2RWJrbkI3MDNGZFpvYTVRZjZrSGwrQlRDQWVpV21JNEZtc3pSalpOTEgyNjRaWTlzMG1xa2dNaVQKbkk4eFFiZFBmdnhtSUUwTStMc0xjQ2RBYWlGZnBqdGtoK3d4Wm9UV29EMVQraXgyNGxQa3JBVHpiVXU4bDZwYgoyTW0xbGJnWE1icGIvaFdtcVR4TUFFcW9hVTNXS1lTb1RpQ2kwV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JibDY4NmlIcGVJCnhPOENnWUVBa21CWEV4dHZ0d3ZJOXhleEFpalVhS1dqalNiM2VnbS9rV3VXRjhVUmRxeTR4US80WVBYSTFuZUIKNlBlSjcrSkFIakJtNGlhTm9tMkptM3J2aVA3dStFMzlwNDhrSSszWlFpd2FzeTUyTmdkL3kxS3lJeFNTM2JFWApoZXdIQU1qbWh4YVh3R1c4TWJZbW4xSklsTWhzTmZIcUhHQ1lQNklYR3hzR0pqeXFJdmc9Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==\n```\n\nWhich is base64-encoded keypair seperated with `:`\n\n## Generate New Signature Key\nLicense++ signature key is what's used to sign the licensee's signature. This is to protect the information with AES-CBC-128. Signature key is defined in 128-bit array in [key register](/cli/licensing/license-manager-key-register.cc) (`LICENSE_MANAGER_SIGNATURE_KEY`)\n\nYou can use [ripe](https://github.com/abumq/ripe) to generate new key\n\n```\nripe -g --aes --length 128\n```\n\nThis will produce something like `82F36C25A912389ABFF8091C759303D2`. You then seperate each hex to create C++ array, i.e,\n\n```\n0x82, 0xF3, 0x6C, 0x25, 0xA9, 0x12, 0x38, 0x9A, 0xBF, 0xF8, 0x09, 0x1C, 0x75, 0x93, 0x03, 0xD2\n```\n\nYou can use this to generate a copy-pastable line\n```\nripe -g --aes --length 128 | sed -E 's/(..)/0x\\1, /g' | tr -d '\\n' | sed 's/, $//'\n```\nwhich will produce desired output like:\n\n```\n0x82, 0xF3, 0x6C, 0x25, 0xA9, 0x12, 0x38, 0x9A, 0xBF, 0xF8, 0x09, 0x1C, 0x75, 0x93, 0x03, 0xD2\n```\n\nThis will now go in to the key register.\n\n## CLI\nCLI tool provide ability to generate new licenses and validate existing license. Each CLI tool's version is linked directly with your version of key register.\n\n[See dedicated README](/cli)\n\n### Issue New License\n```\n./license-manager --issue --licensee john-citizen --period 3600 --authority sample-license-authority [--signature \u003csignature\u003e] [--additional-payload \u003csome string\u003e] \n```\n\n### Validate License\n\n```\n./license-manager --validate license.file [--signature \u003csignature\u003e]\n```\n\nThe validate checks for the following things:\n\n - The license was issued by authorised license issuing authority\n - License has been tampered with\n - The license is still valid\n - In case of signed license, the signature is valid\n\n## License Format\nLicenses generated using License++ are base64 encoded JSON. They look like as follows:\n\n```\n{\n    \"authority_signature\":\"632DBBF8BC35A2CAA8CBC2952615839F86A40965A00D6F7420BEFF3DA1D35B9E360B5781D326AD6853991BB31452290FF3415C788255B33D391373A4AA9590E0849C8649FCFC98A6DC827DE2CE61AF15DE21E62E069CE1DB20C72352E6C15A825C0A8140CE42FE7B56C1A53981B3598EEE3AD4EDDD07461269AFC2C8B25B4BDD0C7E6A92986E2F0EAEC5E7C4C673C47AB25B3EE46EF0F3B9C8120865B63E68A505DBC2E85F0646BDF3FD082CA62BB647A0BEFF34E0C7CCE40BD84EABFEA7D902A26D33ADA01F75E7291EC35472B4ED328E0E3AE654E85AAEAEB3FFC9E5A7DE4CB08C9ADAC803367DC2845821E0C310BA26EA26DB3196A65445528AABF45888F6\",\n    \"expiry_date\":1528386596,\n    \"issue_date\":1515426596,\n    \"issuing_authority\":\"sample-license-authority\",\n    \"licensee\":\"john-citizen\",\n    \"licensee_signature\":\"61663531383163626334303566613461363362343232316632663764393638383A35574F4F4C466B532F7A4F79376446364F6155776C673D3D0D0A0D0A\",\n    \"additional_payload\":\"SomeTestData\"\n}\n```\n\n### Format Explained\n\n | Item | Description |\n | ---- | ----------- |\n | `authority_signature` | Signature of the authority which prevents alteration in the license |\n | `expiry_date` | License expiry date epoch |\n | `issue_date` | License issue date epoch |\n | `issuing_authority` | ID of issuing authority as per key register |\n | `licensee` | Name of the license holder |\n | `licensee_signature` | If licensee signed this license this is encrypted against key provided in key register. All the licenses signed by licensee will be validated against it at validation time. |\n | `additional_payload` | Any string to be embedded into the license |\n\n## License\n```\nCopyright (c) 2018-present @abumq (Majid Q.)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n [banner]: https://github.com/abumq/licensepp/raw/master/licensepp.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabumq%2Flicensepp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabumq%2Flicensepp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabumq%2Flicensepp/lists"}