{"id":16759554,"url":"https://github.com/cyrildever/crumbl-signer","last_synced_at":"2025-03-23T15:31:10.241Z","repository":{"id":65344662,"uuid":"295966678","full_name":"cyrildever/crumbl-signer","owner":"cyrildever","description":"Easy signer server for the Crumbl platform","archived":false,"fork":false,"pushed_at":"2025-02-15T17:37:16.000Z","size":736,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T21:51:01.261Z","etag":null,"topics":["cryptography","data-masking","javascript-library","signing-trusted","storage-api","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cyrildever.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":"2020-09-16T08:09:34.000Z","updated_at":"2025-02-15T17:37:19.000Z","dependencies_parsed_at":"2024-09-12T18:26:54.157Z","dependency_job_id":"c9f053cd-b7d1-408e-bf25-9613997ba012","html_url":"https://github.com/cyrildever/crumbl-signer","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.2142857142857143,"last_synced_commit":"e429d2be1adb456e306403e08cdcb46b0aa8e4de"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fcrumbl-signer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fcrumbl-signer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fcrumbl-signer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fcrumbl-signer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrildever","download_url":"https://codeload.github.com/cyrildever/crumbl-signer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122737,"owners_count":20564364,"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":["cryptography","data-masking","javascript-library","signing-trusted","storage-api","typescript-library"],"created_at":"2024-10-13T04:08:26.284Z","updated_at":"2025-03-23T15:31:10.213Z","avatar_url":"https://github.com/cyrildever.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crumbl-signer\n_Easy signer server for the Crumbl\u0026trade; platform_\n\n![Github tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/crumbl-signer)\n![npm](https://img.shields.io/npm/dw/crumbl-signer)\n![Github last commit](https://img.shields.io/github/last-commit/cyrildever/crumbl-signer)\n![Github issues](https://img.shields.io/github/issues/cyrildever/crumbl-signer)\n![NPM](https://img.shields.io/npm/l/crumbl-signer)\n\nThis application is an easy signer server for the Crumbl\u0026trade; platform patented by Cyril Dever.\n\n### Usage\n\n1. Either you have set your own MongoDB environment compatible with the `crumbl-signer`'s requirements:\n    ```console\n    npm i crumbl-signer \u0026\u0026 npm run compile \u0026\u0026 npm start\n    ```\n\n2. Or you start the Docker container:\n    ```console\n    git clone https://github.com/cyrildever/crumbl-signer.git \u0026\u0026 cd crumbl-signer \u0026\u0026 docker-compose up --build -d\n    ```\n    You might want to use the `./cleanup` script (or `./cleanup.bat` on Windows) before launching any new Docker session (especially when you've built the NPM project).\n\nRunning the application will write a 'crumbl-signer.log' file in the main folder.\n\n#### Production\n\nChange or adapt the following environment variables every time you launch a new session if need be:\n* `HTTP_PORT`: the listening HTTP port number (default: 4000);\n* `MONGO_DOMAIN`: the MongoDB domain (default: localhost);\n* `MONGO_PORT`: the MongoDB port number (default: 27017);\n* `MONGO_DB`: the name of the MongoDB database (default: crumbl);\n* `MONGO_USERNAME`: the username to access the MongoDB database;\n* `MONGO_PASSWORD`: the user password for the MongoDB database;\n* `MONGO_COLLECTION`: the name of the collection to use (default: signer);\n* `SESSION_SEED`: the hexadecimal string representation of the initial seed.\n\nTo generate a new seed for a session, you might want to use the following snippet:\n```typescript\nimport { generateNewSessionSeedPath } from 'crumbl-signer'\n\nconst seedPath = generateNewSessionSeedPath()\nconst sessionSeed = seedPath.seed\nconsole.log(sessionSeed)\n```\n\n_NB: Beware that modifying the seed will reset the path leant to it._\n\n\n### API\n\nThe following endpoints are available:\n\n* `GET /lastPubKey`\n\nThis endpoint generates the request ID and the signer's last public key to use for the Crumbl\u0026trade; encryption, eg. `http://localhost:4000/lastPubKey`.\n\nIt expects three mandatory HTTP headers (as only registered users should ever call for a new pub key):\n - `X-User-ID`: the ID of the requesting user;\n - `X-User-PubKey`: the public key of the user;\n - `X-User-Secret`: the API secret of the user.\n eg.\n ```http\n    GET /lastPubKey HTTP/1.1\n    X-User-ID: 123456abcdef123456abcdef123456abcdef123456abcdef\n    X-User-PubKey: yourPublicKey\n    X-User-Secret: yourAPISecret\n    User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)\n    Host: crumbl.io\n    Accept-Language: fr-FR\n    Accept-Encoding: gzip, deflate\n    Connection: Keep-Alive\n  ```\n\nIt returns a `412` status code in case these HTTP headers are either missing or wrong.\nOtherwise, it returns a `200` status code along with a JSON object in the body respecting the following format:\n```json\n{\n  \"encryptionAlgorithm\": \"ecies\",\n  \"publicKey\": \"\u003cThe ECIES decompressed public key in hexadecimal representation\u003e\",\n  \"requestId\": \"\u003cThe requestId to use when recording the crumbl (see below)\u003e\"\n}\n```\n\n_// TODO Add RSA support._\n\n* `GET /uncrumbs`\n\nThis endpoint deciphers the passed crumbled string if the signer had signed one or more of its crumbs.\nIt expects the 4 following mandatory URI-encoded arguments in the query string: (eg. `http://localhost:4000/uncrumbs?dataId=123456789abcdef\u0026crumbl=9876543210fedcba[...]\u0026verificationHash=9876543210fedcba[...]\u0026token=12345678-90ab-cdef-1234-567890abcdef1`)\n  * `dataId`: the data ID related to the crumbled string (in hash format);\n  * `crumbl`: the full crumbled string;\n  * `verificationHash`: the hash of the original source (not to be confused with the initial hashered source of the crumbled string);\n  * `token`: a valid token (in UUID format).\n\nIt returns a `200` status code along with the partial uncrumb as a plain text body if deciphered any, `400` if any query argument is missing, or a `404` status code if it's not a signer.\n\n* `POST /crumbl`\n\nThis endpoint records the data ID in the local database to keep track of its relation with the public key used when crumbling the data.\nCalling it is necessary to make the crumbl decipherable in time.\nIt expects the request body to be a JSON object respecting the following format:\n```json\n{\n  \"dataId\": \"\u003cA custom ID using a hash string\u003e\",\n  \"requestId\": \"\u003cThe requestId generated through the /lastPubKey endpoint (see above)\u003e\"\n}\n```\n\nIt returns a `201` status code if everything went well.\n\n\nAs usual, all endpoints return a `500` status code if an error occurred on the server side.\n\n\n### License\n\nThe use of the crumbl-signer server is subject to fees for commercial purpose and to the respect of the [BSD2-Clause-Patent license](LICENSE). \\\nPlease [contact me](mailto:cdever@pep-s.com) to get further information.\n\n\n\u003chr /\u003e\n\u0026copy; 2020-2025 Cyril Dever. All rights reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrildever%2Fcrumbl-signer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrildever%2Fcrumbl-signer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrildever%2Fcrumbl-signer/lists"}