{"id":26933557,"url":"https://github.com/ppad-tech/pbkdf","last_synced_at":"2025-04-02T09:19:37.566Z","repository":{"id":279188171,"uuid":"937965713","full_name":"ppad-tech/pbkdf","owner":"ppad-tech","description":"(mirror of https://git.ppad.tech/pbkdf)","archived":false,"fork":false,"pushed_at":"2025-02-24T08:30:37.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T09:31:42.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/ppad-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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":"2025-02-24T07:53:12.000Z","updated_at":"2025-02-24T08:30:41.000Z","dependencies_parsed_at":"2025-02-24T09:41:55.512Z","dependency_job_id":null,"html_url":"https://github.com/ppad-tech/pbkdf","commit_stats":null,"previous_names":["ppad-tech/pbkdf"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fpbkdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fpbkdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fpbkdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fpbkdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppad-tech","download_url":"https://codeload.github.com/ppad-tech/pbkdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785456,"owners_count":20833498,"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","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":"2025-04-02T09:19:36.950Z","updated_at":"2025-04-02T09:19:37.548Z","avatar_url":"https://github.com/ppad-tech.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pbkdf\n\n[![](https://img.shields.io/hackage/v/ppad-pbkdf?color=blue)](https://hackage.haskell.org/package/ppad-pbkdf)\n![](https://img.shields.io/badge/license-MIT-brightgreen)\n[![](https://img.shields.io/badge/haddock-pbkdf-lightblue)](https://docs.ppad.tech/pbkdf)\n\nA password-based key derivation function (PBKDF2) per\n[RFC2898](https://datatracker.ietf.org/doc/html/rfc2898).\n\n## Usage\n\nA sample GHCi session:\n\n```\n  \u003e :set -XOverloadedStrings\n  \u003e -- import qualified\n  \u003e import qualified Crypto.KDF.PBKDF as KDF\n  \u003e\n  \u003e -- supply your own HMAC function\n  \u003e import qualified Crypto.Hash.SHA256 as SHA256\n  \u003e\n  \u003e -- derive a 32-byte key from a secret\n  \u003e KDF.derive SHA256.hmac \"my password\" \"my salt\" 100 32\n  \"\\\"\\NAKqxp\\165S\\t\\212i\\139\\SUB(\\132\\176\\204\\224\u003c\\164\\177\\144\\\u00261D\\209\\175\\145\\139[K\\159h\\205\"\n```\n\n## Documentation\n\nHaddocks (API documentation, etc.) are hosted at\n[docs.ppad.tech/pbkdf][hadoc].\n\n## Performance\n\nThe aim is best-in-class performance for pure, highly-auditable Haskell\ncode.\n\nCurrent benchmark figures on my mid-2020 MacBook Air look like (use\n`cabal bench` to run the benchmark suite):\n\n```\n  benchmarking ppad-pbkdf/PBKDF-SHA256/derive (outlen 32)\n  time                 533.2 μs   (490.9 μs .. 579.9 μs)\n                       0.967 R²   (0.941 R² .. 0.993 R²)\n  mean                 494.0 μs   (480.3 μs .. 518.3 μs)\n  std dev              57.73 μs   (38.72 μs .. 98.81 μs)\n  variance introduced by outliers: 81% (severely inflated)\n\n  benchmarking ppad-pbkdf/PBKDF-SHA512/derive (outlen 32)\n  time                 241.2 μs   (233.4 μs .. 249.6 μs)\n                       0.991 R²   (0.987 R² .. 0.995 R²)\n  mean                 233.6 μs   (227.8 μs .. 240.1 μs)\n  std dev              20.22 μs   (16.95 μs .. 24.39 μs)\n  variance introduced by outliers: 74% (severely inflated)\n```\n\n## Security\n\nThis library aims at the maximum security achievable in a\ngarbage-collected language under an optimizing compiler such as GHC, in\nwhich strict constant-timeness can be [challenging to achieve][const].\n\nThe PBKDF implementation within has been tested against the [Project\nWycheproof vectors][wyche] available for SHA-256 and SHA-512, using\nthe HMAC functions from [ppad-sha256][sh256] and [ppad-sha512][sh512]\nrespectively.\n\nIf you discover any vulnerabilities, please disclose them via\nsecurity@ppad.tech.\n\n## Development\n\nYou'll require [Nix][nixos] with [flake][flake] support enabled. Enter a\ndevelopment shell with:\n\n```\n$ nix develop\n```\n\nThen do e.g.:\n\n```\n$ cabal repl ppad-pbkdf\n```\n\nto get a REPL for the main library.\n\n[nixos]: https://nixos.org/\n[flake]: https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html\n[hadoc]: https://docs.ppad.tech/pbkdf\n[sh256]: https://git.ppad.tech/sha256\n[sh512]: https://git.ppad.tech/sha512\n[const]: https://www.chosenplaintext.ca/articles/beginners-guide-constant-time-cryptography.html\n[wyche]: https://github.com/C2SP/wycheproof\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fpbkdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppad-tech%2Fpbkdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fpbkdf/lists"}