Closed emacsen closed 5 years ago
This is absolutely an option. :)
In this example the 5
is the IV, but you could also pass in a 16 entry Array (or TypedArray) for your IV into the Counter object, which is what an IV is represented as in CTR mode.
This library is pure JavaScript, so the library is no different for either node or browsers.
Hope that helps, and let me know if you have any more questions. :)
Ah sorry I thought the example was messing with the counter, rather than the IV itself!
Is it accurate to say that the "counter" parameter in this library's AES-CTR mode is the IV?
There are situations in which it is necessary to set the IV in AES CTR mode, but this doesn't seem to be an option I can pass in this library.
It does appear to be an option in the Node.js implementation of crypto:
crypto.createDecipheriv('aes-256-ctr', key, iv);
Is this something that could be added to this libtary? I'm specifically interested in it for use in browser applications and unsure if this is supported by whatever this library is calling for the browser.