Skip to content

Commit 46ea9d1

Browse files
authored
[KeyVault] Add disclaimers regarding CBC and CBCPAD operations (Azure#22627)
1 parent bb63827 commit 46ea9d1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

sdk/keyvault/keyvault-keys/src/cryptographyClient.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ export class CryptographyClient {
258258
* Decrypts the given ciphertext with the specified decryption parameters.
259259
* Depending on the algorithm used in the decryption parameters, the set of possible decryption parameters will change.
260260
*
261+
* Microsoft recommends you not use CBC without first ensuring the integrity of the ciphertext using, for example, an HMAC. See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information.
262+
*
261263
* Example usage:
262264
* ```ts
263265
* let client = new CryptographyClient(keyVaultKey, credentials);
@@ -279,6 +281,9 @@ export class CryptographyClient {
279281
* let client = new CryptographyClient(keyVaultKey, credentials);
280282
* let result = await client.decrypt("RSA1_5", encryptedBuffer);
281283
* ```
284+
*
285+
* Microsoft recommends you not use CBC without first ensuring the integrity of the ciphertext using, for example, an HMAC. See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information.
286+
*
282287
* @param algorithm - The algorithm to use.
283288
* @param ciphertext - The text to decrypt.
284289
* @param options - Additional options.

sdk/keyvault/keyvault-keys/src/cryptographyClientModels.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ export interface AesCbcEncryptParameters {
283283
/**
284284
* The initialization vector used for encryption. If omitted we will attempt to generate an IV using crypto's `randomBytes` functionality.
285285
* An error will be thrown if creating an IV fails, and you may recover by passing in your own cryptographically secure IV.
286+
*
287+
* When passing your own IV, make sure you use a cryptographically random, non-repeating IV.
286288
*/
287289
iv?: Uint8Array;
288290
}
@@ -347,7 +349,8 @@ export interface AesCbcDecryptParameters {
347349
* The initialization vector used during encryption.
348350
*/
349351
/**
350-
* The ciphertext to decrypt.
352+
* The ciphertext to decrypt. Microsoft recommends you not use CBC without first ensuring the integrity of the ciphertext using an HMAC, for example.
353+
* See https://docs.microsoft.com/dotnet/standard/security/vulnerabilities-cbc-mode for more information.
351354
*/
352355
ciphertext: Uint8Array;
353356
/**

0 commit comments

Comments
 (0)