clipass_rs - Library for masked CLI input reading
Description
This library provides the basic functionality for masking the input reading
of a console application. By setting up the required needs, the custom prompt
won't reveal the input unless it is allowed to do so. The input can either
directly be accessed or hashed in (currently) sha256 and md5.
Usage
- Import the crate
use CliPass;
- Initialize clipass_rs
let mut session = new;
Settings
- Specify a custom prompt label:
- Ignore the default prompt label and only read the input:
- Per default the arrow down key can be used to unmask the input (arrow up to mask it again), this can be prevented with:
- The mask token (default: '*') can be updated to the prefered one with:
- To launch the prompt after setup:
Example
use io;
use CliPass;
/*
* Output:
* -------
* ############### <-- "invalidpassword"
*
* thread 'main' panicked at src/bin/main.rs:56:9:
* assertion `left == right` failed
* left: "5bd7f6cf3b61dd672341c7cc2baafd3e960b01ffef4509bb631b4b267e85b444"
* right: "405f42005704da932ea8a4ad1f1e8c26e751af0316caa1e7e4bef4af4e2d93fe"
*/
Full Examples can be found here
License
This project is published under the MIT license.