id0-rsa.pubのメモ【Intro to Hashing】

crypto強くなりたいということでid0-rsaをちまちまやっていき、その記録を残していくお気持ち。

Intro to Hashing

ハッシュ関数とはなんぞやという話。
Introなので記載されている方法に沿ってやればOK。
id0-rsa.pubのsha256ハッシュの値をさらにmd5ハッシュしてsubmitして終了。

$ printf "id0-rsa.pub" | sha256sum
4b4c17690546df5edf6dd8c5a6c399a02e07367810c95f3d2776b730b4a326c8
$ printf "4b4c17690546df5edf6dd8c5a6c399a02e07367810c95f3d2776b730b4a326c8" | md5sum
b25d449d86aa07981d358d3b71b891de

echoじゃなくてprintfコマンドを使う理由としては改行コードが入らないようにするためっぽい。

Notice the use of the command printf as opposed to echo, this prevents a new line from being appended to our data, so the string is piped to the md5sum exactly as is.