4

I am using the public domain reference implementation of AES Rijndael, commonly distributed under the name "rijndael-fst-3.0.zip". I plan to use this to encrypt network data, and I am wondering whether the results of encryption will be different on big/little endian architectures? In other words, can I encrypt a block of 16 bytes on a little endian machine and then decrypt that same block on big endian? And of course, the other way around as well.

If not, how should I go about swapping bytes?

Thanks in advance for your help.

Kind regards.

menjaraz
  • 7,551
  • 4
  • 41
  • 81
Philip Bennefall
  • 1,477
  • 5
  • 20
  • 33
  • 6
    The trouble is, I am totally blind and so I am browsing the web with a screen reader (Jaws for Windows). That has trouble with certain parts of some pages, for instance I cannot seem to find out how to activate the "accept" option on an answer. Otherwise I'd gladly do so. The accept option only appears as normal text. – Philip Bennefall Jul 03 '11 at 17:11
  • 2
    @user749473: I'll bet the stackoverflow site designers would love to make their more accessible to the blind. Maybe if you have time you could post a question/comment about your difficulties on meta.stackoverflow.com – President James K. Polk Jul 03 '11 at 20:56

2 Answers2

4

Byte order issues are relevant only in context of mapping multi-byte constructs to a sequence of bytes e.g. mapping a 4-byte sequence to a signed integer value is sensitive to byte order.

The AES algorithm is byte centric and insensitive to endian issues.

alphazero
  • 27,094
  • 3
  • 30
  • 26
3

Rijndael is oblivious to byte order; it just sees the string of bytes you feed it. You should do the byte swapping outside of it as you always would (with ntohs or whatever interface your platform has for that purpose).

Fred Foo
  • 355,277
  • 75
  • 744
  • 836