IMT4531 Introduction to Cryptology Exercise 4 – supplement - Asymmetric ciphers, hash functions and digital signatures 1. Use the data from the task 9, exercise 4, to compute the following: Alice wants to digitally sign the message YES with the RSA system. Bob wants to verify that digital signature. Alice’s public key is (eA,nA)=(39423,46927) and Alice’s secret key is dA=26767 (see the task 9b). In the RSA digital signature scheme, Alice’s signature is obtained by deciphering the message. Since the message is YES and its integer encoding is m=16346 (see the task 9a), Alice has to compute the following π = 1634626767 mod 46927 and then c will be the Alice’s digital signature of the message m=16346. To compute c, we can reuse the pre-computation performed in the task 9a, i.e. π i 2π 163462 mod 46927 0 20 * 163461 mod 46927 = 16346 1 1 2 * 163462 mod 46927 = 36305 2 22 * 163464 mod 46927 = 363052 mod 46927 = 14376 3 3 2 * 163468 mod 46927 = 143762 mod 46927 = 2868 4 24 1634616 mod 46927 = 28682 mod 46927 = 13199 5 5 1634632 mod 46927 = 131992 mod 46927 = 20577 2 6 26 1634664 mod 46927 = 205772 mod 46927 = 37535 7 7 2 * 16346128 mod 46927 = 375352 mod 46927 = 33831 8 28 16346256 mod 46927 = 338312 mod 46927 = 33958 9 9 2 16346512 mod 46927 = 339582 mod 46927 = 8593 10 210 163461024 mod 46927 = 85932 mod 46927 = 23478 11 11 2 * 163462048 mod 46927 = 234782 mod 46927 = 11942 12 212 163464096 mod 46927 = 119422 mod 46927 = 211 13 13 2 * 163468192 mod 46927 = 2112 mod 46927 = 44521 14 214 * 1634616384 mod 46927 = 445212 mod 46927 = 16815 15 15 1634632768 mod 46927 = 168152 mod 46927 = 9050 2 Since the binary representation of the exponent 26767 is 110100010001111 (see the task 9b), i.e. 15 bits are used for it, we do not need the last row from the table above (marked red). The rows that are relevant for the computation of c are marked with * (the corresponding bits in the binary representation of 26767 are equal 1). So we have 1634626767 mod 46927 = 16346 β 36305 β 14376 β 2868 β 33831 β 11942 β 44521 β 16815 = 997 (mod 46927) So, Alice sends to Bob the pair (m,c)=(16346,997). Now Bob wants to verify the signature c, upon receiving (m,c). He needs the Alice’s public key for it, i.e. the pair (eA,nA)=(39423,46927). Then Bob computes π = 99739423 mod 46927 The binary representation of 39423 is 1001100111111111 (see the task 9a). So Bob preπ computes the powers 9972 mod 46927, i=0,…,15 (since binary representation of 39423 is performed with 16 bits). He generates the table i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2π 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 210 211 * 212 * 213 214 15 2 * π 9972 mod 46927 9971 mod 46927 = 997 9972 mod 46927 = 8542 9974 mod 46927 = 85422 mod 46927 = 41206 9978 mod 46927 = 412062 mod 46927 = 21722 99716 mod 46927 = 217222 mod 46927 = 41226 99732 mod 46927 = 412262 mod 46927 = 27917 99764 mod 46927 = 279172 mod 46927 = 42200 997128 mod 46927 = 422002 mod 46927 = 7277 997256 mod 46927 = 72772 mod 46927 = 21073 997512 mod 46927 = 210732 mod 46927 = 1128 9971024 mod 46927 = 11282 mod 46927 = 5355 9972048 mod 46927 = 53552 mod 46927 = 3628 9974096 mod 46927 = 36282 mod 46927 = 22824 9978192 mod 46927 = 228242 mod 46927 = 45276 99716384 mod 46927 = 452762 mod 46927 = 4035 99732768 mod 46927 = 40352 mod 46927 = 44483 Powers of 2 in the table that will be used in the computation are marked with * (they correspond to the non-zero bits in the binary representation of 39423. Thus we get π = 99739423 mod 46927 = 997 β 8542 β 41206 β 21722 β 41226 β 27917 β 42200 β 7277 β 21073 β 3628 β 22824 β 44483 = 16346 Since q=m, Alice’s signature has been verified.