AES after block

This is a discussion on AES after block within the Tech Board forums, part of the Community Boards category; Hello all, I'm looking through the AES encryption algorithm with the idea to implement it. I've been reading a lot ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    AES after block

    Hello all,

    I'm looking through the AES encryption algorithm with the idea to implement it. I've been reading a lot about it and it seems relatively easy. However, I don't get what happens after each encrypted block. Are the round keys supposed to change, or not? I can't find any way it should change, but it sounds quite insecure.

    Let me explain a bit better. Take AES 128 bits. 16 bytes are provided for a key and they are then expended to 11 round keys of 176 bytes in total.
    Now let's say we want to encrypt 16 bytes. After this, should the round keys be changed? If they are kept the same, and the next block to encrypt contains the same 16 bytes, the cipher text would be exactly the same.

    So let's say we send "Hello, world!!!!". It produces some cipher text. Then we send the same message again, a couple of messages later, and it would result in the same cipher text.

    My bet is a new key would have to be used or something should be done to the round keys, but I can't find any documentation about this anywhere...

    So, what should be done after each encrypted block?


    Thanks in advance

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,980
    Quote Originally Posted by EVOEx
    Now let's say we want to encrypt 16 bytes. After this, should the round keys be changed? If they are kept the same, and the next block to encrypt contains the same 16 bytes, the cipher text would be exactly the same.
    AES has a block size of 128 bits, i.e., 16 8-bit bytes. If you are talking about the next block, then it sounds like you should be involving an encryption mode. If you are encrypting the blocks in ECB mode, then indeed if the next block is identical, it would encrypt to the exact same ciphertext, given the same secret key. But if say you use CBC, then that should no longer be the case.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by laserlight View Post
    AES has a block size of 128 bits, i.e., 16 8-bit bytes. If you are talking about the next block, then it sounds like you should be involving an encryption mode. If you are encrypting the blocks in ECB mode, then indeed if the next block is identical, it would encrypt to the exact same ciphertext, given the same secret key. But if say you use CBC, then that should no longer be the case.
    Ahh, now that makes more sense! Thanks ;-).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 03:25 AM
  2. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  3. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM
  4. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM
  5. pointers
    By fanaonc in forum C Programming
    Replies: 3
    Last Post: 11-17-2001, 01:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21