{"id":18828413,"url":"https://github.com/dealfonso/lsc","last_synced_at":"2026-05-18T11:08:04.278Z","repository":{"id":118338080,"uuid":"148205880","full_name":"dealfonso/lsc","owner":"dealfonso","description":"License Shell Code (LSC) - an application to generate shell applications that need a license to run","archived":false,"fork":false,"pushed_at":"2018-09-13T07:07:57.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-10T17:52:24.492Z","etag":null,"topics":["bash","bash-script","encrypted-data","redistribution","shell-scripts"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dealfonso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2018-09-10T19:11:15.000Z","updated_at":"2023-04-23T16:28:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"81d04c8b-d633-40d0-b591-53344c7356e4","html_url":"https://github.com/dealfonso/lsc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dealfonso/lsc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dealfonso%2Flsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dealfonso%2Flsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dealfonso%2Flsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dealfonso%2Flsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dealfonso","download_url":"https://codeload.github.com/dealfonso/lsc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dealfonso%2Flsc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33175928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bash","bash-script","encrypted-data","redistribution","shell-scripts"],"created_at":"2024-11-08T01:24:57.989Z","updated_at":"2026-05-18T11:08:04.253Z","avatar_url":"https://github.com/dealfonso.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# License Shell Code (LSC)\nLSC is an application to generate shell applications that need a license to be run.\n\n## Why LSC?\n\nLSC is a proof of concept that enables to generate a signed script that needs a license (or password) to be run. It is just a generalization of the compression of _bash scripts_.\n\nHaving a bash script in file `example`, compressing it is very simple. You can just see the next commands that create the `example` script and generates a gzipped version:\n\n```console\n$ cat \u003e example \u003c\u003cEOT\n#!/bin/bash\n\necho \"hello world\"\nEOT\n$ cat \u003e compressedscript \u003c\u003cEOT\n#!/bin/bash\neval \"\\$(echo \"$(cat example | gzip | base64)\" | base64 -d | gunzip)\"\nEOT\n$ chmod +x compressedscript\n$ ./compressedscript\nhello world\n```\n\nLSC is just a generalization of that mechanism, that enables to encode the script using a password.\n\n**NOTES:** Providing your users with a LICENSE code give them a _more professional_ distribution, and a _more tailored_ solution. Getting the code also implies a knowledge of what they are doing and so it also includes a first barrier (both from the point of the knowledge and from the ethics).\n\n## Installation\n\nGet the proper package for your distribution in [this page]() and follow the instructions:\n\n**Ubuntu**\n\n```console\n$ apt update\n$ apt install ./lsc_0.1-0.deb\n```\n\n**Centos**\n\n```console\n$ yum update\n$ yum install ./lsc-0.1-0.noarch.rpm\n```\n\n**From source**\n\nYou can also get the source code and use it:\n\n```console\n$ git clone https://github.com/dealfonso/lsc\n$ cd lsc\n$ ./lsc -N mynewapp /path/to/my/original/script\n```\n\n## Configuration\nYou can adjust the template to use to generate the executables. At this moment, there are two templates included: `lsce.template` and `lscec.template` which stand for _LSC executable_ and _LSC executable compressed_.\n\nThey are the same code, but the `lscec` version is the compressed version of the `lsce` one. That compressed version gives the end-user a _magic like_ feeling because of the compression.\n\nFeel free to create your own templates, if you want. They just need to include the tags `\u003c\u003cAPPNAME\u003e\u003e` and `\u003c\u003cCODE\u003e\u003e` that will be substituted for the new application's ones.\n\nIn order to adjust the template to use, you just need to modify the file `/etc/lsc/lsc.conf` and set the path to the template to use:\n\n```bash\n# The template file (it has to include the \u003c\u003cAPPNAME\u003e\u003e and the \u003c\u003cCODE\u003e\u003e tags that will be replaced by lsc)\nTEMPLATE=/etc/lsc/lscec.template\n```\n\n## Example\n\nImagine that you have the next code in a file named **example**:\n\n```bash\n#!/bin/bash\n\necho \"hello world\"\n```\n\nThen you can apply **lsc** to generate the licensed code by issuing a command like the next one:\n\n```console\n$ lsc -N licensedexample example \nusing template 'lscec.template' found in file etc/lsc.conf\nOverwrite existing file licensedexample? (y/N) y\nb97c06f3-7aca-4ce4-9901-3d1a8b55095e\n\nYour new licensed application has been generated in file 'licensedexample'.\nPlease take note of your license number, because you need it to run\nyour application. The license number is unique for that application.\nHave in mind that if you lose that license, your application will be \nunusable.\n\nIn order to run your application, you can use the next command:\n\nLICENSE=b97c06f3-7aca-4ce4-9901-3d1a8b55095e ./licensedexample\n\nOtherwise you can create a config file in a common configuration place\nand put the next content:\n\nLICENSE=b97c06f3-7aca-4ce4-9901-3d1a8b55095e\n\ne.g. \n  /etc/licensedexample.conf\n  ~/.licensedexample.conf\n```\n\nThe result is a new file named **licensedexample** whose content is the next one:\n\n```bash\n#!/bin/bash\n\n# The encoded code\nLICENSEDCODE=\"U2FsdGVkX1/RCCmnB38BhWzuBym7nBqEEaMIuKe7ioRKG68jbywCI4zF/CGnktdsrmkrPtyttUxzxQ2zBMTtqYawGcmXGasniMOXlHIodRQ=\"\n# Config files where to find the LICENSE number\nCONFIGFILES=\"etc/licensedexample.conf etc/licensedexample/licensedexample.conf $HOME/.licensedexample.conf /etc/licensedexample.conf /etc/licensedexample/licensedexample.conf /etc/default/licensedexample.conf\"\n\nRUNTIME=\"H4sIANj4mFsAA2VUa0/bMBT9nl9xMBFtYSGANqSpDaPqY6royrRKfFgXIE2c1iK1OycBBmO/fXbi\npg/6pfZ9nHvPudeJcx5mTHAs76iUQtYbeLUAGs4FiH1JcHFwZr1Z8SpM0iAKBY/ZzEQmIgwS9AfD\n3qj9recR+5Qo60Qlr2wEngdC4AjswaFbHh8HBwozyyXHqcpL5yzOKtSb9o+xV4d9iUZlGxVG+3Vf\n/08u/bfK07ke9QdfPXIfBtlWkb9IaYRa6u4fH7rurLY23E7wK/N3jKXN3jS6t7Yb1e5JVWsIjivc\nqPvTnCW0kAXDJiKhTACLMdESDBX3f7idBM5L2/l555vDifP5zj/yjg9t+H4T2ZzyIg0Y9MdezauV\neKoAWq1WgWP8sZCo17l30uStQokmPzpqNKrC+qcLvxbq2Nx/K9W3r4zWU4X8YEIjwak56oZhczWe\n37ALYGw3htWCgLAZF5LxGR6DJKdFSwrexNEkpVVKwcK+MiRuSOWgz0shM+Va0WLWTvL7aisRiljd\nuoEtx07UkhYklFiDTm80rtZuzUN32umDcZgkvSLjSrv1amvUPoEBqia6ib23g73Vc8JCylMtTc4j\nXS/WO6IxTeR6ChUby5B/DyLFApQ/Min4gvKMWCrH2keXhiKiuj70wfo+bA9GneuufoN1835Nu11t\n1u9gGqT0/COcCGcXcCP66PI8SZRDLFWtNFF1Qu11Apo6Z5/OnXCq7opAEZtmkTo6Is+quz47D5vC\n7ADPcv7CllvWBojufxAj4H9QshVhmEtJow94ojWVGKRpvtDk1FNWDCUFSxFgKcU0oQs8sWxeMDci\nlaO3v8BRa3GyMZZ3avJ8MaVSo3GR6Q1mkR4KfWaZ+gCVyvaeaZhnG9JSFac4VgqT/zPG+Ck2BQAA\"\n\neval \"$(echo \"$RUNTIME\" | base64 -d | gunzip)\"\n```\n\nAnd now you can run the encoded application, provided that you provide the license number to it (whether in the environment LICENSE variable or in the config file):\n\n```console\n$ ./licensedexample \nlicense number is not valid\n$ LICENSE=b97c06f3-7aca-4ce4-9901-3d1a8b55095e ./licensedexample\nlicense from environment\nhello world\n```\n\n## FAQ\n\n**Q:** Is it safe for redistributing code?\n\n**A:** No. Once you have the license number, the code can be obtained from the file. In case that you want a binary solution in which it is harder to get the code, you should use solutions like [shc](https://github.com/neurobin/shc).\n\n**Q:** In which scenario would it be interesting?\n\n**A:** If you want to put your code in a public repository, but do not want to let others to use it. For those who want to obfuscate (or make harder to get) your code. Maybe others.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdealfonso%2Flsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdealfonso%2Flsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdealfonso%2Flsc/lists"}