Make a public key / private key box
Example
```
const obj = { hello: 'world' };
const pairA = crypto.nacl.box.generateKeyPair();
const pairB = gcrypto.nacl.box.enerateKeyPair();
const sharedA = box.before(pairB.publicKey, pairA.secretKey);
const sharedB = box.before(pairA.publicKey, pairB.secretKey);
const encrypted = crypto.nacl.box.encrypt(sharedA, obj);
const decrypted = crypto.nacl.box.decrypt(sharedB, encrypted);
console.log(obj, encrypted, decrypted);
```
Methods
# static decrypt(secretOrSharedKey, messageWithNonce, key) → {string}
Parameters:
Name | Type | Description |
---|---|---|
secretOrSharedKey |
string | |
messageWithNonce |
string | |
key |
string |
error
string