- Goals
- Sign data with two PGP public keys which are based on a Ethereum private key
- Both parties should be able to decrypt the payload without the need for both keys
WARNING DO NOT USE THE PRIVATE KEYS IN THIS REPO!
Bob
generates PGP keys offchain using private key as seedBob
sendspublic
key to client (webapp)Alice
visits site - generates PGP key locally (in browser) using web3 enable private keyAlice
fills in required dataAlice
, in combination withBob
spublic
key,signs
the payloadAlice
then places this on chain (via a smart contract) for all to seeBob
then listens for new entries to this smart contract and candecrypt
away using onlyprivate
key he has- Data could be stored on
IPFS
and then this is the hash used onchain only
-
$ node ./scripts/generate_buyer_pgp_key.js
- Generates public/private key
-
$ node ./scripts/generate_seller_pgp_key.js
- Generates public/private key
-
$ node ./scripts/sign_payload.js
- Encrypts random JSON blob with both public keys
- Pins PGP encrypted message to IPFS
-
$ node ./scripts/decrypt_payload.js
- Decrypts random JSON blob for both parties using individual private key
-
$ node ./scripts/decrypt_ipfs_hash.js
- Downloads given IPFS blob
- Decrypts blob for both parties using individual private key