Conditions | 1 |
Total Lines | 7 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import * as crypto from 'crypto'; |
||
17 | |||
18 | public async decrypt(buffer: Buffer): Promise<Buffer> { |
||
19 | const key = await this.getEncryptionKey(); |
||
20 | const iv = buffer.slice(0, 16); |
||
21 | const decipher = crypto.createDecipheriv('aes-256-ctr', key, iv); |
||
22 | |||
23 | return Buffer.concat([decipher.update(buffer.slice(16)), decipher.final()]); |
||
24 | } |
||
36 |