The official page for Merci-Libre's genpass-rs. Created by westwardfishdme.
There is now a precompiled binary attached to all releases <= 1.0.2 You can simply run the .exe in a command prompt to use the software as desired.
The binary was compiled using a x86_64 bit processor, so be warned!
- Install rust from https://www.rust-lang.org/tools/install
- Use
cargo build --release
to compile. - get the binary from
genpass-rs/target/build/genpassrs
- you figure out the rest :)
Read more about the project on my website
genpassrs --help
: Prints help menu.
genpassrs string --encoding extasc --length 30
: prints a string of length 30 containing random extended ascii characters, excluding spaces.
genpassrs string --encoding ascii --spaces --length 20
: prints a string of length 20 containing random ascii characters including spaces.
genpassrs alphanumeric -l 25
: generates an alphanumeric string of length 25.
genpassrs alphanumeric -a 25
: generates a string of length 25 of only letters of varying cases.
genpassrs alphanumeric -s -l 25
: generates a string of length 25 with lowercase letters.
genpassrs alphanumeric -u -l 25
: generates a string of length 25 with uppercase letters.
genpassrs integer --length 20
: prints a random integer of length 20. STDOUT is formatted as type: String, not integer.
genpassrs estimate <string>
OR <stdin> | genpassrs estimate -
This program uses 2 crates for steganographic functionality:
- Stegano for encrypting and formatting payloads.
- Steganography for actually embedding the payloads into the images.
When encrypting a payload into an image, Genpass-rs uses AES-128 to securely store up to 240-byte long strings into images. To use the steganographic functions the inputted file must meet the following criteria:
- Must be a [.jpg, .jpeg, or .png]
- Must be at least 1kb in size, however as of 1.1.2 there is no check on file size. Meaning that smaller images may result in an error or crash.
- Must not have any previous data embedded into an image using this program (or other programs using steganography), there is no way to check for this in the software at the current moment, so use fresh unedited images before using this command!
The steganographic file will be outputted as a .png
Genpass-rs comes with 2 methods of storing passwords into images:
- Generate a password up to 240 bytes (240 characters, or 120 characters with utf-8 converted extended ascii),
- Storing a payload up to 240 bytes.
You may choose to encrypt the payloads before storing them into images by passing the
-u
argument.
For example:
genpassrs steg embed -n some.png -p "Hello World" -u
This command will store the payload Hello World
into the image some.png
without encryption.
For generating a new random password with encryption, you can use the following command:
genpassrs steg generate -n some.jpeg -l 50 -e extasc -s
This command will generate a new passphrase with both ascii and extended ascii of length 50
, and then store it into the file some.jpeg
.
Genpassrs supports module usage outside of genpass for whatever project you are working on. Of course, you can use a wrapper to use genpassrs in any project.
Genpassrs includes string generation AND integer generation in stringgeneration.rs
The following functions are modular, and can be used in any application or program:
- generator(length:u8, char_encodingMinValue:u8, char_encodingMaxValue:u8, outputString:String) -> returns a string of specified length.
- intgen(length:u8, outputString:String) -> returns a string of integers of specified length.
- alphanumeric(length:u8, char_min:u8, char_max:u8, outputString:String)-> returns a string of alphanumeric characters.
- estimate(input:String)-> outputs a number 1 through 4, see (https://docs.rs/zxcvbn/latest/zxcvbn/) for more details.
to use them, simply copy the desired files into your project, and add them in as modules.
e.g.:
[ in *your* project directory: `main.rs`,`stringgeneration.rs` ]
use mod stringgeneration;
fn main(){
let mut string=String::new(); // create a mutable string
string=stringgeneration::generator(30,32,127,string); //example of using the generator function
println!("{}", string);
}
This will create a string of length 30, use spaces in the generation, and generate characters all the way up to character 127 (z). For more information on character codes, please see: the wikipedia article here.
This can be used in a plethora of ways-- according to your use case.