Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Last active February 4, 2016 07:15
Show Gist options
  • Save Ruzzz/9476c1a3939dcabf06a0 to your computer and use it in GitHub Desktop.
Save Ruzzz/9476c1a3939dcabf06a0 to your computer and use it in GitHub Desktop.
Calc id_rsa.pub fingerprint
import sys
import base64
import hashlib
// Alternative to: >ssh-keygen -E md5 -l -f id_rsa.pub
md5 = hashlib.md5()
md5.update(base64.b64decode(open('id_rsa.pub').read().split()[1]))
digest = md5.digest()
print (":".join("{:02x}".format(c) for c in digest))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment