{"id":16835328,"url":"https://github.com/defuse/passgenr","last_synced_at":"2025-04-11T04:36:48.507Z","repository":{"id":57653344,"uuid":"128444955","full_name":"defuse/passgenr","owner":"defuse","description":"A library for generating cryptographically-secure passwords in Rust.","archived":false,"fork":false,"pushed_at":"2018-04-23T09:38:07.000Z","size":85,"stargazers_count":8,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T02:43:41.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/defuse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-06T18:55:14.000Z","updated_at":"2023-06-04T06:09:46.000Z","dependencies_parsed_at":"2022-08-26T07:10:35.689Z","dependency_job_id":null,"html_url":"https://github.com/defuse/passgenr","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/defuse%2Fpassgenr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fpassgenr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fpassgenr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fpassgenr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defuse","download_url":"https://codeload.github.com/defuse/passgenr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339286,"owners_count":21087215,"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":"2024-10-13T12:09:43.780Z","updated_at":"2025-04-11T04:36:48.482Z","avatar_url":"https://github.com/defuse.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passgenr\n\n[![Build Status](https://travis-ci.org/defuse/passgenr.svg?branch=master)](https://travis-ci.org/defuse/passgenr)\n[![codecov](https://codecov.io/gh/defuse/passgenr/branch/master/graph/badge.svg)](https://codecov.io/gh/defuse/passgenr)\n[![crates.io](https://img.shields.io/crates/d/passgenr.svg)](https://crates.io/crates/passgenr)\n[![crates.io](https://img.shields.io/crates/v/passgenr.svg)](https://crates.io/crates/passgenr)\n[![docs.rs](https://docs.rs/passgenr/badge.svg)](https://docs.rs/passgenr/)\n\n`passgenr` is a Rust library for generating cryptographically-secure random\npasswords. It is a port of my earlier password generating tool,\n[passgen](https://github.com/defuse/passgen) (which was written in C).\n`passgenr` also includes a command-line utility for generating passwords. Please\nread the [Security Details](#security-details) section below.\n\n## Command-Line Utility\n\nTo build and install the command-line utility, run...\n\n```\ncargo build --bin passgenr --release\n```\n\n...and then install the `./target/release/passgenr` into your system.\n\nHere are some examples of how to use the command-line tool:\n\n```\n$ passgenr --ascii\n|*H(f]*@XO;YX\"vEOx_%3LDf}fyAuQ\u003c_2=\u0026W\u003c|d*ZY#zH%{Wq20mruTo:G~jg-rd\n\n$ passgenr --alpha\nPWPMBzF4KIUNGIK79S04NOgt51s5TJaqCTNd4loMkTjIZiHsrGMUrqE4DCrBCuay\n\n$ passgenr --hex\n0FB8DA7DF897D3E781D8F93D48A1FDA19C4B1CA96A3D78E1CB1BE46441AD7EE3\n\n$ passgenr --digit\n4685009459776989842380332148352094362440679705765781117806140754\n\n$ passgenr --lower\nbjqxtuknhlqacsiwjansyavkaqlnyscsnxwowcgymlkwxzlilxbzsyovyoqwjdmw\n\n$ passgenr --words\nvocalist.uptown.bunch.feel.board.crock.few.teeter.product.intellect\n\n$ passgenr --hex -p 5\n0E21238E1B35FE6B38890AF83CBC1DD3470EE30F31971ECF49170CEE593D0312\n1057CA652A62EA045B58EF2FA31077CA8749936D4FA87931EE22E4CC36BFBA02\n2548942BB7A11D793225BD4E2B84E3FCBD66118F28C4C3871823745779340A30\n878C14A4BD2C9F7B76C09D0A1A308AD471F4E06B13DC96886CAEAB2446E33178\n1F0E1C337872EECE8FFC89A4088875CEB22BB5956B38D0C62FC28855202AB1F5\n```\n\n## Library\n\nThis library is [on crates.io](https://crates.io/crates/passgenr). The\ndocumentation is hosted [on docs.rs](https://docs.rs/passgenr/).\n\nTo use the library, add the following to your `Cargo.toml`...\n\n```\n[dependencies]\npassgenr = \"0.2\"\n```\n\n...and add this line to your crate root...\n\n```\nextern crate passgenr;\n```\n\n...now you can generate a password...\n\n```\nassert_eq!(\n    20,\n    passgenr::random_password(passgenr::charsets::ASCII, 20, \"\").unwrap().len()\n);\n```\n\n## Security Details\n\n**Randomness.** `passgenr` uses [OsRng](https://doc.rust-lang.org/rand/rand/struct.OsRng.html)\nas a randomness source, which reads directly from the operating system's CSPRNG\n(e.g. `getrandom(2)` or `/dev/urandom` on Linux, or `RtlGenRandom` on Windows).\nThe individual elements of the password (characters or words) are selected by\ncalling `.choose()` on the `OsRng`, which is careful to sample uniformly (i.e.\nit doesn't use the naive \"mod N\" algorithm).\n\n**Swap File.** `passgenr` does not prevent its memory from being written out to\nthe system's swap file. You should only use `passgenr` on systems with an\nencrypted swap file/partition.\n\n**Side-Channels.** Unlike the older `passgen`, `passgenr` has no defenses\nagainst side-channel attacks. When you generate passwords with `passgenr` you\nshould be sure that nobody untrustworthy can run code on the same machine (even\nas an unprivileged user), otherwise they might be able to extract some\ninformation about the passwords through side-channels. Adding side-channel\ndefenses to `passgenr` is\n[planned](https://github.com/defuse/passgenr/issues/4), once the technology\nbecomes available to stable Rust.\n\n**Audit Status.** While its author is careful and prioritizes security,\n`passgenr` has not yet been audited by a professional third-party. If you have\nexperience doing security audits and you would like to contribute one, please\nget in touch!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fpassgenr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefuse%2Fpassgenr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fpassgenr/lists"}