{"id":19077903,"url":"https://github.com/backendstack21/jwt-keys-generator-api","last_synced_at":"2025-04-30T04:34:15.970Z","repository":{"id":104003701,"uuid":"587899810","full_name":"BackendStack21/jwt-keys-generator-api","owner":"BackendStack21","description":"A simple and secure JSON Web Token (JWT) signing/verification keys generator that uses OpenSSL.","archived":false,"fork":false,"pushed_at":"2025-02-12T18:43:40.000Z","size":161,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T20:49:17.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BackendStack21.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null},"funding":{"custom":"https://www.paypal.me/kyberneees"}},"created_at":"2023-01-11T21:10:12.000Z","updated_at":"2025-03-10T01:35:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f901b3f-c307-4bb8-a7b7-fbbc33bfa9b1","html_url":"https://github.com/BackendStack21/jwt-keys-generator-api","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackendStack21%2Fjwt-keys-generator-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackendStack21%2Fjwt-keys-generator-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackendStack21%2Fjwt-keys-generator-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackendStack21%2Fjwt-keys-generator-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BackendStack21","download_url":"https://codeload.github.com/BackendStack21/jwt-keys-generator-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251643970,"owners_count":21620586,"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":[],"created_at":"2024-11-09T02:03:57.224Z","updated_at":"2025-04-30T04:34:15.952Z","avatar_url":"https://github.com/BackendStack21.png","language":"JavaScript","funding_links":["https://www.paypal.me/kyberneees"],"categories":[],"sub_categories":[],"readme":"# JWT Keys Generator API\n[![tests](https://github.com/BackendStack21/jwt-keys-generator-api/actions/workflows/tests.yaml/badge.svg)](https://github.com/BackendStack21/jwt-keys-generator-api/actions/workflows/tests.yaml)\n[![build images](https://github.com/BackendStack21/jwt-keys-generator-api/actions/workflows/build_images.yaml/badge.svg?branch=main)](https://github.com/BackendStack21/jwt-keys-generator-api/actions/workflows/build_images.yaml)\n\n\u003cimg src=\"logo.svg\" width=\"400\"\u003e  \n\n*A simple and secure JSON Web Token (JWT) signing/verification keys generator that uses OpenSSL.*\n\u003e WE DON'T DO tracking, tracing or logging of API usage!  \n\u003e This is an API for the community 💚 \n\nThis project allows Web browser and API clients to easily generate JWT signing/verification keys supported by the [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) library. The following algorithms are currently supported:\n\n| alg Parameter Value | Digital Signature or MAC Algorithm                                     |\n|---------------------|------------------------------------------------------------------------|\n| HS256               | HMAC using SHA-256 hash algorithm                                      |\n| HS384               | HMAC using SHA-384 hash algorithm                                      |\n| HS512               | HMAC using SHA-512 hash algorithm                                      |\n| RS256               | RSASSA-PKCS1-v1_5 using SHA-256 hash algorithm                         |\n| RS384               | RSASSA-PKCS1-v1_5 using SHA-384 hash algorithm                         |\n| RS512               | RSASSA-PKCS1-v1_5 using SHA-512 hash algorithm                         |\n| PS256               | RSASSA-PSS using SHA-256 hash algorithm (only node ^6.12.0 OR \u003e=8.0.0) |\n| PS384               | RSASSA-PSS using SHA-384 hash algorithm (only node ^6.12.0 OR \u003e=8.0.0) |\n| PS512               | RSASSA-PSS using SHA-512 hash algorithm (only node ^6.12.0 OR \u003e=8.0.0) |\n| ES256               | ECDSA using P-256 curve and SHA-256 hash algorithm                     |\n| ES384               | ECDSA using P-384 curve and SHA-384 hash algorithm                     |\n| ES512               | ECDSA using P-521 curve and SHA-512 hash algorithm                     |\n\n\u003e See: https://github.com/auth0/node-jsonwebtoken/blob/master/README.md#algorithms-supported\n\n## Considerations:\n* For `RS*` and `PS*` algorithms, RSA keys are generated. The key size can be 1024, 2048, 3072 or 4096 bits. \n* For `HS*` keys, there is only private key (aka `secret`) and it is randomly generated using OpenSSL. \n* All keys are expected to be generated on the backend using `OpenSSL` to increase security. \n\n## Frontend \n- Official Frontend URL: https://jwt-keys.21no.de/\n\n## Backend API\n- Official URL: `https://jwt-keys.21no.de/api/generate/ALGORITHM?bytes=BYTES\u0026bits=BITS`\n\n### Examples:\n- Generate RS256 key pair: https://jwt-keys.21no.de/api/generate/RS256?bits=2048\n- Generate PS256 key pair: https://jwt-keys.21no.de/api/generate/PS256?bits=2048\n- Generate HS256 key pair: https://jwt-keys.21no.de/api/generate/HS256?bytes=32\n- Generate ES512 key pair: https://jwt-keys.21no.de/api/generate/ES512\n\n### Parameters\n#### bytes (optional)\nFor HMAC (HS*) secret keys, we need to pass the number of random bytes to be generated. \nSupported values: bytes \u003e= 12 \u0026\u0026 bytes \u003c= 160\n\nThe `bytes` query parameter is optional and only used for HS* algorithms. Default value is: 32\n\n#### bits (optional)\n\u003e See: https://github.com/certbot/certbot/issues/2080  \n\nSupported values, one of: 1024, 2048, 3072, 4096\n\nThe `bits` query parameter is optional and only used for RS* and PS* algorithms. Default value is: 3072\n\n# Run it using Docker\nDocker image is publicly available so you can run it on your own infrastructure:\n```bash\ndocker run --rm -p 3000:3000 kyberneees/jwt-keys-generator-api:latest\n```\nThen:\n```bash\ncurl -s http://localhost:3000/api/generate/ES512 | jq \".\"\n```\n\n## Keys Generator Script \nAlternatively, you can use the following script which also uses Docker:\n```bash\n#!/bin/bash\nALGO=\"${1:-RS256}\"\necho \"Algorihtm: $ALGO\"\n\necho \"\u003e launching container...\"\ndocker run -d -p 3000:3000 --name jwt-keys kyberneees/jwt-keys-generator-api \u003e /dev/null\nsleep 1\n\necho \"\u003e generating keys...\"\ncurl -s http://localhost:3000/api/generate/$ALGO | jq \".\"\n\necho \"\u003e terminating container...\"\ndocker rm --force jwt-keys \u003e /dev/null\n```\n\u003e NOTE: Please note that only the `algorithm` argument is supported in the script!\n\nUsage: \n```bash\nsh gen-keys.sh ES512\n```\n\n# LICENSE\n\n```\nMIT License\n\nCopyright (c) 2023 21no.de\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackendstack21%2Fjwt-keys-generator-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackendstack21%2Fjwt-keys-generator-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackendstack21%2Fjwt-keys-generator-api/lists"}