Ok, I finally figured your code out (and yes, this time I did). I had tried very hard to figure out what was wrong with it, but finally I just put it aside and worked on something else for awhile. Now that I'm done with that, I looked at it with "fresh eyes" and realized what was wrong. Very simple question, yes I made a thread about it, but here it goes. In the state, (a 4*4 block of bytes to anyone else out there), the encryption routine performs shifting right to left. Your encryption/decryption table lookups were all fine, but I noticed that they were exact opposite of each other. The encryption routine accessed them (in a visual, 4*4 box kind of a way) in a diagonal down to the right, which surprised me because I thought the shifting went from right to left. Your decryption routine of course did the opposite, complementing each other and providing the balance. I can see both sides of the problem, where what I think is supposed to happen accesses them "after shifting" and where your side acts like the data has not been shifted before grabbing the bytes. I got a little mixed up, could you clear up this little question of if you pretend like it's before or after shifting that you access them?
PS: (I'll probably be able to delete this thread if u delete yours and then I'll delete my post) Sry bout that last bit of confusion (or should I say byte). Ok, sry for that too. Thanks again if u or anyone helps me!
|