Skip to content
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

decrypt use ECB mode, when the input less than 16 chars, decrypt error #33

Closed
nb7123 opened this issue Nov 10, 2015 · 1 comment
Closed

Comments

@nb7123
Copy link

nb7123 commented Nov 10, 2015

'BlockCopy' just copy 'KEYLEN' chars

@kokke
Copy link
Owner

kokke commented Nov 10, 2015

This is by design. You need to pass the AES library valid inputs.
That means making sure you're using correctly sized buffers and correctly zero-pad them as well, if needed.

As the readme says: "There is no built-in error checking or protection from out-of-bounds memory access errors as a result of malicious input.".
The algorithm expects blocks with lengths divisible by 16 bytes.
If you want to encrypt less data than a full block, pad it or use a stream oriented cipher mode like OFB :)

@kokke kokke closed this as completed Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants