{"id":15333927,"url":"https://github.com/LoginRadius/csharp-password-hash","last_synced_at":"2025-10-10T06:30:21.504Z","repository":{"id":56695627,"uuid":"297355853","full_name":"LoginRadius/csharp-password-hash","owner":"LoginRadius","description":".NET standard library to secure the passwords using multiple hashing algorithms.","archived":false,"fork":false,"pushed_at":"2024-03-26T09:19:31.000Z","size":53,"stargazers_count":9,"open_issues_count":10,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-12T21:11:28.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/LoginRadius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2020-09-21T13:56:37.000Z","updated_at":"2024-05-29T15:44:34.000Z","dependencies_parsed_at":"2024-04-17T02:58:14.567Z","dependency_job_id":"bf1b3226-2c1a-4678-aab5-250f75660bf9","html_url":"https://github.com/LoginRadius/csharp-password-hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LoginRadius/csharp-password-hash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fcsharp-password-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fcsharp-password-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fcsharp-password-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fcsharp-password-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LoginRadius","download_url":"https://codeload.github.com/LoginRadius/csharp-password-hash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fcsharp-password-hash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002960,"owners_count":26083489,"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":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-10-01T10:05:08.190Z","updated_at":"2025-10-10T06:30:21.159Z","avatar_url":"https://github.com/LoginRadius.png","language":"C#","funding_links":[],"categories":["LoginRadius Open Source Documentation"],"sub_categories":[],"readme":"# csharp-password-hash\n.NET standard library to secure the passwords using multiple hashing algorithms.\n\n## Features\n* Secure the passwords using different types of hashing algos\n* Uses of the different Encoding types\n* Generating random salt\n* Unit test cases to check the library fuctionality\n\n## Getting Started\n* Must have the latest version of the Visual Studio\n\nClone `csharp-password-hash` into your system using below commands:\n\nOpen command prompt and type below commands\n```\ngit clone https://github.com/LoginRadius/csharp-password-hash\ncd csharp-password-hash\ncsharp-password-hash.sln\n```\nIt will open the solution into the Visual Studio\n## Usage\nBelow are samples to show how you might use the library.\n\n### Create user model class\n```C#\npublic class User{\n  public string EmailId{get;set;}\n  public string Password{get;set;}\n}\n```\n### Create user object\n```C#\n//Create user object and set emailId and password properties\nvar userObject = new User\n{\n  EmailId = \"test@gmail.com\",\n  Password = \"Test#11\"\n};\n```\n### Example 1 - Create HashConfig object (When GeneratePerPasswordSalt is true)\n```C#\n//Create HashConfig object and set below properties\nvar hashConfig = new HashingConfig\n{\n  GeneratePerPasswordSalt = true, // This property is used when we have generate different password salt\n  GlobalSalt = null, // This is used when we have to use the same salt for every password\n  SaltedPasswordFormat = \"#PasswordPlaceHolder#--#SaltPlaceHolder#\",// Format which will be used in salted password \n  HashingAlgo = HashingAlgo.MD5, // Hashing algo which we want to use\n  PasswordHashEncodingType = EncodingType.Default // Encoding type for password hashing\n};\n```\n### Check password (When GeneratePerPasswordSalt is true)\n```C#\n//Combine the user object and HashConfig object (When GeneratePerPasswordSalt is true)\n//Create method to check password\npublic void ValidatePassword()\n{\n  var userObject = new User\n  {\n   EmailId = \"test@gmail.com\",\n   Password = \"Test#11\"\n  };\n  var hashConfig = new HashingConfig\n  {\n    GeneratePerPasswordSalt = true,\n    GlobalSalt = null,\n    SaltedPasswordFormat = \"#PasswordPlaceHolder#--#SaltPlaceHolder#\",\n    HashingAlgo = HashingAlgo.MD5,\n    PasswordHashEncodingType = EncodingType.Default\n  };\n  var passwordHashing = new PasswordHashing(); // Create password hashing object\n  var hash = passwordHashing.GetHash(userObject.Password, hashConfig); // GetHash for the password\n  var match = passwordHashing.CheckPassword(hash, hashConfig, userObject.Password); //Check password\n}\n```\n\n### Example 2 - Create HashConfig object (When GeneratePerPasswordSalt is false)\n```C#\n//In that case we have to set the GlobalSalt property\n//Create HashConfig object and set below properties\nvar hashConfig = new HashingConfig\n{\n  GeneratePerPasswordSalt = false, \\\n  GlobalSalt = SecureSalt, \n  SaltedPasswordFormat = \"#PasswordPlaceHolder#--#SaltPlaceHolder#\",\n  HashingAlgo = HashingAlgo.MD5, \n  PasswordHashEncodingType = EncodingType.Default \n};\n```\n### Check password (When GeneratePerPasswordSalt is false)\n```C#\n//Combine the user object and HashConfig object (When GeneratePerPasswordSalt is false)\n//Create method to check password\npublic void ValidatePassword()\n{\n  var userObject = new User\n  {\n   EmailId = \"test@gmail.com\",\n   Password = \"Test#11\"\n  };\n  var hashConfig = new HashingConfig\n  {\n    GeneratePerPasswordSalt = false,\n    GlobalSalt = \"SecureSalt\",\n    SaltedPasswordFormat = \"#PasswordPlaceHolder#--#SaltPlaceHolder#\",\n    HashingAlgo = HashingAlgo.MD5,\n    PasswordHashEncodingType = EncodingType.Default\n  };\n  var passwordHashing = new PasswordHashing(); // Create password hashing object\n  var hash = passwordHashing.GetHash(userObject.Password, hashConfig); // GetHash for the password\n  var match = passwordHashing.CheckPassword(hash, hashConfig, userObject.Password); //Check password\n}\n```\n\n## Contributing\nWould love any contributions by you, including better documentation, tests or more robust functionality. Please follow the [contributing guide](CONTRIBUTING.md)\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLoginRadius%2Fcsharp-password-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLoginRadius%2Fcsharp-password-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLoginRadius%2Fcsharp-password-hash/lists"}