{"id":21586069,"url":"https://github.com/magiclen/rust-short-crypt","last_synced_at":"2026-03-18T02:31:18.326Z","repository":{"id":57667278,"uuid":"146159885","full_name":"magiclen/rust-short-crypt","owner":"magiclen","description":"ShortCrypt is a very simple encryption library, which aims to encrypt any data into something random at first glance.","archived":false,"fork":false,"pushed_at":"2025-11-24T11:03:46.000Z","size":38,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T12:24:29.966Z","etag":null,"topics":["rust","short-crypt"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/magiclen.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-08-26T07:17:35.000Z","updated_at":"2025-01-26T13:10:23.000Z","dependencies_parsed_at":"2024-11-24T18:01:09.954Z","dependency_job_id":null,"html_url":"https://github.com/magiclen/rust-short-crypt","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"e1fe906450fcb87a7a6561263443a82e95b25dda"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/magiclen/rust-short-crypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frust-short-crypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frust-short-crypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frust-short-crypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frust-short-crypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/rust-short-crypt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frust-short-crypt/sbom","scorecard":{"id":611826,"data":{"date":"2025-08-11","repo":{"name":"github.com/magiclen/rust-short-crypt","commit":"fecbcd8f8db11e58e769a24cc16b3b850e04991d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci-version.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.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":"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":"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/ci-version.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci-version.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci-version.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci-version.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-version.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci-version.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci-version.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci-version.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/magiclen/rust-short-crypt/ci.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 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":"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":"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":"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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-21T02:50:56.131Z","repository_id":57667278,"created_at":"2025-08-21T02:50:56.131Z","updated_at":"2025-08-21T02:50:56.131Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30642995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-18T01:41:58.583Z","status":"online","status_checked_at":"2026-03-18T02:00:07.824Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["rust","short-crypt"],"created_at":"2024-11-24T15:12:33.622Z","updated_at":"2026-03-18T02:31:18.299Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","readme":"ShortCrypt\n====================\n\n[![CI](https://github.com/magiclen/rust-short-crypt/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/rust-short-crypt/actions/workflows/ci.yml)\n\nShortCrypt is a very simple encryption library, which aims to encrypt any data into something random at first glance.\nEven if these data are similar, the ciphers are still pretty different.\nThe most important thing is that a cipher is only **4 bits** larger than its plaintext so that it is suitable for data used in a URL or a QR Code. Besides these, it is also an ideal candidate for serial number generation.\n\n## Examples\n\n`encrypt` method can create a `Cipher` tuple separating into a **base** and a **body** of the cipher. The size of a **base** is 4 bits, and the size of a **body** is equal to the plaintext.\n\n```rust\nuse short_crypt::ShortCrypt;\n\nlet sc = ShortCrypt::new(\"magickey\");\n\nassert_eq!((8, [216, 78, 214, 199, 157, 190, 78, 250].to_vec()), sc.encrypt(\"articles\"));\nassert_eq!(\"articles\".as_bytes().to_vec(), sc.decrypt(\u0026(8, vec![216, 78, 214, 199, 157, 190, 78, 250])).unwrap());\n\n```\n\n`encrypt_to_url_component` method is common for encryption in most cases. After ShortCrypt `encrypt` a plaintext, it encodes the cipher into a random-like string based on Base64-URL format so that it can be concatenated with URLs.\n\n```rust\nuse short_crypt::ShortCrypt;\n\nlet sc = ShortCrypt::new(\"magickey\");\n\nassert_eq!(\"2E87Wx52-Tvo\", sc.encrypt_to_url_component(\"articles\"));\nassert_eq!(\"articles\".as_bytes().to_vec(), sc.decrypt_url_component(\"2E87Wx52-Tvo\").unwrap());\n```\n\n`encrypt_to_qr_code_alphanumeric` method is usually used for encrypting something into a QR code. After ShortCrypt `encrypt` a plaintext, it encodes the cipher into a random-like string based on Base32 format so that it can be inserted into a QR code with the compatibility with alphanumeric mode.\n\n```rust\nuse short_crypt::ShortCrypt;\n\nlet sc = ShortCrypt::new(\"magickey\");\n\nassert_eq!(\"3BHNNR45XZH8PU\", sc.encrypt_to_qr_code_alphanumeric(\"articles\"));\nassert_eq!(\"articles\".as_bytes().to_vec(), sc.decrypt_qr_code_alphanumeric(\"3BHNNR45XZH8PU\").unwrap());\n```\n\nBesides, in order to reduce the copy times of strings, you can also use `encrypt_to_url_component_and_push_to_string`, `encrypt_to_qr_code_alphanumeric_and_push_to_string` methods to use the same memory space.\n\n```rust\nuse short_crypt::ShortCrypt;\n\nlet sc = ShortCrypt::new(\"magickey\");\n\nlet url = \"https://magiclen.org/\".to_string();\n\nassert_eq!(\"https://magiclen.org/2E87Wx52-Tvo\", sc.encrypt_to_url_component_and_push_to_string(\"articles\", url));\n\nlet url = \"https://magiclen.org/\".to_string();\n\nassert_eq!(\"https://magiclen.org/3BHNNR45XZH8PU\", sc.encrypt_to_qr_code_alphanumeric_and_push_to_string(\"articles\", url));\n```\n\n## Crates.io\n\nhttps://crates.io/crates/short-crypt\n\n## Documentation\n\nhttps://docs.rs/short-crypt\n\n## License\n\n[MIT](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Frust-short-crypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Frust-short-crypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Frust-short-crypt/lists"}