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

Source is being modified. #21

Open
facetime88 opened this issue Aug 15, 2017 · 1 comment
Open

Source is being modified. #21

facetime88 opened this issue Aug 15, 2017 · 1 comment

Comments

@facetime88
Copy link

facetime88 commented Aug 15, 2017

Hi there,

Sorry that I am new in arduino.
I just make a test as follow:

uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
char data[] = "0123456789012345";
aes256_enc_single(key, data);
Serial.println(data);
Serial.println(data);
char output[base64_enc_len(sizeof(data))];
//base64_encode(output, data, sizeof(data));
aes256_dec_single(key, data);
Serial.print("decrypted:");
Serial.println(data);

This will be output correctly (the decryption is successful)

�⸮⸮⸮⸮�s⸮�B⸮ ⸮3⸮O
�⸮⸮⸮⸮�s⸮�B⸮ ⸮3⸮O
decrypted:0123456789012345

But when include back the function base64_encode(output, data, strlen(data)); it makes the decryption failed.

Kf⸮⸮eh@⸮⸮⸮I⸮⸮f⸮�
Kf⸮⸮eh@⸮⸮⸮I⸮⸮f⸮�
decrypted:⸮�⸮`:Q⸮⸮c⸮D ,⸮|⸮

Seems the encoder make some modification to the input data.
Am I missing something here..?
Thanks.

@palto42
Copy link

palto42 commented May 6, 2018

I faced the same issue and identified two issues which I fixed in the example code, see pull request #23
See also my #12 (comment)

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