Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: gimme_bottles on March 06, 2014, 04:51:28 PM



Title: Sign files
Post by: gimme_bottles on March 06, 2014, 04:51:28 PM
Hi,

I am looking for a way to sign the content of (binary) files with my private keys. Almost every client can sign text messages, but I haven't found a solution for signing files.

Any ideas or hints on existing solutions?



Title: Re: Sign files
Post by: hobbes on March 06, 2014, 07:30:32 PM
You could hash the file and then sign the hash.

It's should be relatively easy with pybitcointools or on linux command line:

   shasum -a 256 yourfile

Then you can use bitcoind or bitcoin-qt to sign.



Title: Re: Sign files
Post by: ning on March 08, 2014, 01:23:33 PM
Hi,

I am looking for a way to sign the content of (binary) files with my private keys. Almost every client can sign text messages, but I haven't found a solution for signing files.

Any ideas or hints on existing solutions?



Internally, the clients actually only sign the hash digest of the text message we enter:)


Title: Re: Sign files
Post by: cranial.nerve on March 11, 2014, 10:40:48 PM
What a problem with gpg - OpenPGP encryption and signing tool
Code:
gpg --help
 -s, --sign [ file ]             make a signature


Code:
man gpg

Quote
       -s     Make  a  signature. This command may be combined with --encrypt (for a signed and encrypted message), --symmetric (for a signed and symmetrically encrypted message), or --encrypt and --symmetric together (for a
              signed message that may be decrypted via a secret key or a passphrase).  The key to be used for signing is chosen by default or can be set with the --local-user and --default-key options.


Almost every secure focused distributive iso signed, see for example Tails: https://tails.boum.org/torrents/files/tails-i386-0.22.1.iso.sig

However, Debian sign hashes http://cdimage.debian.org/debian-cd/7.4.0/amd64/jigdo-bd/MD5SUMS.sign