Skip to content

Instantly share code, notes, and snippets.

@Sciss
Forked from ryo1kato/gist:1949096
Created March 7, 2012 18:44
Show Gist options
  • Save Sciss/1995057 to your computer and use it in GitHub Desktop.
Save Sciss/1995057 to your computer and use it in GitHub Desktop.
SSH key fingerprint
require 'base64'
require 'digest/md5'
ssh_pubkey='AAAAB3NzaC1yc2EAAAABIwAAAQEAxCw2nrIcdQ+7/tKy+6fk1qmICpl2qa8jxCLoG3pnGniDUUIOtRdEfnpHNHYWfwBVYIdGD5bmcFnXEfoxRjR2VpLXNeY/8PlCG5lARuQqkc720ZfoxsEQo3m+ixV4ylbuQfo8eDrELrn+MWiPluh699lWyvgZ/6oTW1nf2gsKabG+nV8uLvr7Znr230S8o8vhgo6O3cmfLGcfApUnG9kce1YOlz1D9F2x6vzDSO2W3s5/UTBmDvLj3Cza+yzmLp2fzAw97FL6LLwS2cLaVUayc6pZKqN+4Gu9LDPXFl4jkD2xzPTp7cuKdrJFaDsIa0OHzG+yVlDvWi8FkdU9O+xiuw=='
fingerprint = Digest::MD5.hexdigest(Base64.decode64(ssh_pubkey)).scan(/../).join(':')
puts fingerprint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment