Skip to content

Instantly share code, notes, and snippets.

@daemonp
Last active July 10, 2019 05:36
Show Gist options
  • Save daemonp/66466eea3c8a72488cf041c378f1c71f to your computer and use it in GitHub Desktop.
Save daemonp/66466eea3c8a72488cf041c378f1c71f to your computer and use it in GitHub Desktop.

Simple way to post an encrypted screenshot to IPFS and decrypt it on the fly with the public key as an anchor in the link.

Garto:

ipfs hash A is just the encrypted image, and ipfs hash B is a page that isn't encrypted and contains js that downloads the image using a hard coded (in B) reference to A and decrypts using the frag identifier from url B. Then you just share B and it Just Works.

Features

  • Ephemeral Elliptic Curve (ed25519) for one shot asymmetric encryption
  • encrypt, put and pin asset
  • javascript decrypt function
  • put "viewer" payload with asset
  • generate view URL with public key from ephemeral private key
  • clear down keys

javascript NaCL

Similar projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment