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

Not decoding AES? #1

Open
StealthRT opened this issue Mar 24, 2017 · 0 comments
Open

Not decoding AES? #1

StealthRT opened this issue Mar 24, 2017 · 0 comments

Comments

@StealthRT
Copy link

Hey Lan:

I am trying your code and cpp example in my Arduino IDE for my ESP8266 esp-12f module and when I run the test code I get the following:

3FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B003FFF0B00

3FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE03FFF0AE0

The code I am running is this:

#include <AES.h>
#include <AES_config.h>

byte iv11[]  = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
byte key[] = "AhmedMustSleepnwAhmedMustSleepnw";
byte data[] = "AhmedMustSleepnw";
AES aes;

void callAES() {
  aes.set_key( key , sizeof(key)-1);
    byte cipher[sizeof(data)+17];
    aes.set_IV_array(iv11);
    aes.do_aes_encrypt(data, sizeof(data)-1 , cipher);
    aes.printArray(cipher,aes.get_size());
    
    byte decipher[aes.get_size()];
    aes.set_IV_array(iv11);
    aes.do_aes_decrypt(cipher,aes.get_size(),decipher);
    aes.printArray(decipher,aes.get_size());
}

So its looking like do_aes_decrypt is not working?

And it also looks like they are not matching (if they are suppose too):

3FFF0B003FFF0B003FFF0B0

3FFF0AE03FFF0AE03FFF0AE

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

1 participant