Authenticator
is a simple rust project to study information security and authentication principles.
Clone this repository:
$ git clone git@github.com:sguimmara/authenticator.git
Build it using cargo
:
$ cargo build
$ cargo run -- <subcommand> [ARGS]
Alternatively, you can build it using Docker :
$ docker build -t authenticator:example .
$ docker run authenticator:example <subcommand> [ARGS]
Note: the Docker image builds the binary against the musl libc (see https://musl.libc.org/)
authenticator
is a CLI program, executed in the terminal. The API is the following form :
$ authenticator <subcommand> [ARGS]
This command computes then returns the SHA-256 hash of the supplied text.
$ authenticator hash "hello, world!"
SHA-256 of "hello, world!": 68e656b251e67e8358bef8483ab0d51c6619f3e7a1a9f0e75838d41ff368f728
This command list the entries (as user/password hash tuples) in the pwd.json
file located in the current directory.
Adds a (user, password) tuple to the current pwd.json
file if any. If it does not exist, a file is created.
Removes a user from the current pwd.json
file if any.
Verifies that the user/password pair matches an entry in the pwd.json
file.