Problem with transformations in Rijndael's finite field

In summary, Rijndael's finite field is GF(28), with reducing polynomial x8+x4+x3+x+1. There is a step in the algorithm that takes a polynomial a(x)=a3x3+ a2x2+a1x+a0 with coefficients in GF(28), and multiplies it by a polynomial b(x)=b3x3+ b2x2+b1x+b0. And reduces it modulo x4+1, to get d(x)=d3x3+ d2x2+d1x+d0. This operation is equivalent, if a is a constant polynomial,
  • #1
qxcdz
8
0
I'm trying to implement AES as practice for my C++ skills, but I've come across a confusing problem that I think belongs here rather than in programming.

Rijndael's finite field is GF(28), with reducing polynomial x8+x4+x3+x+1

There is a step in the algorithm that takes a polynomial a(x)=a3x3+ a2x2+a1x+a0 with coefficients in GF(28), and multiplies it by a polynomial b(x)=b3x3+ b2x2+b1x+b0

and reduces it modulo x4+1, to get d(x)=d3x3+ d2x2+d1x+d0

This operation is equivalent, if a is a constant polynomial, according to the text, to the matrix multiplication:

[tex]\left( \begin{array}{c}
d_0 \\
d_1 \\
d_2 \\
d_3 \end{array} \right)=
\left( \begin{array}{cccc}
a_0 & a_3 & a_2 & a_1 \\
a_1 & a_0 & a_3 & a_2 \\
a_2 & a_1 & a_0 & a_3 \\
a_3 & a_2 & a_1 & a_0 \end{array} \right)
\left( \begin{array}{c}
b_0 \\
b_1 \\
b_2 \\
b_3 \end{array} \right)[/tex]

it gives the constant polynomial a(x) as [tex]a(x)=\{03\}x^3+\{01\}x^2+\{01\}x+\{02\}[/tex], and the inverse polynomial [tex]a^{-1}(x)=\{0b\}x^3+\{0d\}x^2+\{09\}x+\{0e\}[/tex] (all numbers in curly braces are hexadecimal).

Now, being as I'm using a computer to do this, and proper polynomial handling is hard to do, I'm using the matrix multiplication to do the calculation. Now, if I'm thinking about this properly, then the matrix representations of [tex]a(x)[/tex] and [tex]a^{-1}(x)[/tex] should have a product that is a unit matrix. But, if my calculations (done by my program) are correct, then:
[tex]
\left( \begin{array}{cccc}
\{02\} & \{03\} & \{01\} & \{01\} \\
\{01\} & \{02\} & \{03\} & \{01\} \\
\{01\} & \{01\} & \{02\} & \{03\} \\
\{03\} & \{01\} & \{01\} & \{02\} \end{array} \right)
\left( \begin{array}{cccc}
\{0e\} & \{0b\} & \{0d\} & \{09\} \\
\{09\} & \{0e\} & \{0b\} & \{0d\} \\
\{0d\} & \{09\} & \{0e\} & \{0b\} \\
\{0b\} & \{0d\} & \{09\} & \{0e\} \end{array} \right)=
\left( \begin{array}{cccc}
\{01\} & \{00\} & \{e5\} & \{00\} \\
\{00\} & \{01\} & \{00\} & \{e5\} \\
\{e5\} & \{00\} & \{01\} & \{00\} \\
\{00\} & \{e5\} & \{00\} & \{01\} \end{array} \right)
[/tex]

Which is almost a unit matrix, but not quite. And, when I use these polynomials to calculate the function, and then the inverse, I get a different polynomial to my input. I checked my matrix multiplication algorithm, it seems to be working fine.

Two other matrices that should have a unit matrix product (for another step in the algorithm) do. I'm definitely doing finite field arithmetic. I'm using a logarithm table for my multiplication, base three, which I know for a fact is a generator. I can't find anything wrong with the procedure, so I'm asking you guys if you could please tell me why it doesn't work.
 
Physics news on Phys.org
  • #2
Are those hex values or something?
 
  • #3
Yeah, that's how they're normally stated. Should I convert to decimal?
 
  • #4
I have no idea if that would make a difference. I've never thought of using base 16 when doing matrix operations. I'd be interested to find out though.
 
  • #5
I meant for readability, base only makes a difference for the humans reading the numbers.
 
  • #6
I guess.
So {02}{0e} + {03}{09} + {01}{0d} + {01}{0b} = {01} ?

I don't man, all that only for human talk. To me, that don't look right.
 
  • #7
You do realize that I'm talking about a finite field, right? That equality is indeed correct, using finite field operations.
 
  • #8
Well I guess it's all just over my head then. Of course, if that equality is correct then it's clear that there's a problem with something that you are not taking into account as your multiplication is coming out incorrect.
 

1. What is the problem with transformations in Rijndael's finite field?

The problem with transformations in Rijndael's finite field is that they are not always reversible. This means that when data is encrypted using Rijndael's algorithm, it may not be possible to decrypt it back to its original form.

2. How does this problem affect the security of data encrypted with Rijndael's algorithm?

This problem can significantly impact the security of data encrypted with Rijndael's algorithm. If the transformations used are not reversible, it may be possible for an attacker to decrypt the data without the proper decryption key, compromising the confidentiality of the information.

3. What causes the reversibility issue in Rijndael's finite field?

The issue of reversibility in Rijndael's finite field is caused by the specific mathematical operations used in the algorithm. Some transformations, such as multiplication and division, do not have a one-to-one correspondence and therefore cannot be reversed.

4. Can this problem be fixed?

Yes, this problem can be fixed by carefully choosing the transformations used in Rijndael's finite field. By using only reversible operations, the issue of non-reversibility can be avoided, ensuring the security and integrity of the encrypted data.

5. Are there any alternative solutions to this problem?

Yes, there are alternative solutions to this problem. One approach is to use a different finite field, such as the Galois field, which offers more flexibility in terms of reversible operations. Another solution is to incorporate additional layers of encryption, such as using a different algorithm in combination with Rijndael's, to further enhance the security of the data.

Similar threads

  • Linear and Abstract Algebra
Replies
7
Views
915
  • Linear and Abstract Algebra
Replies
4
Views
2K
Replies
6
Views
2K
Replies
27
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
958
  • Advanced Physics Homework Help
Replies
7
Views
901
  • Linear and Abstract Algebra
Replies
7
Views
2K
Replies
4
Views
2K
  • Linear and Abstract Algebra
Replies
12
Views
2K
Replies
3
Views
2K
Back
Top