A rewrite of my first Password generator in rust.

Overview

PGen-Rust


Getting Started

You can get the latest version of PGen from the github actions artifacts or from one of these links: linux, windows, macos

Usage

From the command line you can use ./pgen-rust generate this will run PGen with the default rules and generate a new configuration file according to your operating system

Windows: {FOLDERID_RoamingAppData} # eg: C:\Users\{USERNAME}\AppData\Roaming
Linux: $HOME/.config # or $XDG_CONFIG_HOME
Mac: $HOME/Library/Preferences

Arguments

The array of characters as separators (default: "!@$%.&*-+=?:;") -t, --transform What transformation mode to use, Options are [NONE, CAPITALISE, ALL_EXCEPT_FIRST, UPPERCASE, RANDOM, ALTERNATING] (default: CAPITALISE) -V, --version Print version information -w, --words The number of words to generate for each password (default: 2) SUBCOMMANDS: generate Generate some new passwords. help Print this message or the help of the given subcommand(s)">
USAGE:
    pgen-rust [OPTIONS] 

OPTIONS:
    -a, --amount 
            The number of passwords to generate (default: 3)

    -d, --digits-before 
            The number of digits before the words (default: 0)

    -D, --digits-after 
            The number of digits after the words (default: 3)

        --debug
            Enable debug logging

    -h, --help
            Print help information

    -m, --min-length 
            The minimum length of each word (default: 5, min: 3)

    -M, --max-length 
            The maximum length of each word (default: 7, max: 9)

    -r, --match-random-char
            Do not use the same random character for each separator rather than a new random each
            time (default: true)

    -s, --separator-char 
            The character to use to separate the words (default: "RANDOM")

    -S, --separator-alphabet 
            The array of characters as separators (default: "!@$%.&*-+=?:;")

    -t, --transform 
            What transformation mode to use, Options are [NONE, CAPITALISE, ALL_EXCEPT_FIRST,
            UPPERCASE, RANDOM, ALTERNATING] (default: CAPITALISE)

    -V, --version
            Print version information

    -w, --words 
            The number of words to generate for each password (default: 2)

SUBCOMMANDS:
    generate    Generate some new passwords.
    help        Print this message or the help of the given subcommand(s)

Configuration file

When using the configuration file not all values must be present, the default values will be used in their place.

Below you will find the default configuration file.

words = 2
min_length = 5
max_length = 7
transform = 'CAPITALISE'
separator_char = 'RANDOM'
separator_alphabet = '!@$%.&*-+=?:;'
match_random_char = true
digits_before = 0
digits_after = 3
amount = 3

Using a configuration file in another location

When running the generate subcommand you can specify a configuration file to use. This path will first be treated as an absolute path and if not found looked for in the current working directory.

Some examples of this would be:

./pgen-rust generate /home/racci/Documents/config.toml
./pgen-rust generate config.toml
./pgen-rust generate ../config.toml

Rule hierarchy

When running PGen rules will be assigned with the last checked value as the final value. Meaning that rules are assigned in an order of default, config file, supplied config file and finally cli arguments.


Running from a script

Instead of writing ./pgen-rust and whatever options you need, you can instead use a batch, powershell or shell file like these:

  • Shell script (Assuming you have pgen-rust in your path):
#!/bin/bash
pgen-rust -w 10 -m 5 -r -t ALTERNATING -s RANDOM -S =-;. -d 5 -D 0 -a 50 generate ~/Documents/config
  • Powershell / Batch script
"C:\Users\Racci\Programs\PGen\pgen-rust" generate "C:\Users\Racci\Programs\PGen\rules.toml"
You might also like...
Rust bindings for VirusTotal/Yara

yara-rust Bindings for the Yara library from VirusTotal. More documentation can be found on the Yara's documentation. Example The implementation is in

Rust library for building and running BPF/eBPF modules

RedBPF A Rust eBPF toolchain. Overview The redbpf project is a collection of tools and libraries to build eBPF programs using Rust. It includes: redbp

Rust library for developing safe canisters.

IC Kit This library provides an alternative to ic-cdk that can help developers write canisters and unit test them in their Rust code. Install Add this

MimiRust - Hacking the Windows operating system to hand us the keys to the kingdom with Rust.
MimiRust - Hacking the Windows operating system to hand us the keys to the kingdom with Rust.

MimiRust - Hacking the Windows operating system to hand us the keys to the kingdom with Rust. MimiRust is a program based on the wdigest attack vector

simple multi-threaded port scanner written in rust
simple multi-threaded port scanner written in rust

knockson simple multi-threaded port scanner written in rust Install Using AUR https://aur.archlinux.org/packages/knockson-bin/ yay -Syu knockson-bin M

Rust TLS/SSL certificate expiration date from command-line checker

Rust TLS/SSL certificate expiration date from command-line checker

Lightweight slowloris (HTTP DoS) implementation in Rust.
Lightweight slowloris (HTTP DoS) implementation in Rust.

slowlorust Lightweight slowloris (HTTP DoS) implementation in Rust. Slowloris is a denial-of-service attack program which allows an attacker to overwh

A simple port scanner built using rust-lang

A simple port scanner built using rust-lang

Safe Rust interface to the Vulkan API.

Magma: A strictly typed Vulkan API interface. Magma is a strictly typed Rust interface for the vulkan API. This means that whenever possible, the well

Comments
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • Cargo.toml (cargo)
    • .github/workflows/build.yml (github-actions)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 9 Pull Requests:

    fix(deps): update rust crate rust-embed to 6.4.2
    • Schedule: ["at any time"]
    • Branch name: renovate/rust-embed-6.x
    • Merge into: master
    • Upgrade rust-embed to 6.4.2
    fix(deps): update rust crate serde to 1.0.147
    • Schedule: ["at any time"]
    • Branch name: renovate/serde-1.x
    • Merge into: master
    • Upgrade serde to 1.0.147
    fix(deps): update rust crate serde_json to 1.0.88
    • Schedule: ["at any time"]
    • Branch name: renovate/serde_json-1.x
    • Merge into: master
    • Upgrade serde_json to 1.0.88
    fix(deps): update rust crate strum to 0.24.1
    • Schedule: ["at any time"]
    • Branch name: renovate/strum-0.x
    • Merge into: master
    • Upgrade strum to 0.24.1
    chore(deps): update actions/upload-artifact action to v3.1.1
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-upload-artifact-3.x
    • Merge into: master
    • Upgrade actions/upload-artifact to v3.1.1
    fix(deps): update rust crate clap to 3.2.23
    • Schedule: ["at any time"]
    • Branch name: renovate/clap-3.x
    • Merge into: master
    • Upgrade clap to 3.2.23
    chore(deps): update swatinem/rust-cache action to v2
    • Schedule: ["at any time"]
    • Branch name: renovate/swatinem-rust-cache-2.x
    • Merge into: master
    • Upgrade Swatinem/rust-cache to v2
    fix(deps): update rust crate clap to v4
    • Schedule: ["at any time"]
    • Branch name: renovate/clap-4.x
    • Merge into: master
    • Upgrade clap to 4.0.26
    fix(deps): update rust crate dirs to v4
    • Schedule: ["at any time"]
    • Branch name: renovate/dirs-4.x
    • Merge into: master
    • Upgrade dirs to 4.0.0

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Owner
Racci
JVM mainly Kotlin Dev Former Owner and Dev of SylphMC
Racci
An attempt to rewrite lite-client for TON Blockchain in Rust using ton-labs-adnl library.

An attempt to rewrite lite-client for TON Blockchain in Rust using ton-labs-adnl library.

TonStack 4 Nov 9, 2022
A simple password manager written in Rust

ripasso A simple password manager written in Rust. The root crate ripasso is a library for accessing and decrypting passwords stored in pass format (G

Joakim Lundborg 548 Dec 26, 2022
A fast Rust-based safe and thead-friendly grammar-based fuzz generator

Intro fzero is a grammar-based fuzzer that generates a Rust application inspired by the paper "Building Fast Fuzzers" by Rahul Gopinath and Andreas Ze

null 203 Nov 9, 2022
Detects usage of unsafe Rust in a Rust crate and its dependencies.

cargo-geiger ☢️ Looking for maintainer: https://github.com/rust-secure-code/cargo-geiger/issues/210 A program that lists statistics related to the usa

Rust Secure Code Working Group 1.1k Jan 4, 2023
An esoteric language/compiler written with Rust and Rust LLVM bindings

MeidoLang (メイドラング) A not so useful and esoteric language. The goal of this project was to contain some quirky or novel syntax in a stack-style program

null 0 Dec 24, 2021
Rust-verification-tools - RVT is a collection of tools/libraries to support both static and dynamic verification of Rust programs.

Rust verification tools This is a collection of tools/libraries to support both static and dynamic verification of Rust programs. We see static verifi

null 253 Dec 31, 2022
Rust bindings for libinjection

libinjection-rs Rust bindings for libinjection. How to use Add libinjection to dependencies of Cargo.toml: libinjection = "0.2" Import crate: extern c

ArvanCloud 35 Sep 24, 2022
A fast, simple, recursive content discovery tool written in Rust.

A simple, fast, recursive content discovery tool written in Rust ?? Releases ✨ Example Usage ✨ Contributing ✨ Documentation ?? ?? What the heck is a f

epi 3.6k Dec 30, 2022
link is a command and control framework written in rust

link link is a command and control framework written in rust. Currently in alpha. Table of Contents Introduction Features Feedback Build Process Ackno

null 427 Dec 24, 2022
CVEs for the Rust standard library

Rust CVE Preface This is a list of CVEs for unsound APIs in the Rust standard library. These bugs break Rust's memory safety guarantee and lead to sec

Yechan Bae 26 Dec 4, 2022