Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createDecipheriv (suite, key, iv) {
suite = suite.toLowerCase()
if (aesModes[suite]) {
return aes.createDecipheriv(suite, key, iv)
} else if (desModes[suite]) {
return new DES({
key: key,
iv: iv,
mode: suite,
decrypt: true
})
} else {
throw new TypeError('invalid suite type')
}
}
exports.createCipher = exports.Cipher = createCipher
function createDecipheriv (suite, key, iv) {
suite = suite.toLowerCase()
if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
throw new TypeError('invalid suite type')
}
function createDecipheriv (suite, key, iv) {
suite = suite.toLowerCase()
if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
throw new TypeError('invalid suite type')
}