UNPKG

587 BTypeScriptView Raw
1interface Encrypted {
2 encrypted: Uint8Array;
3 nonce: Uint8Array;
4}
5/**
6 * @name naclEncrypt
7 * @summary Encrypts a message using the supplied secretKey and nonce
8 * @description
9 * Returns an encrypted message, using the `secretKey` and `nonce`. If the `nonce` was not supplied, a random value is generated.
10 * @example
11 * <BR>
12 *
13 * ```javascript
14 * import { naclEncrypt } from '@polkadot/util-crypto';
15 *
16 * naclEncrypt([...], [...]); // => [...]
17 * ```
18 */
19export declare function naclEncrypt(message: Uint8Array, secret: Uint8Array, nonce?: Uint8Array): Encrypted;
20export {};