Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
McEliece helper code for SM468
Project: Crypto
Path: mceliece_ex.sagews
Views: 290Bob generates public key G1 = S*G*P
[0 0 1 1 0 1 0]
[1 0 1 0 0 1 1]
[1 1 0 0 0 1 0]
[1 0 1 0 1 0 0]
Alice chooses message x
[1 0 1 0]
Alice chooses random error vector e (hamming weight 1)
[0 1 0 0 0 0 0]
Alice computes ciphertext y = x*G1 + e
[1 0 1 1 0 0 0]
Bob decrypts ciphertext y(= xG1 + e) by computing r1(=yP^-1) = received word
[1 1 0 0 0 0 1]
Bob computes syndrome of r1 or S(r1) = r1*H^T
[0 1 0]
Decode by finding corresponding row in H^T
[1 1 0]
[1 0 1]
[0 1 1]
[1 1 1]
[1 0 0]
[0 1 0]
[0 0 1]
It is row 6! Correct the 6th bit in r1 -> c1!
[1 1 0 0 0 1 1]
Extracting the first 4 bits to find x1G = c1
[1 1 0 0]
[1 1 0 0 0 1 1]
Compute the message by taking x1*S^-1
[1 0 1 0]
Here is the original x
[1 0 1 0]
23.2500000000000