[請益] 同代像演算法加密

看板Prob_Solve (計算數學 Problem Solving)作者 (wiki)時間13年前 (2011/12/25 23:52), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
這裡有一些數學式 是有關於同代像加密法的 我的數學能力和程式能力並不是很強... 所以我不知道該怎麼讓他從數學式轉成程式碼 他不算是作業,只是老師要我們想看看 我還是不清楚要怎麼寫... 請版內高手幫我解答一下... Let p = 7, q = 11, then n = 77. For simplicity, let l = 2, that is, each plaintext message is split into 2 smaller pieces. Let ri = si = 5, i = 1, 2. Suppose there are two plaintext numbers in Z77: a = 10 and b = 7. It can easily be seen that 7a+b ≡ 0 (mod 77) and 14a + 2b ≡ 0 (mod 77). The scheme runs as follows. Encrypting a: Decompose a into a1 = 4 and a2 = 6. E(a) = ((4 × 5 mod 7, 4 × 5 mod 11), (6 × 5 mod 7, 6 × 5 mod 11)) = ((6, 9), (2, 8)) Encrypting b: Decompose b into b1 = 3 and b2 = 4. E(b) = ((3 × 5 mod 7, 3 × 5 mod 11), (4 × 5 mod 7, 4 × 5 mod 11)) = ((8, 4), (6, 9)) Computing E(7a + b): E(7a + b) = ((7 × 6 + 8, 7 × 9 + 4), (7 × 2 + 6, 7 × 8 + 9)) mod 77 = ((50, 67), (20, 65)) 用C或javascript 都可以 謝謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 175.180.67.19
文章代碼(AID): #1EzqR0ve (Prob_Solve)
文章代碼(AID): #1EzqR0ve (Prob_Solve)