作者freeman0220 (wiki)
看板Prob_Solve
标题[请益] 同代像演算法加密
时间Sun Dec 25 23:52:29 2011
这里有一些数学式 是有关於同代像加密法的
我的数学能力和程式能力并不是很强...
所以我不知道该怎麽让他从数学式转成程式码
他不算是作业,只是老师要我们想看看
我还是不清楚要怎麽写...
请版内高手帮我解答一下...
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