Home Manual Reference Source

Function

Static Public Summary
public

exchange(sender: Contact, receiver: Contact, msg: *): *

Creates an encrypted payload from the sender, to the receiver.

public

open(receiver: Contact | ContactPromise, data: *): *

Opens an encrypted payload

Static Public

public exchange(sender: Contact, receiver: Contact, msg: *): * source

import {exchange} from 'discretecrypt.js/src/discretecrypt.js'

Creates an encrypted payload from the sender, to the receiver.

This code assumes both individuals are using the same parameters.

Params:

NameTypeAttributeDescription
sender Contact
receiver Contact
msg *

Return:

*

TODO:

  • consider adding advanced options, like allowing the embedding of tuned scrypt parameters on the exchange key. The scrypt step is important for keysize derivation, and creates uniqueness between message exchanges, but the speed is not as important in this step.

public open(receiver: Contact | ContactPromise, data: *): * source

Opens an encrypted payload

Params:

NameTypeAttributeDescription
receiver Contact | ContactPromise
data *

Return:

*