Comments on: Making Sense of Hashed Hosts in ~/.ssh/known_hosts https://pthree.org/2011/12/30/making-sense-of-hashed-hosts-in-sshknown_hosts/ Linux. GNU. Freedom. Fri, 01 Dec 2017 15:29:07 +0000 hourly 1 https://wordpress.org/?v=5.0-alpha-42199 By: Derek Smalsl https://pthree.org/2011/12/30/making-sense-of-hashed-hosts-in-sshknown_hosts/#comment-137947 Sat, 14 Jun 2014 18:18:55 +0000 http://pthree.org/?p=2168#comment-137947 "I don't expect you to follow this post completely, but it's so amazingly cool, I have to blog it." - and the award for most arrogant sentence of the day goes to....YOU!!!!

]]>
By: Jason Yang Xiong https://pthree.org/2011/12/30/making-sense-of-hashed-hosts-in-sshknown_hosts/#comment-131761 Tue, 07 Jan 2014 21:01:21 +0000 http://pthree.org/?p=2168#comment-131761 Regarding how to apply the salt/key to get the hostname hash value, the following is an example.

This is an entry in ~/.ssh/known_hosts file.
|1|F1E1KeoE/eEWhi10WpGv4OdiO6Y=|3988QV0VE8wmZL7suNrYQLITLCg= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwCZx9lGaY+Zhz98TdWqZ01mTzOwRnQO0EIBM8Hx8olxMbrQ1Xa+x/7LBoGyJqeYFunZbFCVpAu+2SBkvf75qV8nTlq3WXnLnprsH5Sq/c9f29ZCcMHevI

The host name is 192.168.1.61
The following is how to apply the salt/key to get the hashed host name:
$hex_key=$(echo $(echo F1E1KeoE/eEWhi10WpGv4OdiO6Y= | base64 -d | xxd -p));echo $(echo -n 192.168.1.61 | openssl sha1 -mac HMAC -macopt hexkey:$hex_key)|awk '{print $2}'|xxd -r -p|base64
3988QV0VE8wmZL7suNrYQLITLCg=

So, 3988.....Cg= is the hashed value of 192.168.1.61.

]]>