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