(key, iv)
| 43 | |
| 44 | |
| 45 | function testCipher2(key, iv) { |
| 46 | // Test encryption and decryption with explicit key and iv |
| 47 | const plaintext = |
| 48 | '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' + |
| 49 | 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' + |
| 50 | 'jAfaFg**'; |
| 51 | const cipher = crypto.createCipheriv('des-ede3-cbc', key, iv); |
| 52 | let ciph = cipher.update(plaintext, 'utf8', 'buffer'); |
| 53 | ciph = Buffer.concat([ciph, cipher.final('buffer')]); |
| 54 | |
| 55 | const decipher = crypto.createDecipheriv('des-ede3-cbc', key, iv); |
| 56 | let txt = decipher.update(ciph, 'buffer', 'utf8'); |
| 57 | txt += decipher.final('utf8'); |
| 58 | |
| 59 | assert.strictEqual(txt, plaintext, |
| 60 | `encryption/decryption with key ${key} and iv ${iv}`); |
| 61 | } |
| 62 | |
| 63 | |
| 64 | function testCipher3(key, iv) { |
no test coverage detected
searching dependent graphs…