{"id":40870924,"url":"https://github.com/mderazon/node-fpe","last_synced_at":"2026-01-22T00:40:05.847Z","repository":{"id":46124721,"uuid":"74411410","full_name":"mderazon/node-fpe","owner":"mderazon","description":"Format preserving string substitution encryption","archived":false,"fork":false,"pushed_at":"2025-02-25T14:11:23.000Z","size":58,"stargazers_count":29,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T05:25:34.433Z","etag":null,"topics":["cipher","encryption","fpe"],"latest_commit_sha":null,"homepage":"","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/mderazon.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,"zenodo":null}},"created_at":"2016-11-21T22:27:07.000Z","updated_at":"2025-03-05T00:01:12.000Z","dependencies_parsed_at":"2024-06-18T16:39:23.064Z","dependency_job_id":"30fa4fb0-ac5a-48c2-8d59-decc0c0a0fab","html_url":"https://github.com/mderazon/node-fpe","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.19999999999999996","last_synced_commit":"0922f3badd95599f6834963ccd5d7212a22ee3f0"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mderazon/node-fpe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderazon%2Fnode-fpe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderazon%2Fnode-fpe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderazon%2Fnode-fpe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderazon%2Fnode-fpe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mderazon","download_url":"https://codeload.github.com/mderazon/node-fpe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mderazon%2Fnode-fpe/sbom","scorecard":{"id":632999,"data":{"date":"2025-08-11","repo":{"name":"github.com/mderazon/node-fpe","commit":"cf48faafaf663d01659984e58156eaed3e10773d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/mderazon/node-fpe/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/mderazon/node-fpe/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/mderazon/node-fpe/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mderazon/node-fpe/npm-publish.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/npm-publish.yml:9"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T08:24:45.165Z","repository_id":46124721,"created_at":"2025-08-21T08:24:45.165Z","updated_at":"2025-08-21T08:24:45.165Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"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":["cipher","encryption","fpe"],"created_at":"2026-01-22T00:40:05.298Z","updated_at":"2026-01-22T00:40:05.839Z","avatar_url":"https://github.com/mderazon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-fpe\n\n[![Build status](https://github.com/mderazon/node-fpe/actions/workflows/node.js.yml/badge.svg)](https://github.com/mderazon/node-fpe/actions) [![npm Version](https://badge.fury.io/js/node-fpe.svg)](https://badge.fury.io/js/node-fpe) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003e Format preserving string substitution encryption\n\nIn general, [format-preserving encryption](https://en.wikipedia.org/wiki/Format-preserving_encryption) is a type of encryption such that the output (the ciphertext) is in the same format as the input (the plaintext).\n\nThis library uses a simple [substitution cipher](https://en.wikipedia.org/wiki/Substitution_cipher) algorithm. Read more about the security of this library in the dedicated section below.\n\n## Usage\n\n### Example:\n\ncipher with default domain ([0-9])\n\n```js\nimport fpe from 'node-fpe';\nconst cipher = fpe({ secret: 'secret!' });\n\ncipher.encrypt('1234567');\n// '7130548'\n\ncipher.decrypt('7130548');\n// '1234567'\n```\n\ncipher with a custom domain ([A-E])\n\n```js\nimport fpe from 'node-fpe';\nconst cipher = fpe({ secret: 'secret!', domain: ['A', 'B', 'C', 'D', 'E'] });\n\ncipher.encrypt('BEEBEE');\n// 'ABBABB'\n\ncipher.decrypt('ABBABB');\n// 'BEEBEE'\n```\n\n### Options\n\nOptions to pass on to _node-fpe_ are:\n\n- `secret`: **mandatory**. a secret used in the underlying hash function.\n- `domain`: **optional**. an array of characters used as the FPE domain. **default**: 0-9 digits\n\n## Security\n\nThis module is using the term _format-preserving encryption_, however it is **not** a proper fpe implementation. It is basically a [substitution cipher](https://en.wikipedia.org/wiki/Substitution_cipher), you can use it to scramble and de-scramble strings but it is **not recommended to use it with anything sensitive** as the encryption is weak.\n\nFor fpe, there are other libraries available:\n\n- https://github.com/eCollect/node-fe1-fpe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmderazon%2Fnode-fpe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmderazon%2Fnode-fpe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmderazon%2Fnode-fpe/lists"}