Skip to content

Gun-Vue docs v0.21.4Docs


Gun-Vue docs v0.21.4 / Crypto / decFrom

Function: decFrom()

decFrom(data, sender, receiver): Promise<string>

Decrypts a private message from an entity.

  1. Generates secret using sender's epub and receiver's pair.
  2. Decrypts the data with this secret.

Parameters

data: string

Encrypted private data.

sender: Entity

An object with pub and epub strings - the user.is object of the sender's account.

receiver: any

SEA Pair of the receiver – epriv key will be used to decrypt the data.

Returns

Promise<string>

  • Decrypted data.

Defined in

src/crypto/useCrypto.js:53

MIT