Open yashasvi-ranawat opened 2 years ago
I don't think that this is BitCash specific and might make the most sense to have it in its own repository and Python package. If I'm not mistaken, would this code work for Bitcoin, Bitcoin Cash, and Bitcoin SV?
@sometato No, this is not BitCash specific. Would work with any Elliptical Curve based public/private key pair crypto.
However, it adds feature parity with the Electron-Cash app. Users of BitCash get the simplicity of public/private key based encryption/decryption. Such encryption/decryption methods are very common, and have allied applications.
@merc1er
Although I don't mind waiting for the review, you can also test out the feature parity with the Electron-cash app.
>>> key = wif_to_key('cU6s7jckL3bZUUkb3Q2CD9vNu8F1o58K5R5a3JFtidoccMbhEGKZ')
>>> key.public_key.hex()
'033d5c2875c9bd116875a71a5db64cffcb13396b163d039b1d9327824891804334'
This hex of public key can be used in the Electron-Cash app to encrypt any message.
>>> encrypted_message = <string of encrypted message from the electron-cash app>
>>> key.decrypt_message(encrypted_message)
<the message in its binary format>
Uses ECIES encryption decryption method; AES-128-CBC with PKCS7 is used as the cipher; hmac-sha256 is used as the mac