-
Alberto Gasparin authored
This is the last PR with lots of renaming for `loot-core`!
Alberto Gasparin authoredThis is the last PR with lots of renaming for `loot-core`!
encryption.test.ts 506 B
import * as encryption from './encryption';
afterEach(() => encryption.unloadAllKeys());
describe('Encryption', () => {
test('should encrypt and decrypt', async () => {
let key = await encryption.createKey({
id: 'foo',
password: 'mypassword',
salt: 'salt',
});
await encryption.loadKey(key);
let data = await encryption.encrypt('hello', 'foo');
let output = await encryption.decrypt(data.value, data.meta);
expect(output.toString()).toBe('hello');
});
});