{"id":16713178,"url":"https://github.com/picrap/pbkdf2","last_synced_at":"2025-03-15T05:18:50.628Z","repository":{"id":63526915,"uuid":"568366373","full_name":"picrap/Pbkdf2","owner":"picrap","description":"Flexible implementation for PBKDF2 (RFC2898)","archived":false,"fork":false,"pushed_at":"2022-12-26T11:11:22.000Z","size":119,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-27T08:35:37.705Z","etag":null,"topics":["pbkdf2"],"latest_commit_sha":null,"homepage":"","language":"C#","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/picrap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-20T10:03:52.000Z","updated_at":"2022-11-20T10:05:30.000Z","dependencies_parsed_at":"2023-01-31T00:01:04.540Z","dependency_job_id":null,"html_url":"https://github.com/picrap/Pbkdf2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picrap%2FPbkdf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picrap%2FPbkdf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picrap%2FPbkdf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picrap%2FPbkdf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picrap","download_url":"https://codeload.github.com/picrap/Pbkdf2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685881,"owners_count":20331035,"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":["pbkdf2"],"created_at":"2024-10-12T20:45:46.339Z","updated_at":"2025-03-15T05:18:50.610Z","avatar_url":"https://github.com/picrap.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pbkdf2\n\nThe same as [.NET implementation](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.rfc2898derivebytes), but with much more extensibility, such as other hashes and the ability to replace any algorithm part (at your own risk).\nAvailable as a [![NuGet](https://img.shields.io/nuget/v/Pbkdf2.svg?style=flat-square)](https://www.nuget.org/packages/Pbkdf2) package.\n\n# How to use it\n\n## Simple way\n\n```csharp\nvar saltBytes = new byte [] {1, 2, 3, 4, 5}; // use much more than this!\nvar hash = Pbkdf2.HashData(\"HMACSHA512\", \"my password\", saltBytes, \n           100000 /* iterations */, 32 /* hash size in bytes */);\n```\n\n## Full way\n\n```csharp\nvar saltBytes = new byte [] {1, 2, 3, 4, 5}; // use much more than this!\nusing var pbkdf2 = new HmacPbkdf2DeriveBytes(\"HMACSHA512\", \"my password\", saltBytes, \n           100000 /* iterations */);\nvar hash = pbkdf2.GetBytes(32 /* hash size in bytes */);\n```\n\n## Derive\n\nAll methods can be overriden so any part of hash can be replaced.\nThe idea is to avoid being brute forced by an ASIC, for example by simply adding a user block manipulation at `PseudoRandomFunction` or `ComputeBlockIteration`.\n\nCurrently there are three classes:\n- `Pbkdf2DeriveBytes` is the abstract class which requires only to add a pseudo-random function\n- `HmacPbkdf2DeriveBytes` is an implementation of `Pbkdf2DeriveBytes`, specific to use HMACs.\n- `ParallelHmacPbkdf2DeriveBytes` is an implementation of `Pbkdf2DeriveBytes`, specific to use HMACs and work in parallel (using PLINQ).\n\n# References\n\n- [RFC 2898](https://www.rfc-editor.org/rfc/rfc2898): the reference\n- [.NET implementation documentation](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.rfc2898derivebytes): our implementation works the same\n- [Wikipedia](https://en.wikipedia.org/wiki/PBKDF2): a human-readable description\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicrap%2Fpbkdf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicrap%2Fpbkdf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicrap%2Fpbkdf2/lists"}