Files
common/docs/util-crypto/modules/_nacl_encrypt_.md
T
2018-12-10 10:45:54 +00:00

1.0 KiB

Functions

naclEncrypt

▸ naclEncrypt(message: Uint8Array, secret: Uint8Array, nonce?: Uint8Array): Encrypted

Defined in nacl/encrypt.ts:29

name: naclEncrypt

signature: naclEncrypt (message: Uint8Array, secret: Uint8Array, nonce?: Uint8Array): { encrypted: Uint8Array, nonce: Uint8Array }

summary: Encrypts a message using the supplied secretKey and nonce

description: Returns an encrypted message, using the secretKey and nonce. If the nonce was not supplied, a random value is generated.

example:

import { naclEncrypt } from '@polkadot/util-crypto';

naclEncrypt([...], [...]); // => [...]

Parameters:

Name Type Default value
message Uint8Array -
secret Uint8Array -
Default value nonce Uint8Array randomAsU8a(24)

Returns: Encrypted