密码学第五版部分课后答案.doc
《密码学第五版部分课后答案.doc》由会员分享,可在线阅读,更多相关《密码学第五版部分课后答案.doc(10页珍藏版)》请在装配图网上搜索。
2.4 已知下面的密文由单表代换算法产生: 请将它破译。提示:1、 正如你所知,英文中最常见的字母是e。因此,密文第一个或第二个(或许第三个)出现频率最高的字符应该代表e。此外,e经常成对出现(如meet,fleet,speed,seen,been,agree,等等)。找出代表e的字符,并首先将它译出来。2、 英文中最常见的单词是“the”。利用这个事实猜出什么字母t和h。3、 根据已经得到的结果破译其他部分。解:由题意分析:“8”出现次数最多,对应明文为“e”,“;48”代表的明文为“the”,“)”、“*”、“5”出现频率都比较高,分别对应“s”、“n”、“a”,由此破译出密文对应的明文为: A good glass in the Bishops hostel in the Devils seat-twenty-one degrees and thirteen minutes-northeast and by north-main branch seventh limb east side-shoot from the left eye of the deaths head-a bee line from the tree through the shot fifty feet out.2.20 在多罗的怪诞小说中,有一个故事是这样的:地主彼得遇到了下图所示的消息,他找到了密钥,是一段整数: 7876565434321123434565678788787656543432112343456567878878765654343211234a.破译这段消息。提示:最大的整数是什么?b.如果只知道算法而不知道密钥,这种加密方案的安全性怎么样?c.如果只知道密钥而不知道算法,这种加密方案的安全性又怎么样?解:A. 根据提示,将密文排成每行8字母的矩阵,密钥代表矩阵中每行应取的字母,依次取相应字母即可得明文。明文为:He sitteth between the cherubims.The isles may be glad thereof.As the rivers in the South.B.安全性很好。若密文的字母数为8n,则共有种可能的密钥,不易攻破。C.安全性较差。将字母总数与密钥总数相除,得每组8个字母,即可破译。3.8 这个问题给出了用一轮DES加密的具体数字的例子。假设明文和密钥K有相同的位模式,即: 用十六进制表示:0 1 2 3 4 5 6 7 8 9 A B C D E F 用二进制表示: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111a.推导第一轮的子密钥解:经过表3.4(b)PC-1置换,得:C0:1111000011001100101010100000D0:1010101011001100111100000000经过表3.4(d)左移,得:C1:1010000110011001010101000001D1:0101010110011001111000000001经过表3.4(c)置换选择,得:K1:0000 1011 0000 0010 0110 0111 1001 1011 0100 1001 1010 0101用十进制表示为:0 B 0 2 6 7 9 B 4 9 A 5b.推导L0,R0解:经过表3.2(a)置换,得L0 :1100 1100 0000 0000 1100 1100 1111 1111R0 :1111 0000 1010 1010 1111 0000 1010 1010c.扩展R0求E(R0)解:根据表3.2(C)扩充置换,得:E(R0) = 01110 100001 010101 010101 011110 100001 010101 010101d.计算A=E(R0)K1解:根据a、c可得A = 011100 010001 011100 110010 111000 010101 110011 110000e.把(d)的48位结果分成6位(数据)的集合并求对应S盒代换的值解:根据表3.3S盒代换得(1110) = (14) =0 (10进制)=0000 (2进制)(1000) = (8) =12 (10进制)=1100 (2进制)(1110) = (14) =2 (10进制)=0010(2进制)(1001) = (9) = 1(10进制)=0001(2进制)(1100) = (12) =6 (10进制)=0110 (2进制)(1010) = (10) =13 (10进制)=1101(2进制)(1001) = (9) =5 (10进制)=0101 (2进制)(1000) = (8) =0 (10进制)=0000 (2进制)f.利用(e)的结论来求32位的结果B解:B = 0000 1100 0010 0001 0110 1101 0101 0000g.利用置换求P(B)解:根据表3.2(d),得P(B) = 1001 0010 0001 1100 0010 0000 1001 1100h.计算R1=P(B)L0解:R1 = 0101 1110 0001 1100 1110 1100 0110 0011i.写出密文解:L1=R0,连接L1、R1可得密文为:MEYE823.12 16个密钥(K1、K2K16)在DSE解密过程中是逆序使用的。因此,图3.5的右半部分不再正确。请模仿表3.4(d)为解密过程设计一个合适的密钥移位扩展方案。解:选代轮数12345678910111213141516移位次数01222222122222213.10 (a) 解:T16(L15 | R15) = L16 | R16T17(L16 | R16) = R16 | L16IP IP1 (R16 | L16) = R16 | L16TD1(R16 | L16) = L16 | R16 f(L16, K16)=R15 | L15 f(R15, K16) f(R15, K16)= R15 |L15 (b)解:T16(L15 | R15) = L16 | R16IP IP1 (L16 | R16) = L16 | R16TD1(R16 | L16) = R16 | L16 f(R16, K16)= L15 f(R15, K16)| R15 f(R16, K16)L15 | R153.15For 1 i 128, take ci 0, 1128 to be the string containing a 1 in position i and then zeros elsewhere. Obtain the decryption of these 128 ciphertexts. Let m1, m2, . . . , m128 be the corresponding plaintexts. Now, given any ciphertext c which does not consist of all zeros, there is a unique nonempty subset of the cis which we can XOR together to obtain c. Let I(c) 1, 2, . . . , 128 denote this subset. ObserveThus, we obtain the plaintext of c by computing . Let 0 be the all-zero string. Note that 0 = 0 0. From this we obtain E(0) = E(0 0) = E(0) E(0) = 0. Thus, the plaintext of c = 0 is m = 0. Hence we can decrypt every c 0, 1128. 4.15a.gcd(24140, 16762) = gcd(16762, 7378) = gcd(7378, 2006) = gcd(2006, 1360) = gcd(1360, 646) = gcd (646, 68) = gcd(68, 34) = gcd(34, 0) = 34b.gcd(4655, 12075) = gcd(12075, 4655) = gcd(4655, 2765) = gcd(2765, 1890) = gcd(1890, 875) = gcd (875, 140) = gcd(140, 35) = gcd(35, 0) =354.17 a. Euclid: gcd(2152, 764) = gcd(764, 624) = gcd(624, 140) = gcd(140, 64) = gcd(64, 12) = gcd(12, 4) = gcd(4, 0) = 4Stein: A1 = 2152, B1 = 764, C1 = 1; A2 = 1076, B2 = 382, C2 = 2; A3 = 538, B3 = 191, C3 = 4; A4 = 269, B4 = 191, C4 = 4; A5 = 78, B5 = 191, C5 = 4; A6 = 39, B6= 191,C6 = 4; A7 = 152, B7 = 39, C7 = 4; A8 = 76, B8 = 39, C8 = 4; A9 = 38, B9 = 39, C9 = 4; A10 = 19, B10 = 39, C10 = 4; A11 = 20, B11 = 19, C11 = 4; A12 = 10, B12 = 19, C12 = 4; A13 = 5, B13 = 19, C13 = 4; A14 = 14, B14 = 5, C14 = 4; A15 = 7, B15 = 5, C15 = 4; A16 = 2, B16 = 5, C16 = 4;A17 = 1, B17 = 5, C17 = 4; A18 = 4, B18 = 1, C18 = 4; A19 = 2, B19 = 1, C19 = 4; A20 = 1, B20 = 1, C20 = 4; 故gcd(2152, 764) = 1 4 = 4 b. 在每一步算法中,Euclid算法所进行的除法运算比较复杂,而Stein算法只需完成除以2、相等、求差或取最小值的简单运算,减小了运算复杂度。4.23a.9x2 + 7x + 7b.5x3 + 7x2 + 2x + 64.25a.1b.1c.x + 1 d.x + 787.2 因为Xn+1 = (aXn ) mod 24,易知若a为偶数,则经过n轮之后Xn+1必恒等于0,故a必为奇数。且a16,分别取a=3,5,7,9,11,13,15,得: a=3,则Xn=1,3,9,11,1,3, 或Xn=5,15,13,7,5,15, a=5,则Xn=1,5,9,13,1,5, 或Xn=3,15,11,7,3,15, a=7,则Xn=1,7,1 舍去 a=9,则Xn=1,9,1 舍去 a=11,则Xn=1,11,9,3,1,11, 或Xn=5,7,13,15,5,7, a=13,则Xn=1,13,9,5,1,13, 或Xn=3,7,11,15,3,7, 故:(a) 最大周期为4(b) a=3或5或11或13(c) 与a必为奇数同理,种子必须为奇数。7.4 两个发生器产生的伪随机数分别为: 1, 6, 10, 8, 9, 2, 12, 7, 3, 5, 4, 11, 1, . . .1, 7, 10, 5, 9, 11, 12, 6, 3, 8, 4, 2, 1, . . . 从中可以看出,第二个发生器产生的伪随机数存在一部分Xn+1 = 2Xn的现象,所以第一个伪随机数发生器的随机性更好一些。8.5a = 9794 mod 73=12而0a72, 73为素数,故取a=128.8因为(35)=24,x(35)=1mod35所以x85mod35=(x24mod35)3)*(x12mod35)*(xmod35)mod35=(x12mod35)*(xmod35)mod35又因为x24mod35=1所以x12mod35=1或-1所以x85mod35=xmod35或-xmod35=6故x=6或x=29,代入验证得x=69.3 因为 n=35 所以f(35) =24 因为 ed=1 mod f(35) ; e=5 所以 d=5 所以 M= Cd mod n=59.5 不安全 因为在已知n的情况下易知f(n),根据密钥产生原则:(1)选择e使其与f(n)互素且小于f(n) (2)确定d使得de=1(mod f(n)且d f(n) 可以得出e、d的可能值,再通过进一步观察即可求出e和d,特别是在n很小的情况下,只需通过简单的计算就可以破解密钥。8.21离散对数表如下图所示:a1234567891011121314Log2,29(a)248163112241991871428a1516171819202122232425262728Log2,29(a)27252113262317510201122156B. 因为17x2 =10(mod29)所以dlog2,29(17)+2dlog2,29(x)(mod28)=2321+2log2,29(x)(mod28)=23所以21+2log2,29(x)=23或 21+2log2,29(x)=51所以x=2或x=27C. 因为x2-4x-16=(0mod29)所以(x-2)2=(20mod29)易知x!=1所以2dlog2,29(x-2)(mod28)=24所以dlog2,29(x-2)=12或 dlog2,29(x-2)=26所以x=9或x=21D. 因为x7=17(mod29)所以7log2,29(x)=21所以7log2,29(x)=21或49或77或105或133或161或189所以x=8或10或12或15或18或26或279.14This algorithm is discussed in the CESG report mentioned in Chapter 6 ELLI99, and is known as Cocks algorithm.a.Cocks makes use of the Chinese remainder theorem (see Section 8.4 and Problem 8.10), which says it is possible to reconstruct integers in a certain range from their residues modulo a set of pairwise relatively prime moduli. In particular for relatively prime P and Q, any integer M in the range 0 M N can be the pair of numbers M mod P and M mod Q, and that it is possible to recover M given M mod P and M mod Q. The security lies in the difficulty of finding the prime factors of N.b.In RSA, a user forms a pair of integers, d and e, such thatde 1 mod (P 1)(Q 1), and then publishes e and N as the public key. Cocks is a special case in which e = N.c.The RSA algorithm has the merit that it is symmetrical; the same process is used both for encryption and decryption, which simplifies the software needed. Also, e can be chosen arbitrarily so that a particularly simple version can be used for encryption with the public key. In this way, the complex process would be needed only for the recipient.d.The private key k is the pair P and Q; the public key x is N; the plaintext p is M; and the ciphertext z is C. M1 is formed by multiplying the two parts of k, P and Q, together. M2 consists of raising M to the power N (mod N). M3 is the process described in the problem statement.10.6a.(49, 57)b.C2 = 2911.1a.Yes. The XOR function is simply a vertical parity check. If there is an odd number of errors, then there must be at least one column that contains an odd number of errors, and the parity bit for that column will detect the error. Note that the RXOR function also catches all errors caused by an odd number of error bits. Each RXOR bit is a function of a unique spiral of bits in the block of data. If there is an odd number of errors, then there must be at least one spiral that contains an odd number of errors, and the parity bit for that spiral will detect the error. b.No. The checksum will fail to detect an even number of errors when both the XOR and RXOR functions fail. In order for both to fail, the pattern of error bits must be at intersection points between parity spirals and parity columns such that there is an even number of error bits in each parity column and an even number of error bits in each spiral.c.It is too simple to be used as a secure hash function; finding multiple messages with the same hash function would be too easy.11.2a.For clarity, we use overbars for complementation. We have:Therefore, the hash function of message M with initial value I is the same as the hash function for message N with initial value for any given I, whereb.The same line of reasoning applies with the Ms and Hs reversed in the derivation.11.11a.1.Interchange x1 and x4; x2 and x3; y1 and y4; and y2 and y3.2.Compute Z = X + Y mod 232.3.Interchange z1 and z4; and z2 and z3.b.You must use the same sort of interchange.- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 密码学 第五 部分 课后 答案
装配图网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文