Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Describe how to generate the pair of public key and private key in RSA algori

ID: 3874972 • Letter: 1

Question

1. Describe how to generate the pair of public key and private key in RSA algorithm?

2. Find the multiplicative inverse of 45 mod 238.

3. Let p = 7, q = 11, e = 13, and M = 5 (M: message). Show details of the following. a. What is the private key d ? b. Perform RSA encryption and decryption on the message M.

4. Suppose (e, n) is the receivers public key and M is the message needed to be encrypted by the sender. Why do we have this constraint M < n? (If we remove this constraint, what happens?)

Explanation / Answer

*) Public key generation:-

                         n=p*q.

    Consider an ex:- Lets choose two primes:p=11 andq=13. Hence the modulus is

                                   n=p*q =143, and (p-1)(q-1)=120 ,so choose e=7 greater than 1.

                                      Public key(143,7).

*) Private key generation:-

                         n=p*q.

    Consider an ex:- Lets choose two primes:p=11 andq=13. Hence the modulus is

                                   n=p*q =143, and (p-1)(q-1)=120 ,so choose e=7 greater than 1.

                                      d=inverse mod of 7 with 120=103.

                                       private key(143,103)

--------------------------------------------------------------------------------------------------------------------------------------

2) Find the multiplicative inverse of 45 mod 238

ans) Inverse of 45 mod 238=201

          

Val (val * n) mod m

1     45

2     90

3     135

4     180

5     225

6     32

7     77

8     122

9     167

10 212

11 19

12 64

13 109

14 154

15 199

16 6

17 51

18 96

19 141

20 186

21 231

22 38

23 83

24 128

25 173

26 218

27 25

28 70

29 115

30 160

31 205

32 12

33 57

34 102

35 147

36 192

37 237

38 44

39 89

40 134

41 179

42 224

43 31

44 76

45 121

46 166

47 211

48 18

49 63

50 108

51 153

52 198

53 5

54 50

55 95

56 140

57 185

58 230

59 37

60 82

61 127

62 172

63 217

64 24

65 69

66 114

67 159

68 204

69 11

70 56

71 101

72 146

73 191

74 236

75 43

76 88

77 133

78 178

79 223

80 30

81 75

82 120

83 165

84 210

85 17

86 62

87 107

88 152

89 197

90 4

91 49

92 94

93 139

94 184

95 229

96 36

97 81

98 126

99 171

100                216

101                23

102                68

103                113

104                158

105                203

106                10

107                55

108                100

109                145

110                190

111                235

112                42

113                87

114                132

115                177

116                222

117                29

118                74

119                119

120                164

121                209

122                16

123                61

124                106

125                151

126                196

127                3

128                48

129                93

130                138

131                183

132                228

133                35

134                80

135                125

136                170

137                215

138                22

139                67

140                112

141                157

142                202

143                9

144                54

145                99

146                144

147                189

148                234

149                41

150                86

151                131

152                176

153                221

154                28

155                73

156                118

157                163

158                208

159                15

160                60

161                105

162                150

163                195

164                2

165                47

166                92

167                137

168                182

169                227

170                34

171                79

172                124

173                169

174                214

175                21

176                66

177                111

178                156

179                201

180                8

181                53

182                98

183                143

184                188

185                233

186                40

187                85

188                130

189                175

190                220

191                27

192                72

193                117

194                162

195                207

196                14

197                59

198                104

199                149

Found it at 201

-----------------------------------------------------------------------------------------------------------------------

3)Let p = 7, q = 11, e = 13, and M = 5 (M: message). Show details of the following. a. What is the private key d ? b. Perform RSA encryption and decryption on the message M.

    a.) What is the private key d ?

Given p=7,q=11,e=13

           n=p*q=11*7=77

           ed=1 mod(p-1)(q-1)

            d=Inverse 13 mod 60=37

           Privatekey(77,37)

b. Perform RSA encryption and decryption on the message M.

      Given p=7,q=11,e=13 and m=5

      n=p*q=11*7=77

           ed=1 mod(p-1)(q-1)

            d=Inverse 13 mod 60=37

        Encryption, c=me mod n= 513 mod 77=26

       Decryption, c=ce mod n= 2613 mod 77=5

------------------------------------------------------------------------------------------------------------------------------------

4) Suppose (e, n) is the receivers public key and M is the message needed to be encrypted by the sender. Why do we have this constraint M < n? (If we remove this constraint, what happens?)

ana) Decrypt using public key = me mod n