Disallow the use of insecure hash algorithms, such as SHA-1, in Message Authentication Code (MAC) algorithms.
import cryptoFramework from '@ohos.security.cryptoFramework';
import { CryptoJS } from '@ohos/crypto-js';
cryptoFramework.createMac('SHA256');
CryptoJS.HmacSHA256('Message').toString(); import cryptoFramework from '@ohos.security.cryptoFramework';
import { CryptoJS } from '@ohos/crypto-js';
cryptoFramework.createMac('SHA1');
CryptoJS.HmacSHA1('Message').toString(); plugin:@security/recommended plugin:@security/all
For details about how to configure Code Linter check rules, see Code Linter.