-
Notifications
You must be signed in to change notification settings - Fork 56
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
Not the same result while repeating the same operation #18
Comments
there is a bug with ESP8266.
i just got my ESP8266 therefore i hope in the following days i will fully
support the board.
Thank you
spaniakos
…On Wed, Jul 26, 2017 at 12:56 PM, Raphyyy ***@***.***> wrote:
Hi, thank you for your work :)
Environment : ESP8266 12E
I tested your librairy 3 times on the same string, but the results are not
the same on each.
Here's my code :
#include <AES.h>
#include <Base64.h>
AES aes;
byte key[] = {0x4C, 0x7E, 0x19, 0x16, 0x28, 0x87, 0xD2, 0xA8, 0xAB, 0xF1, 0x15, 0x88, 0x02, 0xCF, 0x4E, 0x3C};
byte iv[] = {0x46, 0xc5, 0x12, 0x05, 0x3f, 0x1c, 0xc7, 0x1d, 0x2a, 0xa1, 0x27, 0xcd, 0xab, 0x7d, 0xcc, 0x9a};
char* message1 = "pmscnv687,232o,0";
char* message2 = "pmscnv687,232o,0";
char* message3 = "pmscnv687,232o,0";
void setup() {
Serial.begin(115200);
Serial.println("Booting...");
char encryptMsg1[200];
encryptAES(message1, encryptMsg1);
Serial.println(encryptMsg1);
char encryptMsg2[200];
encryptAES(message2, encryptMsg2);
Serial.println(encryptMsg2);
char encryptMsg3[200];
encryptAES(message3, encryptMsg3);
Serial.println(encryptMsg3);
}
void encryptAES(char* message, char* output)
{
aes.set_key(key, sizeof(key));
byte cipher[300];
char b64data[300];
memset(cipher, 0x00, 300);
memset(b64data, '\0', 300);
Serial.println("===");
Serial.printf("%s , %d\n", message, strlen(message));
//int b64len = base64_encode(b64data, message, strlen(message));
// Encrypt! With AES128, our key and IV, CBC and pkcs7 padding
aes.do_aes_encrypt((byte*)message, strlen(message), cipher, key, 128, iv);
base64_encode(output, (char*)cipher, aes.get_size());
}
Here the output :
===
pmscnv687,232o,0 , 16
rxUZg7tFONY5TjW8Kk6ehw==
===
pmscnv687,232o,0 , 16
hC/xnjNW7EiVgLM7u60bmw==
===
pmscnv687,232o,0 , 16
gm9YHW9WE8XPWRZEoJgTqg==
The first result is ok while decrypting, the 2 others are not.
I try to initialize the AES object in my encryptAES() function, I had the
same result.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABnM6j2pzvTSTTkjNlfSD8j-fjefVqSwks5sRw1hgaJpZM4OjsaW>
.
|
Thanks a lot for doing that. |
hopefully by the end of the next week
…On Thu, Jul 27, 2017 at 11:43 AM, Raphyyy ***@***.***> wrote:
Thanks a lot for doing that.
Could you please tell me an approximate day when it could be fixed ?
It's for an important project and I came accross all Github but your
solution seems to be the only one which permit an AES128 CBC and include a
padding to crypt variable length message.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABnM6jKF9vMcxErRk1g9nUaNoUTVQlLJks5sSE3BgaJpZM4OjsaW>
.
|
Looking forward the next steps in ESP8266! Thanks for the lib! It's Great! |
I am off to summer vacations
But soon i will support the board
…On Aug 10, 2017 19:43, "André Luiz Ferraz" ***@***.***> wrote:
Looking forward the next steps in ESP8266! Thanks for the lib! It's Great!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABnM6ik-s8h7a7AYRHdPayhc0xQt8xWWks5sWzMWgaJpZM4OjsaW>
.
|
actually I think that you might have found a little bug there, still trying to understand it ^^ |
Hello, was there any success with adding support for esp8266 ? I looked at this issue and the problem seems to be that Maybe I'm not getting the issue, but i can be solved by passing a copy of void encryptAES(char* message, char* output)
{
aes.set_key(key, sizeof(key));
byte temp_iv[sizeof(iv)];
memcpy(temp_iv, iv, sizeof(iv));
byte cipher[300];
char b64data[300];
memset(cipher, 0x00, 300);
memset(b64data, '\0', 300);
Serial.println("===");
Serial.printf("%s , %d\n", message, strlen(message));
//int b64len = base64_encode(b64data, message, strlen(message));
// Encrypt! With AES128, our key and IV, CBC and pkcs7 padding
aes.do_aes_encrypt((byte*)message, strlen(message), cipher, key, 128, temp_iv);
rbase64_encode(output, (char*)cipher, aes.get_size());
} Tested on ESP8266-01 |
Hello, ===testng mode PLAIN :abcdefghij1234567890ABCDEFGHIJ �C�I�C�B�>����P|N��$����۪ Plain2:abcdefgiij1234577890ABCDEFGHIJ ============================================================ |
Sent me your .ino file
And I will try to run it on my machine
…On Thu, Aug 16, 2018, 16:49 HitChand ***@***.***> wrote:
Hello,
Good Day !!!
Has a solution been found for the issue ?
Even I am not getting a proper output?
Are there any criteria for the input text ?
Following is the sample run on Ubuntu:-
===testng mode
PLAIN :abcdefg*hij*1234*567*890ABCDEFGHIJ
�C�I�C�B�>����P|N��$����۪
Plain2:abcdefg*iij*1234*577*890ABCDEFGHIJ
============================================================
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABnM6iKuUvtlWwv3iD2XAQ0HIjVY2BL1ks5uRXhegaJpZM4OjsaW>
.
|
@spaniakos |
My email is spaniakos@gmail.com
:)
…On Thu, Aug 16, 2018, 18:01 HitChand ***@***.***> wrote:
@spaniakos <https://github.com/spaniakos>
Hello,
Where can I send you the code files ?
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABnM6qI3W6FP9kcyGzftYaMMKsHnuW-fks5uRYkxgaJpZM4OjsaW>
.
|
@HitChand |
@spaniakos
Hello,
I plan to integrate this on my NodeMcu.
However, I have tested the code on Ubuntu.
Thanks & Regards,
HitChand
*** This message has been sent using GIONEE F103 Pro ***
…On Aug 18, 2018 16:04, Georgios Spanos ***@***.***> wrote:
@HitChand
are you using ESP8266 or NodeMCU?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
i will check it on a NodeMCU, i am expecting mine to come between 21st and 31st of august (got 2 NodeMCU) that i need for a project. |
Hi, thank you for your work :)
Environment : ESP8266 12E
I tested your librairy 3 times on the same string, but the results are not the same on each.
Here's my code :
Here the output :
The first result is ok while decrypting, the 2 others are not.
I try to initialize the AES object in my encryptAES() function, I had the same result.
If I reset the sketch, I have exactly the same output.
The text was updated successfully, but these errors were encountered: