{"id":26601336,"url":"https://github.com/philippmdoerner/nimword","last_synced_at":"2025-04-09T16:34:07.341Z","repository":{"id":109539030,"uuid":"594013795","full_name":"PhilippMDoerner/nimword","owner":"PhilippMDoerner","description":"A simple library with a simple interface to do password hashing with different algorithms","archived":false,"fork":false,"pushed_at":"2024-10-28T15:16:23.000Z","size":113,"stargazers_count":15,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T18:50:53.626Z","etag":null,"topics":["argon2","hashing","nim-lang","password-hash","pbkdf2","simple"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"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/PhilippMDoerner.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"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":"2023-01-27T11:49:54.000Z","updated_at":"2025-01-26T09:37:11.000Z","dependencies_parsed_at":"2024-10-28T16:26:14.227Z","dependency_job_id":"316bcb0d-5ba9-42cc-bfe6-07cac212f765","html_url":"https://github.com/PhilippMDoerner/nimword","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMDoerner%2Fnimword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMDoerner%2Fnimword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMDoerner%2Fnimword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMDoerner%2Fnimword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilippMDoerner","download_url":"https://codeload.github.com/PhilippMDoerner/nimword/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248067757,"owners_count":21042348,"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":["argon2","hashing","nim-lang","password-hash","pbkdf2","simple"],"created_at":"2025-03-23T18:39:16.914Z","updated_at":"2025-04-09T16:34:07.317Z","avatar_url":"https://github.com/PhilippMDoerner.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nimword\n#### A mini password hashing collection\n\n[![Run Tests](https://github.com/PhilippMDoerner/nimword/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/PhilippMDoerner/nimword/actions/workflows/tests.yml)\n\n[![github pages](https://github.com/PhilippMDoerner/nimword/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/PhilippMDoerner/nimword/actions/workflows/docs.yml)\n\n- [API index](https://philippmdoerner.github.io/nimword/nimword.html)\n\nThis package is a collection of functions for password hashing implemented by other packages, presented with a unified interface.\nIt is currently only tested for Linux, but *should* work for Windows as well assuming the same libraries are installed.\n\nCurrently available hashing algorithms:\n- PBKDF2 - HMAC with SHA256 from [openssl](https://nim-lang.org/docs/openssl.html)\n- PBKDF2 - HMAC with SHA512 from [openssl](https://nim-lang.org/docs/openssl.html)\n- Argon2 from [libsodium](https://github.com/FedericoCeratto/nim-libsodium)\n\n## Installation\nInstall Nimword with [Nimble](https://github.com/nim-lang/nimble):\n\n    $ nimble install -y nimword\n\nAdd Nimword to your .nimble file:\n\n    requires \"nimword\"\n\n\nIf you want to use argon2, ensure you have [libsodium](https://doc.libsodium.org/installation) installed. \n\nIf you want to use pbkdf2, ensure you have OpenSSL version 1 or 3 installed\n\n## Basic usage\nThe following will work for every module:\n```nim\nlet password: string = \"my-super-secret-password\"\nlet iterations: int = 3 # For Argon2 this is sensible, for pbkdf2 consider a number above 100.000\nlet encodedHash: string = hashEncodePassword(password, iterations)\n\nassert password.isValidPassword(encodedHash) == true\n```\n\n## Core-API\nThe core module of nimword provides the simple api of `hashEncodePassword` and `isValidPassword`:\n- `hashEncodePassword`:\n  Proc to create base64 encoded hashes and further encodes them in a specific format that can be stored in e.g. a database and used with `isValidPassword`.\n  Always takes the plain-text password, the algorithm to use for hashing and a number of iterations for the algorithm. Any further values needed by the algorithm will use sensible defaults. The salts for hashing will be generated and returned as part of the encoded string.\n- `isValidPassword`:\n  Proc to validate if a given password is identical to the one that was used to create an encoded hash. \n\nThese core procs are also available in the individual modules for each algorithm, there `hashEncodePassword` may expose further options depending on the algorithm.\n\nThe individual algorithm-modules further provide 2 procs in case some customization is needed:\n- `hashPassword`:\n  Proc to create unencoded raw hashes like `hashEncodePassword`, but returns the hash-bytes directly from there without turning it into a specific format like `hashEncodePassword` does.\n- `encodeHash`:\n  Proc to generate strings of the format that `hashEncodePassword` outputs, but without doing any of the hashing itself. The output can be used with `isValidPassword`.\n\n## Running tests\nYou can run the tests either locally or in a container:\n- `nimble test`\n- `nimble containerTest` - This assumes you have docker and docker-compose installed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippmdoerner%2Fnimword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilippmdoerner%2Fnimword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippmdoerner%2Fnimword/lists"}