diff --git a/McEliece.pptx b/McEliece.pptx deleted file mode 100644 index 094e099..0000000 Binary files a/McEliece.pptx and /dev/null differ diff --git a/McEliece.pdf b/app_local/McEliece.pdf similarity index 100% rename from McEliece.pdf rename to app_local/McEliece.pdf diff --git a/break.py b/app_local/break.py similarity index 100% rename from break.py rename to app_local/break.py diff --git a/decode.py b/app_local/decode.py similarity index 100% rename from decode.py rename to app_local/decode.py diff --git a/encode.py b/app_local/encode.py similarity index 100% rename from encode.py rename to app_local/encode.py diff --git a/generate.py b/app_local/generate.py similarity index 100% rename from generate.py rename to app_local/generate.py diff --git a/app_local/readme.txt b/app_local/readme.txt new file mode 100644 index 0000000..6e21f35 --- /dev/null +++ b/app_local/readme.txt @@ -0,0 +1,13 @@ +McEliece cryptosystem implementation + +Usage: +0. pip install numpy and galois +1. generate.py - generate and save public and private keys +2. send pubkey.py and encode.py to your friend +3. your friend runs encode.py, write secret string and send message.py to you +4. decode.py - get secret string + +Hacker can get your private key if he will know a half of it (and pubkey.py, decode.py and Reed-Solomon algo). +Check break.py to understand how hacker can do this. + +Notice: left part of G is E, because we use Reed-Solomon algo; so left part of S @ G is S and cutting right colomns works; my_fix(G) returns E and in break_S we needn't get inv(G), just S = my_fix(G_ @ inv(P)); try break_S with another (not Reed-Solomon) code (matrix G will be different; will my_fix(G) and my_fix(G_) return nonsingular matrices?; of course, rank(G) = rank(G_) = k and we can iterate through all possible combinations of column deletions and find one that does not lead to nonsingular matrices); another way to get S is calculating it row by row (solving k systems, each has n equations with k variables, k < n, but we need to do it in Galois Field). diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 04ea86d..0000000 --- a/readme.txt +++ /dev/null @@ -1,16 +0,0 @@ -McEliece cryptosystem implementation - -Usage: -0. pip install numpy and galois -1. generate.py - generate and save public and private keys -2. send pubkey.py and encode.py to your friend -3. your friend runs encode.py, write secret string and send message.py to you -4. decode.py - get secret string - -Hacker can get your private key if he will know a half of it (and pubkey.py, decode.py and Reed-Solomon algo). -Check break.py to understand how hacker can do this. - -todo: -1. left part of G is E, because we use Reed-Solomon algo; so left part of S @ G is S and cutting right colomns works; my_fix(G) returns E and in break_S we needn't get inv(G), just S = my_fix(G_ @ inv(P)), check it; try break_S with another (not Reed-Solomon) code (matrix G will be different; will my_fix(G) and my_fix(G_) return nonsingular matrices?; of course, rank(G) = rank(G_) = k and we can iterate through all possible combinations of column deletions and find one that does not lead to nonsingular matrices); another way to get S is calculating it row by row (solving k systems, each has n equations with k variables, k < n, but we need to do it in Galois Field) -2. DONE! check randomization during encode (add vector z, check https://en.wikipedia.org/wiki/McEliece_cryptosystem) -3. DONE! make presentation that explains McEliece cryptosystem \ No newline at end of file