0

I work on a project about cryptosystem using Reed Solomon codes and it is using implementation of Galois package on Python. As I know, Reed Solomon codes based and work on polynomial representation but using the galois package, it can build the generator matrix on integer representation and it complete the standard form of generator matrix because it complete G=[I|A] which is I is a identity matrix. I wanna ask how the number on row and column matrix became a integer value instead of polynomial Reed Solomon? Thank you

I want to know the basic of integer representation on generator matrix Reed Solomon codes. How is the theory about it? why it doesn’t on polynomial?

heidii
  • 1
  • 2

1 Answers1

1

There are two types of Reed Solomon code, which Wikipedia refers to as "original view" and "BCH view", and within each view, there are two encoding methods, "simple" encoding and "systematic" encoding.

https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction

G = [I|A] corresponds to original view, systematic encoding, however G=[I|B] would look similar, but would correspond to BCH view, systematic encoding.

Looking at the example from:

https://galois.readthedocs.io/en/v0.3.5/api/galois.ReedSolomon

It is using BCH view, systematic encoding. Parameters and example encode that matches the linked example (shown in hex). Generator polynomial is g(x). Note for GF(2^n), both + and - are XOR.

GF(2^4):         x^4 + x + 1
g(x):            (x-2)(x-4)(x-8)(x-3)(x-6)(x-c) =
                 x^6 + 7 x^5 + 9 x^4 + 3 x^3 + c x^2 + a x + c
msg:             e 0 1 9 9 f 1 c 7 = 
                 e x^8 + 0 x^7 + 1 x^6 + 9 x^5 + 9 x^4 + f x^3 + 1 x^2 + c x + 7
encoded msg:     e 0 1 9 9 f 1 c 7 7 a 6 7 7 b

In this case, the parity values = (msg * x^6) mod g(x), and are appended to the message. Since this is a linear mapping, the encode operation

(msg * x^6) + ((msg * x^6) % g(x))

can be converted into a matrix multiply by G, where G = [I|B]. In hex:

    |1 0 0 0 0 0 0 0 0 a 3 5 d 1 8|
    |0 1 0 0 0 0 0 0 0 f 1 d 7 5 d|
    |0 0 1 0 0 0 0 0 0 b b d 3 a 7|
    |0 0 0 1 0 0 0 0 0 3 2 3 8 4 7|
G = |0 0 0 0 1 0 0 0 0 3 a a 6 f 9|
    |0 0 0 0 0 1 0 0 0 5 b 1 5 f b|
    |0 0 0 0 0 0 1 0 0 2 b a 7 e 8|
    |0 0 0 0 0 0 0 1 0 f 9 5 8 f 2|
    |0 0 0 0 0 0 0 0 1 7 9 3 c a c|  (last row is the same as g(x))

This matches G as shown here:

https://galois.readthedocs.io/en/v0.3.5/api/galois.ReedSolomon.G

rcgldr
  • 27,407
  • 3
  • 36
  • 61
  • yes, I want to encrypt a message but in a vector not in polynomial. but how I get the number on row and column of the generator matrix of it? can you check this https://galois.readthedocs.io/en/v0.3.5/api/galois.ReedSolomon.G/ . that is a package made by Matt Hostetter, and i would like to use the generator matrix of it, but idk how the number on those matrix from column 10-15 (row 1-9) was found, I mean the theory behind it. I just know about the systematic identity matrix. Can you help me? Thank you for it – heidii Jul 29 '23 at 10:45
  • I already read your reference, but still confused with it. can you give me some example and explanation how the number be in integer like that? Thank you for your help – heidii Jul 29 '23 at 10:49
  • @heidii - I updated my answer to match the link you provided in your comment (you should probably add that to your question). Note that the intent of Matt Hosetter's library and my experience with Reed Solomon is for error correction, not encryption. In the case of "BCH view", the number of variables used for encoding is limited by the fact that the generator polynomial is based on sequential powers of some primitive element. – rcgldr Jul 29 '23 at 17:18
  • @heidii - continuing, For "original view", the key variables are the values and ordering of the set of data points known only to encoder and decoder. For this example, it would be 16 * 15! ~= 10^13.3 possible permutations of 16 things taken 15 at a time. In addition, a few random errors could be added to the encrypted message. It would seem that "original view" with "simple" encoding and random errors would make more sense for a RS based encryption scheme. If this is the case, you'll need a different encryption oriented package than Matt Hosetter's version. – rcgldr Jul 29 '23 at 17:29
  • It really help. Thank you!! – heidii Jul 29 '23 at 22:25
  • how did you construct the generator polynomial? I mean how it can turn from (x-2)(x-4)(x-8)(x-3)(x-6)(x-c) into x^6 + 7 x^5 + 9 x^4 + 3 x^3 + c x^2 + a x + c. I still don’t understand how to find it and correlation beside them with x^4+x+1 – heidii Jul 30 '23 at 01:52
  • sorry, I still don’t get it. how did you get the number 4*8? – heidii Jul 31 '23 at 04:29
  • isnt it 0? do we need to transform it into hex? can’t we just do 32 mod 16? why is it hex 13? – heidii Jul 31 '23 at 12:42
  • @heidii - because the math is all GF(2^4), where add and subtract are XOR, including for multiply (carryless) and divide (borrowless). Using hex is shorthand for polynomials. Hex 13 is x^4 + x + 1 and 4*8%13 is really (x^2 * x^3)%(x^4 + x + 1) = (x^5 )%(x^4 + x + 1)= x^2 + x = 6, where all coefficients are single bits. I deleted some of my prior comments since they are no longer needed. – rcgldr Jul 31 '23 at 21:44