Hey all
I read everywhere that ECDSA
can't be used to encrypt
The fact is it can, I made a basic implementation:
https://github.com/jackjack-jj/jeeqIt uses a kind of secret sharing and it looks like that works well
It's in python and requires no dependencies
> pubkey='0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'.decode('hex')
> print encrypt_message(pubkey,"goodbye world!")
amoAAAJQkgEDcToivOFhH0zhaytsAKbW9dKCmOJ25FMPaj/6WssXAQKsSJpnq1IlNOx7GZbg++x6ZRUXAb/3jxaxwPGqlcItmA==
> pvk = str_to_long('0000000000000000000000000000000000000000000000000000000000000001'.decode('hex'))
> print 'output:', decrypt_message(pvk, msg_to_decrypt, verbose=True)
Public header (size:2): 0x5092
Version: 0
Checksum of pubkey: 5092
Private header (size:6): 0x0000000e75f1
Message size: 14
Checksum: 75f1
Decrypted message: goodbye world!
Hash: 75f1
Corresponds: True
output: ['goodbye world!', True]
My concern is about the security, can a crypto-pro give it a quick look? I'm sure it's as sure as signing because breaking it would need the same discrete logarithm than in Bitcoin but well, you never know...
Edit: I'd be happy to receive some crypted messages, you can find my public key on
blockchain.info