- Who is it for?
- API (for developers)
- Installation
- Popup UI (for users)
- GMail support
- Dropbox-like support
- Debugging issues
NuCypher is the go-to solution for anyone aiming to build privacy-rich applications on the blockchain. But it lacks a JavaScript library. Moreover, their codebase is written in Python, making it difficult to port over to the web side. nuBox chrome extension can solve these issues without you ever having to know about NuCypher at all! It even has an insanely simple API which it injects onto every website! It even comes with support for IPFS!
Moroever, it now comes with inbuilt GMail support (forget all about the insance email encryption setup and PGP!), and you can even save and share your files without ever having to visit any website!
All API calls are available under nuBox namespace. All of them supports Promises.
This API call is used to check whether the nuBox chrome extension is running successfully on the client machine. It can fail if the Chrome native host fails to start or has exited.
await nuBox.isHostRunning();
This API call is used to request permission from the user to start using the nuBox
APIs (for this web host). On calling this API, it'll open a popup, like shown below. If user hasn't approved this request, you can only use the isHostRunning
API.
await nuBox.approve();
This API call is used to encrypt a block of plaintext. Due to chrome limitations, it's recommended to keep under 256 KB for the plaintext size.
await nuBox.encrypt(plaintext, label, ipfs);
It expects atleast two arguments: plaintext
and label
. ipfs
is optional (with default value false
), and if it's set as true, the encrypted data will be uploaded to Infura IPFS and the IPFS hash will be returned. The encrypted data can be accessed by visiting: https://ipfs.infura.io/ipfs/<hash>/
.
This API call is used to decrypt a block of encrypted text. Due to chrome limitations, it's recommended to keep under 256 KB for the encrypted size.
await nuBox.decrypt(encrypted, label, ipfs);
It expects atleast two arguments: encrypted
and label
. ipfs
is optional (with default value false
), and if it's set as true, the encrypted
argument should be the Infura IPFS hash from which the encrypted data will be downloaded.
This API call is used to invoke a grant request waiting for user's permission to approve or reject the request.
await nuBox.grant(label, bek, bvk, expiration, noPopup);
It expects atleast four arguments: label
, bek
, bvk
and expiration
.
bek
is Bob's encrypting key (which is a hex-encoded string). It can be retrieved usinggetBobKeys
API.bvk
is Bob's verifying key (which is a hex-encoded string). It can be retrieved usinggetBobKeys
API.expiration
is a ISO-8601 formatted datetime string (in the format ofYYYY-MM-DD HH:mm:ss
. For example, '2019-03-29 22:23:10').noPopup
to disable showing the popup. It's default value isfalse
(meaning popup will be shown). This option is only honored if both Alice and Bob (for whom the grant is requested) are running on the same machine. If not, it's ignored.
It'll open up a grant popup for the user to approve. It'll have the sender information and also details about the grant request. If the user approves this request, it'll be send to the NuCypher network for processing.
This API call is used to invoke a revoke request waiting for user's permission to approve or reject the request.
await nuBox.revoke(label, bvk, noPopup);
It expects aleast two arguments: label
and bvk
(Bob's verifying key).
noPopup
to disable showing the popup. It's default value isfalse
(meaning popup will be shown). This option is only honored if both Alice and Bob (for whom the revoke is requested) are running on the same machine. If not, it's ignored.
It'll open up a revoke popup for the user to approve. It'll have the sender information and also details about the revoke request. If the user approves this request, it'll be send to the NuCypher network for processing.
This API call is used to get Bob's encrypting key and verifying key (both are public keys) that can be used for granting access for Bob to a policy.
await nuBox.getBobKeys();
nuBox packages all NuCypher dependencies into docker containers. All the user needs to have is docker, docker-compose and chrome browser (or Brave browser).
Run the below step to install the nuBox chrome host.
$ git clone [email protected]:robin-thomas/nubox-ext
$ cd nubox-ext
$ git submodule init
$ git submodule update --remote --recursive
$ sudo docker-compose build
$ sudo docker-compose up -d
$ ./host/install_chrome.sh
If you want to use it with Brave browser, run the below commands.
$ cd nubox-ext
$ sudo docker-compose build
$ sudo docker-compose up -d
$ ./host/install_brave.sh
nuBox host is written in Python 3.6. It also assumes that the python binary is at the location /usr/bin/python3.6
You'll also need to install the nuBox chrome extension. Since it's not packaged into Chrome Web Store, follow the below steps to install it.
- Head over to chrome://extensions
- Turn ON the developer mode
- Click on "Load unpacked"
- Select the nuBox extension directory (
nubox-ext/extension
) and click "Ok" - You'll be able to see that nuBox chrome extension has been successfully loaded!
nuBox also comes with a popup UI that the user can use to interact with NuCypher without any of the complexity. It has the following features:
-
It will show the "online" status (online meaning it was able to connect to the NuCypher network). All the below operations are only enabled if "online".
-
Retrieve
Bob's encrypting and verifying keys
-
Encrypt
a block of text. -
Decrypt
a block of text -
Grant
access for Bob for the label, so thatdecrypt
operation can pass for Bob (can autoload Bob's details). -
Revoke
access for Bob for the label, so thatdecrypt
operation will fail for Bob (can autoload Bob's details). -
Any errors in the above API calls will alert the error message onto the active tab of the browser.
Forget the insane installation setup of encrypted emails and PGP! With nuBox, you can have 1-click encrypt and auto-decrypt! Zero installation setup too!
nuBox auto adds the Encrypt and Decrypt buttons for each gmail compose window. Clicking on Encrypt button will automatically encrypt the email body with NuCypher network and then encode them into emojis! When you try to open the encrypted email, nuBox will automatically decode the emojis and then decrypts it using NuCypher (decrypt will fail if user is not granted permission). Voila!
You can use the nuBox popup UI to grant permissions for multiple recipients. The label used is the email subject.
Forget storing your files on any server! With nuBox, you can securely store your files on IPFS and store the IPFS hashes on Chrome sync, meaning you can even access it from a different machine! Moreover you can share the files with anyone you like, and they can decrypt the files and download it!
- No websites or servers!
- Upload files, encrypt them and save it on IPFS
- Support large files, by storing splitting the files and storing them in chunks (meaning different IPFS hashes)
- IPFS hashes are stored in Chrome sync and hence can be accessed on any machine having Chrome browser with nuBox extension.
- Share files with anyone securely.
- Extensive Logging facility - see all the requests (inputs, output, timestamp) coming in.
- Supported file operations - rename, delete, download, share, file info.
- Check if extension is able to connect to NuCypher network.
- Supports uploading multiple files of same file name.
- nuBox is tested only on version 3.6.0 of Python. Any different version might lead to unexpected outputs.
- If your Python binary is not stored at
/usr/bin/python3.6
, make a symmlink to that location so that the host can run. - All run-time errors happening in the host will be stored at
host/err.log
along with the stack trace. - If the host crashed because of any of the above reasons, just restart the extension (after fixing the issue).
- Bob cannot retrieve same data twice: nucypher/nucypher#833
Free Software, Hell Yeah!