# How to do multiplication in $GF(2^8)$?

I am taking an Internet Security Class and we received some practice problems and answers, but I do not know how to do these problems , an explanation would be greatly appreciated

Try to compute the following value:(the number is in hexadecimal and each represents a polynomial in GF(2^8)

1) {02} * {87}

{02} = {0000 0010} = x
{87} = {1000 0111} = x

-> {02} * {87} = (000 1110) XOR (0001 1011) = 0001 0101 = {15}

• This question is impossible to answer unless you tell us the representation that you are using for $GF(2^8)$. What is your irreducible polynomial? (But your XOR operation is for addition, not multiplication. Also where do "000 1110" and "0001 1011" come from?) Mar 15, 2015 at 0:50
• Oh, I see $-$ you get (correctly) "1 0000 1110" for the multiplication, and reduce it mod "1 0001 1011". So if that is your irreducible polynomial, your answer looks correct. Mar 15, 2015 at 0:52

To carry out the operation, we need to know the irreducible polynomial that is being used in this representation. By reverse-engineering the answer, I can see that the irreducible polynomial must be $x^8+x^4+x^3+x+1$ (Rijndael's finite field). To carry out a product of any two polynomials then, what you want to do is multiply them and then use the relation $x^8+x^4+x^3+x+1\equiv 0$, or in other words $x^8\equiv x^4+x^3+x+1$, to eliminate any terms $x^k$ where $k\geq 8$, reducing modulo 2 as you go along.
The binary {0000 0010} corresponds to the polynomial $x$ (i.e., $0x^7+0x^6+0x^5+0x^4+0x^3+0x^2+1x^1+0x^0$), while the binary {1000 0111} corresponds to $x^7+x^2+x+1$ (i.e., $1x^7+0x^6+0x^5+0x^4+0x^3+1x^2+1x^1+1x^0$). So to do the multiplication, we calculate