-
Notifications
You must be signed in to change notification settings - Fork 212
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
Encrypt String longer than blockSize() #64
Comments
Can you provide an example of what you are trying to do? Which cipher are you trying to use? |
I want to use either AES256, AESTiny256, or AESSmall256 I want to do something like this:
Im not able to use Strings that are longer than 16. Im looking for an example to write the functions "myEncrypt()" and "myDecrypt" |
The AES block ciphers on their own are not useful for encrypting large blocks of data. They are a building block. What you need is to wrap the block cipher with a mode like CTR, GCM, EAX, or XTS. Then you can encrypt or decrypt as much data as you would like. Some brief examples here: http://rweather.github.io/arduinolibs/classCTR.html Some background information on block cipher modes and when to apply them: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation |
Thanks allot for your reply!!! I did some tests with CTR. But it seems to cut of the last part of my strings.
and i tested with these code:
Result:
Did i missed something on ctr.setKey(_key, 32), ctr.setIV(_iv, 16), or ctr.setCounterSize(16)? |
did you find a way to do that? |
Hello,
can someone provide an example how i can encrypt/decrypt a String that is longer than 16?
I'm constantly failing.
The text was updated successfully, but these errors were encountered: