Gun-Vue docs v0.21.4 • Docs
Gun-Vue docs v0.21.4 / Crypto / encFor
Function: encFor()
encFor(
data
,sender
,receiver
):Promise
<string
>
Encrypts data for one receiver entity.
- Generates encryption secret using receiver's epub and sender's pair.
- Encrypts data with this secret.
Parameters
• data: string
Stringified data to be encrypted.
• sender: any
SEA Pair of the sender – epriv
key will be used to encrypt the data.
• receiver: Entity
An object with pub
and epub
strings - the user.is object of the receiver's account.
Returns
Promise
<string
>
- Encrypted data string to be sent.