Generate a fingerprint given an SSH public key (without `ssh-keygen` or external dependencies)
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
ssh-fingerprint.gemspec

README.md

ssh-fingerprint

Gem Version Build Status Dependency Status codecov

Generate a fingerprint given an SSH public key (without ssh-keygen or external dependencies)

Installing

ssh-fingerprint is distributed as a gem. Install it through the gem command or add it to your Gemfile:

Installing through gem

$ gem install ssh-fingerprint

Installing through your Gemfile

gem 'ssh-fingerprint'

Usage

Using it is really simple. Read the key content to a variable and call SSHFingerprint.compute method. Example:

require 'ssh-fingerprint'

key = File.read(File.expand_path('~/.ssh/id_rsa.pub'))
puts SSHFingerprint.compute(key)
# => f5:d8:39:1d:7c:26:...

Pull requests are welcome!