README.md in h-4.0.0 vs README.md in h-4.0.1

- old
+ new

@@ -1,6 +1,6 @@ -# H +# H.rb ## Overview Small tool that generates salted hashes, scented with the SHA-256 hash function. @@ -12,43 +12,80 @@ $ gem install h ## Configuration -H reads its configuration from the `~/.h` file at initialization. +**H** reads its configuration from the `~/.h` file at initialization. This file, which should be readable by its owner only, have the salt value. ## Examples +Settings: + +```sh +echo "my-secret" > ~/.h +``` + Generate a digest from the system: ```sh -$ echo "my-secret" > ~/.h +h p@ssw0rd +``` -$ h p@ssw0rd -+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM= +Result: -$ h シークレット -NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU= +> `+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=` + +```sh +h シークレット ``` +Result: + +> `NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU=` + Same operations, with Ruby: ```ruby require "h" builder = H::Builder.new("my-secret") -builder.call("p@ssw0rd") # => +KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM= -builder.call("シークレット") # => NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU= +builder.call("p@ssw0rd") # => "+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=" +builder.call("シークレット") # => "NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU=" ``` -## Status +## Alternative Implementations -* [![Gem Version](https://badge.fury.io/rb/h.png)](http://badge.fury.io/rb/h) -* [![Build Status](https://secure.travis-ci.org/cyril/h.rb.png)](//travis-ci.org/cyril/h.rb) -* [![Dependency Status](https://gemnasium.com/cyril/h.rb.svg)](//gemnasium.com/cyril/h.rb) -* ![](https://ruby-gem-downloads-badge.herokuapp.com/h?type=total) +Shell script implementations are available in the `alternatives/` directory: -*** +### Bash Implementation -Copyright (c) 2014 Cyril Kato, released under the [ISC license](LICENSE.md) +A POSIX-compliant version focusing on compatibility and security: + +```sh +./alternatives/bash/h.sh p@ssw0rd +``` + +Result: + +> `+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=` + +### Zsh Implementation + +A modern implementation using ZSH-specific features: + +```sh +./alternatives/zsh/h.zsh p@ssw0rd +``` + +Result: + +> `+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=` + +Both shell implementations: +- Use the same configuration file (`~/.h`) +- Provide identical output format +- Enforce secure file permissions +- Handle cleanup automatically + +See individual READMEs in the `alternatives/` directory for implementation details.