Created
July 13, 2011 19:21
-
-
Save gorsuch/1081110 to your computer and use it in GitHub Desktop.
Generate an SSH fingerprint from an SSH key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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