You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a RijndaelBlock the constructor will convert the key to an array using its Utils.toArray function. This function if it's not already an array uses Node.js Buffer to convert it to an array. Didn't notice this as all my jasmine tests always worked because well its runs in Node. However, when I run this in a non-node environment it crashes because Buffer is undefined.
This library states it is a Pure JS library, however, having a dependency on server side Node.js kind of makes it not really pure as you compare them to two node libraries. I was depending on this not having any node.js dependencies.
I would consider this dependency a bug based on the readme.
The text was updated successfully, but these errors were encountered:
Okay, I was able to bypass all the uses of Buffer in encrypting except for the last one which has no if blocks around it. So the last Buffer.from used to return the encrypted data cannot be avoided and is always undefined. So I tried other crypto libs that support Rijndael and they are more complex or are not really Rijndael and are really AES. I would like to use this library, going to fork and try to find a replacement for Buffer.from but may have to use browserify which I would like to avoid.
If there are any easy ways to get Buffer to be properly defined in a browser as pure js please let me know.
I've just release v2.0.0 which (hopefully) resolves this issue. New version does not use Buffer directly, and returns byte Array instead. If you are using this module in browser environment, you can convert it into Uint8Array or some other types you want.
When you create a RijndaelBlock the constructor will convert the key to an array using its Utils.toArray function. This function if it's not already an array uses Node.js Buffer to convert it to an array. Didn't notice this as all my jasmine tests always worked because well its runs in Node. However, when I run this in a non-node environment it crashes because Buffer is undefined.
This library states it is a Pure JS library, however, having a dependency on server side Node.js kind of makes it not really pure as you compare them to two node libraries. I was depending on this not having any node.js dependencies.
I would consider this dependency a bug based on the readme.
The text was updated successfully, but these errors were encountered: