-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CFB encryption/decryption segment size error may be incorrect #29
Comments
The library (and my python implementation) have made the assumption it is measured in bytes, but looking at it, I believe you are right, it should absolutely be in bits. I will update the test cases and adjust the code as needed to support bits. The test cases were specifically generated on byte alignments, but I see now the intention of CBF. This will be a major version bump. Thanks! I'll get to this soon. |
What's the status of this? |
I haven't had time to get to this yet... It's been a crazy time with Ethereum. If you create a pull request with the changes and add test cases though, I will verify and commit. Otherwise, it will probably still be a week or so before I can get to this. |
I actually realized that this is no longer an issue of mine, as I can use the pkcs7 padding as my input has already been padded. |
Any news on this one? |
Sorry, haven't had a chance to get to this, and this weekend is big hackathon. I will add something to my calendar to look into this next week. |
A fix for this would be much appreciated. |
Any progress? I can't use CFB properly - it just returns me a clear random instead of encrypted/decrypted buffer |
I am using this library to decrypt a CFB cipher 40 characters long, with a segment size of 16. It fails from this error:
if ((plaintext.length % this.segmentSize) != 0) {
throw new Error('invalid plaintext size (must be segmentSize bytes)');
}
However, when removing these line I am able to successfully decode the string.
Is this error incorrect? I was thinking segmentSize would be in bits and not bytes, so 40 bytes should be divisible into 16 bits without issue.
The text was updated successfully, but these errors were encountered: