https://github.com/quininer/ttyaskpass
a safely passphrase prompt library and application.
https://github.com/quininer/ttyaskpass
askpass getpass pass passphrase prompt rust
Last synced: 8 months ago
JSON representation
a safely passphrase prompt library and application.
- Host: GitHub
- URL: https://github.com/quininer/ttyaskpass
- Owner: quininer
- License: mit
- Created: 2016-02-14T19:57:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-05T07:06:52.000Z (over 6 years ago)
- Last Synced: 2025-03-17T06:35:48.662Z (about 1 year ago)
- Topics: askpass, getpass, pass, passphrase, prompt, rust
- Language: Rust
- Homepage:
- Size: 78.1 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ttyaskpass
[](https://travis-ci.org/quininer/ttyaskpass)
[](https://crates.io/crates/ttyaskpass)
[](https://github.com/quininer/ttyaskpass/blob/master/LICENSE)
[](https://docs.rs/ttyaskpass/)

A safely passphrase prompt library and application,
support [Chroma-Hash](https://github.com/mattt/Chroma-Hash/)-like colorhash.
usage
-----
library:
```rust
use std::io::{ self, Write };
use ttyaskpass::AskPass;
fn main() -> io::Result<()> {
let mut cli = AskPass::new([0; 32]);
let pass = cli.askpass("Password:")?;
let mut stdout = io::stdout();
write!(&mut stdout, "Your password is ")?;
stdout.write_all(pass)?;
stdout.flush()?;
Ok(())
}
```
see [readme.rs](examples/readme.rs) and [ttyaskpass.rs](src/bin/ttyaskpass.rs).
application:
```bash
env SSH_ASKPASS=ttyaskpass ssh-add