Encrypt for self
Returns
Encrypt content for an account. The public key of the address account wil be used for encryption. This will return the encrypted content.
Usage
Required parameters
Parameter | Description |
---|---|
account** ** - Account | Account to encrypt the content for. Public key of the account will be used for encrypting. |
content | Content to encrypt. |
Optional parameters
In addition to the required parameters above, an object of optional parameters can be passed following the content like so:
encryption.encrypt_for_self(public_key, content,
{as_hex: false}
)
as_hex - boolean
Default: true
If true, the function will return the encrypted result as a hexadecimal string representation.
as_string - boolean
Default: true
Should be set to true if the content to encrypt is a string.
The encryption curve in this function is either ed25519
for Solana accounts or secp256k1
for all other accounts.
Example
Last updated