Google Groups

Magic signatures in Bash

@eschnou Mar 15, 2011 2:00 PM
Posted in group: salmon-protocol
Hi everyone,

While implementing Salmon Magic Signatures in my node-ostatus library [1], I realized there was no easy way to test and debug interoperability. It seems that some Python code is available but I'm not sure on how to use it and if it has been updated to the latest spec.

So, I hacked a bash script [2] to perform signature in command line using OpenSSL. It is simple to understand and a good peak at how the signature flow goes. Since it uses only command line tools available in every Linux distro, it makes it a good tool to debug your implementations.

You just need to generate a RSA key pair (see the documentation on Github) and then you can sign any file:
./ input.txt key.pem

It will output the signature as it would appear in me.sign (base64 etc) as well as the key that can be used in the user XRD and plenty of useful stuff.

Now... if some of you could have a quick look at test it with your implementation, I would appreciate. I'm still wondering if I got it right :-)