# Code from <http://stackoverflow.com/a/6682934/1535629>
import base64, hashlib
# paste your key on line 6
key = """
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqmEmDTNBC6O8HGCdu0MZ9zLCivDsYSttrrmlq87/YsEBpvwUTiF3UEQuFLaq5Gm+dtgxJewg/UwsZrDFxzpQhCHB6VmqrbKN2hEIkk/HJvCnAmR1ehXv8n2BWw3Jlw7Z+VgWwXAH50f2HWYqTaE4qP4Dxc4RlElxgNmlDPGXw/dYBvChYBG/RvIiTz1L+pYzPD4JR54IMmTOwjcGIJl7nk1VjKvl3D8Wgp6qejv4MfZ7Htdc99SUKcKWAeHYsjPXosSk3GlwKiS/sZi51Yca394GE7T4hZu6HTaXeZoD8+IZ7AijYn89H7EPjuu0iCAa/cjVzBsFHGszQYG+U5KfIw==
"""
def lineToFingerprint(line):
key = base64.b64decode(line.strip().split()[1].encode('ascii'))
fp_plain = hashlib.md5(key).hexdigest()
return ':'.join(a+b for a,b in zip(fp_plain[::2], fp_plain[1::2]))
print(lineToFingerprint(key))
IyBDb2RlIGZyb20gPGh0dHA6Ly9zdGFja292ZXJmbG93LmNvbS9hLzY2ODI5MzQvMTUzNTYyOT4KaW1wb3J0IGJhc2U2NCwgaGFzaGxpYgoKIyBwYXN0ZSB5b3VyIGtleSBvbiBsaW5lIDYKa2V5ID0gIiIiCnNzaC1yc2EgQUFBQUIzTnphQzF5YzJFQUFBQUJJd0FBQVFFQXFtRW1EVE5CQzZPOEhHQ2R1ME1aOXpMQ2l2RHNZU3R0cnJtbHE4Ny9Zc0VCcHZ3VVRpRjNVRVF1RkxhcTVHbStkdGd4SmV3Zy9Vd3NackRGeHpwUWhDSEI2Vm1xcmJLTjJoRUlray9ISnZDbkFtUjFlaFh2OG4yQld3M0psdzdaK1ZnV3dYQUg1MGYySFdZcVRhRTRxUDREeGM0UmxFbHhnTm1sRFBHWHcvZFlCdkNoWUJHL1J2SWlUejFMK3BZelBENEpSNTRJTW1UT3dqY0dJSmw3bms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