PHP ssh2_fingerprint() does not match ssh-keygen -lf id_rsa.pub

Posted by Justin on Super User See other posts from Super User or by Justin
Published on 2013-10-22T22:55:19Z Indexed on 2013/10/23 3:58 UTC
Read the original article Hit count: 237

Filed under:
|

I am using the lib ssh2 module with PHP and calling the function ssh2_fingerprint() to get the keys fingerprint. According to all resources on the internet, I can get the fingerprint of a public key by executing:

ssh-keygen -lf id_rsa.pub

Which outputs something like:

2048 d4:41:3b:45:00:49:4e:fc:2c:9d:3a:f7:e6:6e:bf:e7 id_rsa.pub (RSA)

However, when I call ssh2_fingerprint($connection, SSH2_FINGERPRINT_HEX) in PHP with the same public key I get:

dddddba52352e5ab95711c10fdd56f43  

Shouldn't they match? What am I missing?

© Super User or respective owner

Related posts about php

Related posts about ssh