GithubHelp home page GithubHelp logo

Comments (3)

qistoph avatar qistoph commented on July 30, 2024

"AES is a variant of Rijndael which has a fixed block size of 128 bits, and a key size of 128, 192, or 256 bits." (http://en.wikipedia.org/wiki/Advanced_Encryption_Standard)

You will have to update the data in blocks of 128 bits.

Try something like this:

// data[32]
aes256_encrypt_ecb(&ctxt, data); // encrypt first block of 128 bits in place
aes256_encrypt_ecb(&ctxt, data+16); // encrypt second block of 128 bits in place
DUMP("Encrypted data: ", i, data, sizeof(data));

aes256_decrypt_ecb(&ctxt, data); // decrypt first block of 128 bits in place
aes256_decrypt_ecb(&ctxt, data+16); // decrypt second block of 128 bits in place
DUMP("Back decrypted data: ", i, data, sizeof(data));

from arduinoaes256.

spinningarrow avatar spinningarrow commented on July 30, 2024

That helps; thank you!

from arduinoaes256.

qistoph avatar qistoph commented on July 30, 2024

Please be aware though that the described method performs ECB mode encryption.

Have a look at http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29 for more details.

from arduinoaes256.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.