Skip to content

Commit

Permalink
revisando testes unitários de bcifras geradas por outras bibliotecas
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioconselheiro committed Feb 13, 2024
1 parent d98042e commit 63f2578
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/ciphers/aes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ describe('success flow aes', () => {
});

it('cbc generated from other implementation with the same algorithm type and params', async () => {
const decoded = await EncryptedURI.decrypt('encrypted:aes?iv=1dc8d28370372579a75feac6b5bf5290;U2FsdGVkX18K2mCM3jqJz9SSPC2Rss61NOk4JWeG5IE=', 'teste123', {
rounds: 250000,
hasher: 'sha256',
derivateKeyLength: 32
});
const decoded = await EncryptedURI.decrypt('encrypted:aes/cbc?iv=1dc8d28370372579a75feac6b5bf5290&c=1000&dklen=8&hasher=md5;U2FsdGVkX18K2mCM3jqJz9SSPC2Rss61NOk4JWeG5IE=', 'teste123');
expect(decoded).toEqual('teste123');
});

it('cbc generated from other implementation with the same algorithm type and params', async () => {
const decoded = await EncryptedURI.decrypt('encrypted:aes/cbc?iv=9d668dee3bccfd9d3d5fb786aab11894&c=1000&dklen=8&hasher=md5;U2FsdGVkX182g9bXg4UB/MsE9Dlz4lJcGC7WW4WGAVc=', 'exemplo');
expect(decoded).toEqual('exemplo');
});

it('ctr', async () => {
const originalMessage = 'mensagem secreta, favor não ler em voz alta';
const password = 'senha123';
Expand Down

0 comments on commit 63f2578

Please sign in to comment.