title: Deriving an SSH Fingerprint from a Public Key in Python
body: <p>I'm trying to understand the steps to take an OpenSSH public key like so:</p>
  
  <blockquote>
    <p>ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqmEmDTNBC6O8HGCdu0MZ9zLCivDsYSttrrmlq87/YsEBpvwUTiF3UEQuFLaq5Gm+dtgxJewg/UwsZrDFxzpQhCHB6VmqrbKN2hEIkk/HJvCnAmR1ehXv8n2BWw3Jlw7Z+VgWwXAH50f2HWYqTaE4qP4Dxc4RlElxgNmlDPGXw/dYBvChYBG/RvIiTz1L+pYzPD4JR54IMmTOwjcGIJl7nk1VjKvl3D8Wgp6qejv4MfZ7Htdc99SUKcKWAeHYsjPXosSk3GlwKiS/sZi51Yca394GE7T4hZu6HTaXeZoD8+IZ7AijYn89H7EPjuu0iCAa/cjVzBsFHGszQYG+U5KfIw==</p>
  </blockquote>
  
  <p>And then to convert it into an standard fingerprint like so:</p>
  
  <pre><code>2048 49:d3:cb:f6:00:d2:93:43:a6:27:07:ca:12:fd:5d:98 id_rsa.pub (RSA)
  </code></pre>
  
  <p>I have attempted to dive into the OpenSSH source to understand this, but it is over my head.  My first guess was to do a simple MD5 on the key text, but the result does not match the above output.</p>