We all know the ASCII randomart generated by ssh-keygen
when creating or validating ssh
public keys.
We also know you can generate hashes of any file with sha1sum
or md5sum
.
But, is it possible to generate randomart "ssh-keygen-style" from any file that is not a public ssh key?
That would be a funnier way of visually comparing the checksum of two files.
You can generate random art of any file with this little C program made by nirejan:
To use it, follow these steps:
bishop.c
.gcc bishop.c -o bishop
.View the random art of any file (where
myfile
is the file):Create a custom script to view the random art of any file:
Create the local binaries folder if doesn't exists:
Create a file on that folder with the script:
Give permissions to the file:
Run
gedit /usr/local/bin/randomart
to edit the file and paste this on it:Save the file.
Copy the program that we built on the previous step to the local binaries folder:
Give run permission to the binary:
Use the newly-created program running
randomart myfile
wheremyfile
is the file.The page OpenSSH Keys and The Drunken Bishop gives a good introduction to how the algorthm works.
The details of it can be found in
The drunken bishop: An analysis of the OpenSSH fingerprint visualization algorithm .
The topic is discussed in a more general form in the paper
"Hash Visualization: a New Technique to improve Real-World Security", Perrig A. and Song D., 1999, International Workshop on Cryptographic Techniques and E-Commerce (CrypTEC '99)".