{"id":19684218,"url":"https://github.com/elliotwutingfeng/balloon-hashing","last_synced_at":"2026-06-10T03:31:19.891Z","repository":{"id":164847043,"uuid":"603444827","full_name":"elliotwutingfeng/balloon-hashing","owner":"elliotwutingfeng","description":"Balloon Hashing implemented in Ruby.","archived":false,"fork":false,"pushed_at":"2026-05-30T12:28:17.000Z","size":136,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T14:11:00.609Z","etag":null,"topics":["crypto","cryptography","hash","kdf-algorithm","key-derivation-function","password","ruby","ruby-language"],"latest_commit_sha":null,"homepage":"https://crypto.stanford.edu/balloon","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotwutingfeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-02-18T14:35:34.000Z","updated_at":"2026-02-12T16:19:19.000Z","dependencies_parsed_at":"2026-01-10T17:41:36.739Z","dependency_job_id":null,"html_url":"https://github.com/elliotwutingfeng/balloon-hashing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elliotwutingfeng/balloon-hashing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fballoon-hashing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fballoon-hashing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fballoon-hashing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fballoon-hashing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotwutingfeng","download_url":"https://codeload.github.com/elliotwutingfeng/balloon-hashing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotwutingfeng%2Fballoon-hashing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34136112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":["crypto","cryptography","hash","kdf-algorithm","key-derivation-function","password","ruby","ruby-language"],"created_at":"2024-11-11T18:17:08.180Z","updated_at":"2026-06-10T03:31:19.876Z","avatar_url":"https://github.com/elliotwutingfeng.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Balloon Hashing\n\n[![Ruby](https://img.shields.io/badge/Ruby-CC342D?style=for-the-badge\u0026logo=ruby\u0026logoColor=white)](https://ruby-lang.org)\n[![Coveralls](https://img.shields.io/coverallsCoverage/github/elliotwutingfeng/balloon-hashing?logo=coveralls\u0026style=for-the-badge)](https://coveralls.io/github/elliotwutingfeng/balloon-hashing?branch=main)\n[![GitHub license](https://img.shields.io/badge/LICENSE-BSD--3--CLAUSE-GREEN?style=for-the-badge)](LICENSE)\n\nBalloon Hashing implemented in Ruby. All credit to Dan Boneh, Henry Corrigan-Gibbs, and Stuart Schechter. For more information see\nthe [research paper](https://eprint.iacr.org/2016/027.pdf) or their [website](https://crypto.stanford.edu/balloon/) for this project.\n\nThis is a direct port of the Python [implementation](https://github.com/nachonavarro/balloon-hashing) by [nachonavarro](https://github.com/nachonavarro).\n\n**Warning:** Please DO NOT use this code in production! It has not been tested rigorously for security vulnerabilities.\n\n## Background\n\nBalloon Hashing is a new hashing function that, according to the paper, is:\n\n* **Built from Standard Primitives:** Builds on top of other common hashing functions.\n* **Has Proven Memory-Hardness Properties:** See paper.\n* **Resistant to Cache Attacks:** The idea is that an adversary who can observe the memory access patterns of the buffer in the algorithm (for example through cached side-channels) still can't figure out the password being cached.\n* **Practical:** Is as good as the best hashing functions used in production today.\n\n## Algorithm\n\nThe algorithm consists of three main parts, as explained in the paper.\n\nThe first step is the expansion, in which the system fills up a buffer with pseudorandom bytes derived from the password and salt by computing repeatedly the hash function on a combination\nof the password and the previous hash.\n\nThe second step is mixing, in which the system mixes time_cost number of times the pseudorandom\nbytes in the buffer. At each step in the for loop, it updates the nth block to be the hash of the n-1th block, the nth block,\nand delta other blocks chosen at random from the buffer.\n\nIn the last step, the extraction, the system outputs as the hash the last element in the buffer.\n\n## Usage\n\n```ruby\nrequire './lib/balloon.rb'\n\npassword = 'buildmeupbuttercup'\nsalt = 'JqMcHqUcjinFhQKJ'\nballoon_hash(password, salt) # OUTPUT: 2ec8d833db5f88e584ab793950ecfb21657a3816edea8d9e73ea23c13ba2b740\n\ndelta = 5\ntime_cost = 18\nspace_cost = 24\nbs = balloon(password, salt, space_cost, time_cost, delta)\nbs.unpack1('H*') # OUTPUT: 69f86890cef40a7ec5f70daff1ce8e2cde233a15bffa785e7efdb5143af51bfb\n```\n\n## Testing\n\n```bash\ngem install bundler\nbundle install\nbundle exec rspec -r spec_helper\n```\n\n## Formatting\n\n```bash\ngem install bundler\nbundle install\nrubocop -a\n```\n\n## References\n\n* [Dart implementation](https://github.com/elliotwutingfeng/balloon_hashing)\n* [Julia implementation](https://github.com/elliotwutingfeng/BalloonHashing.jl)\n* [Kotlin implementation](https://github.com/elliotwutingfeng/balloon-hashing-kotlin)\n* [Python implementation](https://github.com/nachonavarro/balloon-hashing)\n* [Rust implementation](https://crates.io/crates/balloon-hash)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotwutingfeng%2Fballoon-hashing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotwutingfeng%2Fballoon-hashing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotwutingfeng%2Fballoon-hashing/lists"}