{"id":35761334,"url":"https://github.com/perfectsiderepos/perfectbcrypt","last_synced_at":"2026-01-06T23:04:01.024Z","repository":{"id":26132211,"uuid":"107425466","full_name":"PerfectSideRepos/PerfectBCrypt","owner":"PerfectSideRepos","description":"Swift Wrapper of bcrypt (BlowFish)","archived":false,"fork":false,"pushed_at":"2022-05-24T16:17:51.000Z","size":31,"stargazers_count":5,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-09-03T16:30:29.142Z","etag":null,"topics":["bcrypt","perfect","swift"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PerfectSideRepos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-18T15:13:42.000Z","updated_at":"2023-09-03T16:30:29.142Z","dependencies_parsed_at":"2022-08-25T01:50:24.558Z","dependency_job_id":null,"html_url":"https://github.com/PerfectSideRepos/PerfectBCrypt","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/PerfectSideRepos/PerfectBCrypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectSideRepos%2FPerfectBCrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectSideRepos%2FPerfectBCrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectSideRepos%2FPerfectBCrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectSideRepos%2FPerfectBCrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerfectSideRepos","download_url":"https://codeload.github.com/PerfectSideRepos/PerfectBCrypt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerfectSideRepos%2FPerfectBCrypt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28229686,"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","status":"online","status_checked_at":"2026-01-06T02:00:07.049Z","response_time":56,"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":["bcrypt","perfect","swift"],"created_at":"2026-01-06T23:03:13.839Z","updated_at":"2026-01-06T23:04:01.014Z","avatar_url":"https://github.com/PerfectSideRepos.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perfect-BCrypt\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"http://perfect.org/get-involved.html\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://perfect.org/assets/github/perfect_github_2_0_0.jpg\" alt=\"Get Involed with Perfect!\" width=\"854\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/PerfectlySoft/Perfect\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://www.perfect.org/github/Perfect_GH_button_1_Star.jpg\" alt=\"Star Perfect On Github\" /\u003e\n    \u003c/a\u003e  \n    \u003ca href=\"http://stackoverflow.com/questions/tagged/perfect\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://www.perfect.org/github/perfect_gh_button_2_SO.jpg\" alt=\"Stack Overflow\" /\u003e\n    \u003c/a\u003e  \n    \u003ca href=\"https://twitter.com/perfectlysoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://www.perfect.org/github/Perfect_GH_button_3_twit.jpg\" alt=\"Follow Perfect on Twitter\" /\u003e\n    \u003c/a\u003e  \n    \u003ca href=\"http://perfect.ly\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://www.perfect.org/github/Perfect_GH_button_4_slack.jpg\" alt=\"Join the Perfect Slack\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://developer.apple.com/swift/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat\" alt=\"Swift 4.0\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://developer.apple.com/swift/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat\" alt=\"Platforms OS X | Linux\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://perfect.org/licensing.html\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat\" alt=\"License Apache\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://twitter.com/PerfectlySoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Twitter-@PerfectlySoft-blue.svg?style=flat\" alt=\"PerfectlySoft Twitter\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://perfect.ly\" target=\"_blank\"\u003e\n        \u003cimg src=\"http://perfect.ly/badge.svg\" alt=\"Slack Status\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n## Acknowledgement\n \nPerfect-BCrypt module is a Swift Wrapper of [bcrypt](https://github.com/pyca/bcrypt)\n\n## Issues\n\nWe are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.\n\nIf you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to [http://jira.perfect.org:8080/servicedesk/customer/portal/1](http://jira.perfect.org:8080/servicedesk/customer/portal/1) and raise it.\n\nA comprehensive list of open issues can be found at [http://jira.perfect.org:8080/projects/ISS/issues](http://jira.perfect.org:8080/projects/ISS/issues)\n\n## Building\n\nAdd this project as a dependency in your Package.swift file.\n\n```\n.Package(url: \"https://github.com/PerfectSideRepos/PerfectBCrypt.git\", majorVersion: 3)\n```\n\n## Quick Start\n\n\n### `BCrypt.Salt()`\n\nGenerate a \"salt\" string, for example, `let salt = BCrypt.Salt()` will return something like `$2b$12$yfG5ZTnTjg.HcgcI2o6Nhe`\n\n### `BCrypt.Hash()`\n\nGenerate shadow by password and salt. For example:\n\n``` swift\nlet password = \"Kk4DQuMMfZL9o\"\nlet salt = \"$2b$04$cVWp4XaNU8a4v1uMRum2SO\"\nlet hashed = try BCrypt.Hash(password, salt: salt)\n\n// the hashed result will be:\n// \"$2b$04$cVWp4XaNU8a4v1uMRum2SO026BWLIoQMD/TXg5uZV.0P.uO8m3YEm\"\n```\n\n\n### `BCrypt.Check()`\n\nVerify a password if matches with the previously generated hash:\n\n``` swift\nguard BCrypt.Check(password, hashed: shadow)) else {\n\t// Access Denied.\n}\n```\n\n### `BCrypt.KDF()`\n\nKDF is used in OpenSSH's newer encrypted private key format:\n\n``` swift\nlet derived = try BCrypt.KDF(\"password\", salt: \"salt\", \ndesiredKeyBytes: 32, rounds: 4, ignoreFewRounds: true)\n\n// derived will be a 32 byte UInt8 array\n// 0x5b, 0xbf, 0x0c, 0xc2, 0x93, 0x58, 0x7f, 0x1c,\n// 0x36, 0x35, 0x55, 0x5c, 0x27, 0x79, 0x65, 0x98,\n// 0xd4, 0x7e, 0x57, 0x90, 0x71, 0xbf, 0x42, 0x7e,\n// 0x9d, 0x8f, 0xbe, 0x84, 0x2a, 0xba, 0x34, 0xd9\n```\n\n## Further Information\n\nFor more documentation, please visit [perfect.org](http://www.perfect.org/docs/crypto.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperfectsiderepos%2Fperfectbcrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperfectsiderepos%2Fperfectbcrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperfectsiderepos%2Fperfectbcrypt/lists"}