AES256-CBC only requires that IVs be unpredictable, so I don't see the need to generate IVs via PBKDF2, nor do I need salt; this approach would waste a lot of time.
Using hashed random data as IV can have the same effect, both crypto.randomInt and crypto.randomUUID can generate random data. This approach will be less time consuming.
https://github.com/D0n9X1n/hexo-blog-encrypt/blob/ad85a05602131f0f9f3febe901900f927576ebd9/index.js#L20 https://github.com/D0n9X1n/hexo-blog-encrypt/blob/ad85a05602131f0f9f3febe901900f927576ebd9/index.js#L93
AES256-CBC only requires that IVs be unpredictable, so I don't see the need to generate IVs via PBKDF2, nor do I need salt; this approach would waste a lot of time.
Using hashed random data as IV can have the same effect, both
crypto.randomInt
andcrypto.randomUUID
can generate random data. This approach will be less time consuming.