中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
微信扫码分享
import { cryptoFramework } from '@kit.CryptoArchitectureKit'; import { BusinessError } from '@kit.BasicServicesKit'; function kdfSync() { let spec: cryptoFramework.PBKDF2Spec = { algName: 'PBKDF2', password: '123456', salt: new Uint8Array(16), iterations: 10000, keySize: 32 }; let kdf = cryptoFramework.createKdf('PBKDF2|SHA256'); let secret = kdf.generateSecretSync(spec); console.info("[Sync]key derivation output is " + secret.data); }