Results 1 to 9 of 9

Thread: AES cipher help

  1. #1
    Join Date
    Nov 2010
    Beans
    59

    AES cipher help

    Hi,

    I am trying to write my own 128 bit AES implementation in Java and I'm having trouble learning how AES works. I understand roughly how the cipher works but I don't understand how the key schedule is generated, how mixing the columns works, or how adding the round key works.

    I would be glad if someone could explain these three things or show me some example code.

  2. #2
    Join Date
    Sep 2009
    Beans
    207
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: AES cipher help

    Is this homework? And have you read the wikipedia articles relating to these things ?

    http://en.wikipedia.org/wiki/Rijndael_key_schedule

    http://en.wikipedia.org/wiki/Advance...ption_Standard

  3. #3
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: AES cipher help

    I would think poring over the mcrypt source code might be instructive.

  4. #4
    Join Date
    Aug 2007
    Location
    Novocastria, Australia
    Beans
    751
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: AES cipher help

    Uni homework I'm guessing? I'm only saying because I got pretty much this exact same assignment last week.

    From my experience, to understand the round function better, you really need to find a good textbook. I found that wikipedia didn't quite have enough details. I've got Cryptography and Network Security by Stallings, it's pretty good, I would recommend seeing if your library has a copy.

  5. #5
    Join Date
    Nov 2010
    Beans
    59

    Re: AES cipher help

    No this is not homework. I'm a freshman in high school and I don't think they give assignments like that in high school.

    A while ago I was listening to a Security Now podcast (#125) and the AES cipher seemed kinda simple... even weak.

    So call me crazy if you like but I'm writing some special code to analyze it and hopefully break it!!!

    If someone could find some working example code that I could port to my analyzer library or just answer my question without a bunch of mathematical gibberish like on Wikipedia I'd be very happy.

    Update:

    ***WARNING***
    Google says the following site is malicious so use noscript!

    I found this: http://www.hoozi.com/Articles/AESEncryption.htm

    I'll try to port it.
    Last edited by BSOD64; April 20th, 2011 at 03:36 AM.

  6. #6
    Join Date
    Oct 2004
    Location
    USA
    Beans
    331
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: AES cipher help

    If you are looking for some example code, Bruce Schneier has the C version of Rijndael on his website. I do not recall if there were slight modifications to Rijndael for AES, but that would be something you would need to investigate.

    As far as the key schedule, there is a flash video that might help if you have not seen it yet: http://www.cs.bc.edu/~straubin/cs381...ingles2004.swf

    I would look into getting a book from the library if you can find something relevant. I thought Schneier's Applied Cryptography would have it, but could not find anything in the Table of Contents.

  7. #7
    Join Date
    Aug 2007
    Location
    Novocastria, Australia
    Beans
    751
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: AES cipher help

    Quote Originally Posted by BSOD64 View Post
    No this is not homework. I'm a freshman in high school and I don't think they give assignments like that in high school.

    A while ago I was listening to a Security Now podcast (#125) and the AES cipher seemed kinda simple... even weak.
    Good to hear that you are doing self directed learning then, we need more motivated people like you

    You're right, AES is very simple, this doesn't necessarily mean it's weak though (which is very lucky!).

  8. #8
    Join Date
    Nov 2010
    Beans
    59

    Re: AES cipher help

    Does anyone know if the code I found is good?

    http://www.hoozi.com/Articles/AESEncryption.htm

    key = {0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x06 ,0x07 ,0x08 ,0x09 ,0x0a ,0x0b ,0x0c ,0x0d ,0x0e ,0x0f}
    plaintext = {0x00 ,0x11 ,0x22 ,0x33 ,0x44 ,0x55 ,0x66 ,0x77 ,0x88 ,0x99 ,0xaa ,0xbb ,0xcc ,0xdd ,0xee ,0xff}
    ciphertext = 69 c4 e0 d8 6a 7b 04 30 d8 cd b7 80 70 b4 c5 5a
    Last edited by BSOD64; April 20th, 2011 at 10:32 PM.

  9. #9
    Join Date
    Nov 2010
    Beans
    59

    Re: AES cipher help

    I got the cipher working a while ago.

    Now to break it!

    Edit:

    btw here's what really helped me: http://www.cs.bc.edu/~straubin/cs381...ingles2004.swf
    Last edited by BSOD64; August 22nd, 2011 at 04:57 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •