{"id":13413774,"url":"https://github.com/bobg/encid","last_synced_at":"2026-04-12T18:24:29.826Z","repository":{"id":57584590,"uuid":"371777391","full_name":"bobg/encid","owner":"bobg","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-13T16:27:15.000Z","size":37,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-13T18:10:09.995Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bobg.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-28T17:43:56.000Z","updated_at":"2025-11-13T16:26:59.000Z","dependencies_parsed_at":"2023-12-31T17:27:53.114Z","dependency_job_id":"11697c13-30c0-4a4b-a250-f87ef802ff52","html_url":"https://github.com/bobg/encid","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/bobg/encid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobg%2Fencid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobg%2Fencid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobg%2Fencid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobg%2Fencid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobg","download_url":"https://codeload.github.com/bobg/encid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobg%2Fencid/sbom","scorecard":{"id":246361,"data":{"date":"2025-08-11","repo":{"name":"github.com/bobg/encid","commit":"eeebbf7129e925a4da448ee50cf6653d04eeb544"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"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":"Code-Review","score":0,"reason":"Found 0/17 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":"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":"Maintained","score":0,"reason":"1 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/go.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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/bobg/encid/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/bobg/encid/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/bobg/encid/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/bobg/encid/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction 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":"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":"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T07:41:39.062Z","repository_id":57584590,"created_at":"2025-08-17T07:41:39.062Z","updated_at":"2025-08-17T07:41:39.062Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30032006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T03:27:35.548Z","status":"ssl_error","status_checked_at":"2026-03-03T03:27:09.213Z","response_time":61,"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":[],"created_at":"2024-07-30T20:01:48.996Z","updated_at":"2026-04-12T18:24:29.819Z","avatar_url":"https://github.com/bobg.png","language":"Go","funding_links":[],"categories":["安全","Security"],"sub_categories":["HTTP客户端","HTTP Clients"],"readme":"# Encid - encode and decode encrypted integer IDs\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/bobg/encid/v2.svg)](https://pkg.go.dev/github.com/bobg/encid/v2)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bobg/encid/v2)](https://goreportcard.com/report/github.com/bobg/encid/v2)\n[![Tests](https://github.com/bobg/encid/actions/workflows/go.yml/badge.svg)](https://github.com/bobg/encid/actions/workflows/go.yml)\n[![Coverage Status](https://coveralls.io/repos/github/bobg/encid/badge.svg?branch=master)](https://coveralls.io/github/bobg/encid?branch=master)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\nThis is encid,\na program and library for working with encrypted integer IDs.\n\nThe main use case is when you have a database\nthat assigns consecutive integer IDs to resources\nand you need to expose them publicly\nwithout revealing the actual values.\n\nFor example,\nsuppose you have a web-based service\nthat handles URLs of the form\nhttps://example.com/profile?user=17\nfor showing the profile page of a user.\nThis URL allows an attacker to guess other valid profile URLs\n(e.g., https://example.com/profile?user=1, https://example.com/profile?user=2, etc.),\nreveals that this user is probably the 17th one to have signed up,\nsuggests a possible relationship between users with ids close to each other,\nand via scraping can expose your total number of users\n(e.g., if there’s no https://example.com/profile?user=18,\nyou’ve probably got only 17 users).\n\nOn the other hand,\nif your service’s profile URLs look like\nhttps://example.com/profile?user=7pWwPc2rWTzsZX85s9KFgRW,\nthere is no way for an attacker to guess that the consecutively next profile URL is\nhttps://example.com/profile?user=bgnnCXYybm7q5FshMN4xYRT\nor to tell how close or far apart they are\nor to scrape all your profile URLs\nor to know how many users you have.\n\n## Installation and usage\n\nFor library usage please see\n[the Godoc](https://pkg.go.dev/github.com/bobg/encid/v2).\n\nTo install the CLI:\n\n```sh\ngo install github.com/bobg/encid/v2/cmd/encid@latest\n```\n\nCommand-line usage:\n\n```sh\nencid [-keystore FILE] enc [-50] TYPE NUM\nencid [-keystore FILE] dec [-50] ID STR\nencid [-keystore FILE] newkey TYPE\n```\n\nThe `-keystore` flag specifies the path to a database containing cipher keys for encrypting and decrypting IDs.\nBy default this lives under the `encid` directory in [os.UserConfigDir()](https://pkg.go.dev/os#UserConfigDir).\n\nEach cipher key is associated with an integer “type” whose meanings are user-defined.\nYou may choose to give all your keys the same type,\nor you might prefer to use different types for different resources\n(e.g. 1 for users, 2 for documents, etc).\n\nIn `enc` mode,\nyou specify a type and a number to encode.\nYou get back a “key ID” and the encoded string.\nThe latest cipher key for the given type is used.\nIf no cipher key exists in the keystore for the given type,\none is created.\n\n```sh\n$ encid enc 1 17\n4 d7w90xn4pfk9rfqw9d4wc0zdn0\n```\n\nIn `dec` mode,\nyou specify a key ID and an encoded string.\nYou get back a type and the decoded number.\n\n```sh\n$ encid dec 4 d7w90xn4pfk9rfqw9d4wc0zdn0\n1 17\n```\n\nIn `newkey` mode,\nyou specify a type.\nA new random cipher key with that type\nis added to the keystore.\n\nThe encoding uses base 30 by default.\nThe `-50` flag causes base 50 to be used instead.\nFor more information about these encodings\nplease see [basexx](https://pkg.go.dev/github.com/bobg/basexx/v2#pkg-variables).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobg%2Fencid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobg%2Fencid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobg%2Fencid/lists"}