Project

h

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Small tool that generates salted hashes, scented with the SHA2 function, for those who prefer to put makeup on passwords rather than yield them to Manager™.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

H.rb

Overview

Small tool that generates salted hashes, scented with the SHA-256 hash function.

Why?

I prefer to put makeup on passwords rather than yield them to Manager™.

Installation

$ gem install h

Configuration

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:

echo "my-secret" > ~/.h

Generate a digest from the system:

h p@ssw0rd

Result:

+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=

h シークレット

Result:

NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU=

Same operations, with Ruby:

require "h"

builder = H::Builder.new("my-secret")

builder.call("p@ssw0rd") # => "+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM="
builder.call("シークレット") # => "NaNvnGJGWWzzU9DlRSRKZQQER1/9/libXrrghMgBWbU="

Alternative Implementations

Shell script implementations are available in the alternatives/ directory:

Bash Implementation

A POSIX-compliant version focusing on compatibility and security:

./alternatives/bash/h p@ssw0rd

Result:

+KsELdbw7gM0e2lQsnCskf1albEXgl9MtXgrmvYkIaM=

Zsh Implementation

A modern implementation using ZSH-specific features:

./alternatives/zsh/h 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.