hashlogs

Crates.iohashlogs
lib.rshashlogs
version1.0.2
sourcesrc
created_at2018-05-10 11:04:12.487274
updated_at2018-05-10 13:59:07.066457
descriptionCommand-line utility that hashes the part before a space on each line from stdin with blake2b keyed with an ephemeral randomly-generated key and writes to stdout
homepagehttps://github.com/hsivonen/hashlogs
repositoryhttps://github.com/hsivonen/hashlogs
max_upload_size
id64674
size19,431
ulms (github:foxford:ulms)

documentation

https://github.com/hsivonen/hashlogs/blob/master/README.md

README

hashlogs

crates.io docs.rs Apache 2 / MIT dual-licensed

hashlogs is a command-line utility that hashes the part before a space on each line from stdin with blake2b keyed with an ephemeral randomly-generated key and writes to stdout.

Installation

cargo install hashlogs

Usage

No command line argument. Reads from stdin and writes to stdout.

Details

When the program starts, it obtains 16 randomly-generated bytes (128 bits) of entropy from the system random number generator. These bytes are used as the key to the blake2b hash function. The key is forgotten when the program exits.

This has the effect that during a given run of the program, occurrences of the same hash input result in the same hash output. However, after the execution has ended, it's infeasible to try to reverse the hash by brute force, because the key is not known.

If the hash function was not keyed (or the input wasn't alternatively salted), it would be feasible to brute force a relatively small input space, such as the IPv4 address space.

8 bytes of output are taken for each hash. The value is represented as upper-case hexadecimal (16 ASCII characters).

Lines are considered to be separated by a line feed. Lines that don't contain a space are discarded. The part of each line that precedes the first space on the line is hashed. The rest of the line is not modified.

Operations are performed on bytes, so character encoding issues are garbage in, garbage out.

License

hashlogs is licensed under either of

at your option.

Contribution

Any contribution submitted for inclusion in hashlogs by you, as defined in the Apache License 2.0, shall be dual licensed as above, without any additional terms or conditions. Not adding a copyright notice as part of your Contribution is taken as a waiver of copyright notice.

Commit count: 5

cargo fmt