@bicycle-codes/simple-aes
Version:
An easy way to use symmetric keys in browsers or node
29 lines • 878 B
TypeScript
import { type SymmKeyLength } from './index.js';
export { type Message } from './types.js';
/**
* This is crypto implemented in user-land libraries,
* for the case where someone does not have a browser that
* is up to date and implements `webcrypto`.
*/
/**
* Take a message object, create a new AES key, and encrypt the message with the
* key. Return encrypted message and key, in that order.
*
* @param {{ content:string }} msg The message to encrypt.
* @returns {[{ content:string }, { key:string }]} The encrypted message and key.
*/
export declare function encryptMessage(msg: {
content: string;
}, opts?: {
length: SymmKeyLength;
}): Promise<[{
content: string;
}, {
key: string;
}]>;
export declare function decryptMessage(msg: {
content: string;
}, keyString: string): Promise<{
content: string;
}>;
//# sourceMappingURL=compat.d.ts.map