How to use the getCiphers function from crypto

Find comprehensive JavaScript crypto.getCiphers code examples handpicked from public code repositorys.

44
45
46
47
48
49
50
51
52
53
54
55
  FIPS: /not supported in FIPS mode/,
  length: /Invalid initialization vector/,
  authTagLength: /Invalid authentication tag length/
};


const ciphers = crypto.getCiphers();


const expectedWarnings = common.hasFipsCrypto ?
  [] : [
    ['Use Cipheriv for counter mode of aes-192-gcm'],
fork icon42
star icon19
watch icon0

115
116
117
118
119
120
121
122
123
124
125
  // Each element should be a string.
  assert(list.every((value) => typeof value === 'string'));
}


// Assume that we have at least AES-128-CBC.
const cryptoCiphers = crypto.getCiphers();
assert(crypto.getCiphers().includes('aes-128-cbc'));
validateList(cryptoCiphers);
// Make sure all of the ciphers are supported by OpenSSL
for (const algo of cryptoCiphers) {
fork icon42
star icon19
watch icon0

1
2
3
4
5
6
7


exports.createCipher = exports.Cipher = crypto.createCipher
exports.createCipheriv = exports.Cipheriv = crypto.createCipheriv
exports.createDecipher = exports.Decipher = crypto.createDecipher
exports.createDecipheriv = exports.Decipheriv = crypto.createDecipheriv
exports.listCiphers = exports.getCiphers = crypto.getCiphers
fork icon0
star icon0
watch icon0