-
Notifications
You must be signed in to change notification settings - Fork 182
How can I use asmcrypto to implement aes-cfb stream? #68
Comments
Hi, starting from 4e64ff1 you can use progressive cipher interface. var encryptor = new asmCrypto.AES_CFB.Encrypt( { key: ..., iv: ... } );
var ciphertext1 = encryptor.process(cleartext1).result;
var ciphertext2 = encryptor.process(cleartext2).result;
...
var ciphertextN = encryptor.finish().result; This is quite new feature and it hasn't been release yet, so you have to build asmcrypto.js from the source. |
It's pretty good! I've tried it yesterday. But it doesn't cover my needs. I'm trying to adapt this library to gopherjs to get huge performance improvement. In gopherjs, AES encryption takes nearly 1 second when encrypt 1MB text. Thanks for your awesome works! |
Yup, it doesn't. Just a doc error.
Unfortunely it's not possible for now. I'm working on this. That relates to CTR, CCM, GCM and OBF modes too. |
Thanks. That's will be excited! |
You can check pako.js' inflate/deflate stream interface, I think we could apply it here. |
Bad idea, take a look to pako.js README: var inflator = new pako.Inflate();
inflator.push(chunk1, false);
inflator.push(chunk2, false);
...
inflator.push(chunkN, true); // true -> last chunk
...
var output = inflator.result; Great, we end up with a gigabyte of |
Sorry, I didn't mean the default API: http://nodeca.github.io/pako/#Deflate.prototype.onData |
AES_CFB.encrypt
doesn't return the iv for next encrypt. Maybe it will preserve iv internally for next encrypt, but it looks like all aes encrypt or decrypt operation share one asm module. It will conflict when more than one cfb stream encrypt process with out of order.So, how can I use asmcrypto to implement aes-cfb stream?
The text was updated successfully, but these errors were encountered: