Ask Your Question

Redbook1's profile - activity

2023-10-19 03:56:50 +0200 received badge  Famous Question (source)
2022-01-19 10:31:51 +0200 received badge  Famous Question (source)
2021-05-07 19:19:28 +0200 received badge  Famous Question (source)
2021-05-07 19:19:28 +0200 received badge  Notable Question (source)
2019-12-24 15:52:42 +0200 received badge  Popular Question (source)
2019-12-24 15:52:42 +0200 received badge  Notable Question (source)
2019-07-10 10:42:37 +0200 received badge  Notable Question (source)
2019-05-26 01:06:38 +0200 received badge  Popular Question (source)
2019-05-07 13:13:25 +0200 received badge  Popular Question (source)
2018-02-19 08:44:18 +0200 commented question How do you calculate the branch number of a matrix?

I see. Well, the MDS matrix shown multiplies column vectors of four elements, all of which are bytes (as are the entries in the matrix) in the field $GF(2^8)$ and using an irreducible polynomial $p(x) = X^8 + X^4 + X^3 + X + 1$. An example column vector might be $(a3\ 25\ c4\ 06)^T$. Therefore multiplying by the first entry in the MDS matrix, $(02)$, gives: $02 \times a3 = X (X^7 + X^5 + X^2 + X) = X^6 + X^4 + X^3 + X^2 + 1 $ or $5d$ (after reduction by p(x)).

2018-02-17 19:05:26 +0200 commented question How do you calculate the branch number of a matrix?

I have since found the branch number of a matrix is: $B(A) = min[weight(a) + weight(aA)], but I cannot find an example of this. I believe the weight of a matrix is the number of its non-zero components. Even so, I am not sure how to calculate it without a clear example.

2018-02-16 14:06:40 +0200 asked a question How do you calculate the branch number of a matrix?

Can anyone explain what a branch number is and how to calculate it? I have checked several books on matrices but it seems uncommon. In particular, the matrix:

$$02\quad 03\quad 01\quad 01$$ $$01\quad 02\quad 03\quad 01$$ $$01\quad 01\quad 02\quad 03$$ $$03\quad 01\quad 01\quad 02$$

These entries are hexadecimals (or bytes), e.g. in bits ${02}$ is $00000010$, and comes from the Mix column layer in the $AES$ cipher (just in case that makes a difference).

I have read this matrix has the maximum branch number of $n+1 = 5$, but I do not understand where this came from or what it means.

I also read this is an $MDS$ matrix and I think branch numbers and $MDS$ matrices are linked somehow but, again, I don't know how. I have looked for video tutorials on $MDS$ matrices and branch numbers but there is nothing for beginners.

A couple of simple examples for branch numbers and/or $MDS$ matrices would be really helpful.

2018-02-16 05:38:19 +0200 commented answer How to find all the sub-square matrices of an 4x4 matrix and all their determinants

Thank you!

2018-02-16 05:37:57 +0200 commented answer How to find all the sub-square matrices of an 4x4 matrix and all their determinants

Perfect! Many thanks.

2018-02-16 05:36:37 +0200 received badge  Supporter (source)
2018-02-16 00:22:26 +0200 received badge  Student (source)
2018-02-15 20:24:16 +0200 asked a question How to find all the sub-square matrices of an 4x4 matrix and all their determinants
  1. I need to find all the sub-square matrices of a $4 \times 4$ matrix.
  2. Then find the determinant of all $70$ of them.

I was directed to Sage but I know little about it. A simple program would be much appreciated.

For example, the matrix below:

$$2\quad 3\quad 1\quad 1$$ $$1\quad 2\quad 3\quad 1$$ $$1\quad 1\quad 2\quad 3$$ $$3\quad 1\quad 1\quad 2$$

Thanks to anyone who can help.

2017-12-11 02:40:12 +0200 received badge  Scholar (source)
2017-12-09 12:46:36 +0200 commented question How can we make the AES S-box using Lagrange interpolation?

@slelievre Nice tip. But how do I untick my question from the community wiki?

2017-12-09 09:55:08 +0200 commented question How can we make the AES S-box using Lagrange interpolation?

@dan_fulea

  • AES S-box is the substitution box in the encryption cipher AES. I don't think it is necessary to know exactly what it is to understand the question.
  • $m$, $v$ and $y$ (and $s$) are all given. The S-box takes an input of 8 bits (written in hexadecimal) and produces an output. For example $S-[2A] = E5$ These outputs come from Lagrange interpolations (somehow) but I don't know how to do it .. even on paper. But I heard it can be done in Sage.
  • I am not sure which Lagrange interpolation.
2017-12-08 13:21:27 +0200 asked a question How can we make the AES S-box using Lagrange interpolation?

I found the Sage code for the AES S-box online. It is given below.

However, I do not know how to find the coefficients of a to h using Lagrange interpolation. They seem to appear from nowhere, but I am told they are the result of Lagrange interpolation. I only know how to apply Lagrange interpolation if I have a function and some given points. But it seems there are no given points.

Can anyone help? An example of how to use Lagrange interpolation in Sage for just one or two of these polynomials, say $a =x^2+1$, and $b = x^3+1$ would be very helpful.

R = PolynomialRing(GF(2),'x',1)
x = R.gen()

m = x^8 + x^4 + x^3 + x + 1
v = x^6 + x^5 + x + 1
y = x^7 + x^4 + x^2 + 1

a = x^2 + 1
b = x^3 + 1
c = x^7 + x^6 + x^5 + x^4 + x^3 + 1
d = x^5 + x^2 + 1
e = x^7 + x^6 + x^5 + x^4 + x^2
f = 1
g = x^7 + x^5 + x^4 + x^2 + 1
h = x^7 + x^3 + x^2 + x + 1

s = a*(y^254) + b*(y^253) + c*(y^251) + d*(y^247) + e*(y^239) + f*(y^223) + g*(y^191) + h*(y^127) + v

print (s % m)