@signuply/secret
v0.0.50
Published
```ts import { createSecretClient } from '@signuply/secret'; import assert from 'assert';
Downloads
22
Readme
@signuply/secret
import { createSecretClient } from '@signuply/secret';
import assert from 'assert';
const secretClient = createSecretClient({
encryptionKey: '<128BITS_KEY>',
});
// generate cryptographic secret
const secret = await secretClient.generate();
// encrypt with aes-256-cbc
const encrypted = secretClient.encrypt(secret);
const decrypted = secretClient.decrypt(encrypted);
assert.equal(secret, decrypted);
// generate cyptographic hash with hmac algorithm
const hash = secretClient.hash(secret);