rpassword

Cross platform Rust library to read a password in the terminal (Linux, BSD, MacOS, Windows, WASM).

Latest version: 7.5.1 registry icon
Maintenance score
60
Safety score
100
Popularity score
76
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
7.5.1 0 0 0 0 0
7.5.0 0 0 0 0 0
7.4.0 0 0 0 0 0
7.3.1 0 0 0 0 0
7.3.0 0 0 0 0 0
7.2.0 0 0 0 0 0
7.1.0 0 0 0 0 0
7.0.0 0 0 0 0 0
6.0.1 0 0 0 0 0
6.0.0 0 0 0 0 0
5.0.1 0 0 0 0 0
5.0.0 0 0 0 0 0
4.0.5 0 0 0 0 0
4.0.4 0 0 0 0 0
4.0.3 0 0 0 0 0
4.0.2 0 0 0 0 0
4.0.1 0 0 0 0 0
4.0.0 0 0 0 0 0
3.0.2 0 0 0 0 0
3.0.1 0 0 0 0 0
3.0.0 0 0 0 0 0
2.1.0 0 0 0 0 0
2.0.0 0 0 0 0 0
1.0.2 0 0 0 0 0
1.0.1 0 0 0 0 0
1.0.0 0 0 0 0 0
0.4.2 0 0 0 0 0
0.4.1 0 0 0 0 0
0.4.0 0 0 0 0 0
0.3.1 0 0 0 0 0
0.3.0 0 0 0 0 0
0.2.3 0 0 0 0 0
0.2.2 0 0 0 0 0
0.2.1 0 0 0 0 0
0.2.0 0 0 0 0 0
0.1.3 0 0 0 0 0
0.1.2 0 0 0 0 0
0.1.1 0 0 0 0 0
0.1.0 0 0 0 0 0
0.0.6 0 0 0 0 0
0.0.5 0 0 0 0 0
0.0.4 0 0 0 0 0
0.0.2 0 0 0 0 0
0.0.1 0 0 0 0 0

Stability
Latest release:

7.5.1 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-2.0   -   Apache License 2.0

Not a wildcard

Not proprietary

OSI Compliant



Rustastic Password

rpassword makes it easy to read passwords from Rust code in console applications on all platforms, Unix, Windows, WASM and more. It's similar to Linux's C function getpass() or Python's getpass module.

rpassword logo and headline

Usage

Add rpassword as a dependency in Cargo.toml:

[dependencies]
rpassword = "7.5"

Then use it in your code:

use std::io::{Cursor, Write};
use rpassword::{ConfigBuilder};

fn main() {
    // By default, reads and writes to the console, hides password as it is typed 
    let password = rpassword::prompt_password("Your password: ").unwrap();
    println!("Your password is {}", password);
    
    // Behavior is customizable to accommodate custom use-cases and testing
    // See documentation for more details
     let config = rpassword::ConfigBuilder::new()
         .input_data("my-password\n")
         .output_discard()
         .password_feedback_mask('*')
         .build();
    
     let password = rpassword::read_password_with_config(config).unwrap();
     println!("Your password is {}", password);
}

See examples and docs at https://docs.rs/rpassword.

See the upgrade path in UPGRADE.md.

License

The source code is released under the Apache 2.0 license.