Skip to content

Instantly share code, notes, and snippets.

@gorsuch
Created July 13, 2011 19:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gorsuch/1081110 to your computer and use it in GitHub Desktop.
Save gorsuch/1081110 to your computer and use it in GitHub Desktop.
Generate an SSH fingerprint from an SSH key
require 'base64'
require 'digest/md5'
key = "your public key here"
# first decode the key
key_decoded = Base64.decode64(key)
# create an md5
md5 = Digest::MD5.hexdigest(key_decoded)
# convert that hash into a readable fingerprint
puts md5.scan(/.{1,2}/).join(':')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment