Anda di halaman 1dari 45

Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Abstract
The basic point of cryptography is to allow two people sending a message over an insecure post (for
example a computer network) so the hackers or the intruders won’t understand the message.

It is the purpose of the Kryptos algorithm to make secure transmission of sending messages. The
kryptos algorithm is combined American Standard Code for Information Interchange (abbreviated
ASCII ) and Rivest-Shamir-Adleman (abbreviated RSA) algorithm.

In encryption the ASCII code is converted to the 7- bit binary sequences, with the addition of the
given the 7- bit binary key. The RSA algorithm applied to encrypt the result of the first algorithm.

In decryption of kryptos algorithm we use the block of 3 digit decimal numbers and apply RSA
algorithm. The result of this RSA decryption convert to the ASCII’s 7- bit binary. The representation
will be added to the given 7- bit binary key to get the original plain text message.
We use three examples to demonstrate, how kryptos algorithm work.

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:1 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Contents Page No.

Abstract 1
Chapter 1 Introduction 3
Chapter 2 Encryption Algorithm 4
step 1 4
step 2 4
step 3 4
step 4 4
Key Generation 4
Step 5 5
Step 6 5
Step 7 5

Chapter 3 Decryption Algorithm 6


Step 1 6
Step 2 6
RSA Algorithm 6
Step 3 7
Step 4 8
Step 5 8
Chapter 4 Algorithm’s Diagrams 9
Encryption Diagram 9
Decryption Diagram 10
Chapter 5 Examples 11
Example 1 11
Example 2 19
Example 3 28
Chapter 6 Conclusion 39
Appendix 1 40
Appendix 2 41
Reference 42
Group Meeting Minutes 43

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:2 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Chapter 1
Introduction
The science of secret writing message is known as cryptography. Secret writing for the transmission
of messages has been practiced for more than 4000 years.
The struggles between those who develop system of secret writing, the cryptographers and those
who try to break those systems, the cryptanalysts have made use of mathematical systems. In
addition, the most advanced computer technology available has been enlisted in the production of
more complex methods of writing and breaking systems of secret writing.
Cryptography is a broad subject and it needs knowledge of several areas of mathematics, including
number theory, groups, rings and fields, linear algebra, probability and information theory.

The basic point of cryptography is to allow two people sending a message over an insecure
channele (for example a computer network) so the hackers or the intruders won’ts understand the
message.
The purpose of the Kryptos algorithm to make secure transmission of sending messages. The
kryptos algorithm is combined ASCII code and RSA algorithm.

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:3 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Chapter 2
Encryption of Kryptos Algorithm
In order to transform plaintext into secrete message, we have decided to use following steps, for
encrypted.
Step1; Represent each letters to its Decimal ASCII code, for example;
A = 65, B = 66.....Z = 90
Step2: Convert the ASCII code to 7-bit binary sequences. for instance;
A = 1000001, B = 1000010 ....................., Z = 1011010
Step3: Adding the key 0010100 to the 7-bit binary sequences and then convert the result of addition
to ASCII code. for example;
A = 1000001+0010100 = 1010101 = 85 = U
O = 1001111+0010100 = 1011011 = 91 = [
N = 1001110+0010100 = 1011010 = 90 = Z

Reason why we add 0010100: for prior algorithm we tried to swap 3rd and 5th position bit, as it
was inspired from, tutorial exercise, however, when we actually implemented the algorithms, we
found that nearly half of the characters did not effected by the 0010100. There were around 11
characters which would not change, it would stay the say. They are ADD (11 characters which
did not change its ASCII VALUE)
Step4: Applying RSA algorithm to each number as following,
Encryption
Plaintext: M<n
Ciphertext: C = Me mod n
Key Generation
Select two prime numbers, p, and q
Let n = p.q
Calculate ф (n) = (p – 1)(q –1)
Select integer e gcd (ф (n), e) = 1
Given p=17, q=11 then n=17.11=187 and e=7
For example ; ( using above example) M1= 85, M2 = 91, M3 = 90

M7 = (((M2 )* M4 * )= M6) = M2 * M4 = M6

=(M6*M1 ) = M 6+1 * Using Indices rules *

Ci = Mie mod n

Step: 5 Calculation
Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:4 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Ci = Mie mod n
C1= 857 mod 187
M1 85 = U
852 = 7225 = 119 mod 187
854 = 119*119 = 136 mod 187
856 = 119*136 = 102 mod 187
857 = 102*85 = 68 mod 187
68
M2 91 = [
912 = 8281 = 53 mod 187
914 = 53*53 = 4 mod 187
916 = 53*4 = 25 mod 187
917 = 25*91 = 31 mod 187
31

M3 90 = Z
902 = 8100 = 59 mod 187
904 = 59 * 59 = 115 mod 187
906 = 115 *59 = 53 mod 187
907 = 53*90 = 95 mod 187
95
Step 6: Now Transfer each number into block of 3 digits;
If no = 1 digit ;
then add 00 in front of the no.
else if
no = 2 digits
then add 0 (one zero) in front of 2 digits.
end;
end;

In these case it will be C1 = 068, C2 = 031 and C3 = 095


Step7: Write them as a sentence without space
for example (Using above example); 068031095
These is the encrypted message; that very difficult to break, Because we have numbers instead of
letters, if we had letter one can get the letter frequency and can apply brute force to crack the real
message.

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:5 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Chapter 3
Decryption of Kryptos algorithm
Step 1: The cryptograms received are decimal numbers less than n; n in our case is 187, i.e. in a
series of numbers, for example; 068031095 is the encrypted message, do decrypt it, need to divide
the whole bits by 3, in these case 9. hence its 9/3 = 3
which will be 3 block of 3-digits; blocks of three digit decimal numbers.
068031095 = 068, 031, 095 hence they are C1, C2, C3 .......Cn-1
Step2:
C1 =068, C2 =031, C3 =095
The decryption could be done in the following steps:
Each block of the cryptogram received will be expressed to the power of the secret key (in our case
23) and reduced to mod 187.
Example: let M = message sent, C = cryptogram received
If the received block of cryptogram is 168 then,
M = Cd mod n, where d=23(secret key), n=187(p*q)
RSA algorithms

KEY GENARATION STEPS


q = 11 , p = 17
n = p*q
n = 17*11 = 187

Φ(n) = (q-1)*(p-1)
(11-1)(17-1) = 10*16 = 160

e = 7 is co-prime to Φ(n) = 160


e=7

gcd (7,160)=1
160 = 7*22+6
7* = 6*1 +1

inverse of 7 is

1 = 7-6*1
1= 7 - (160-7*22)
1*7-160+7*22
1= -160+23*7
-1*160 + 23*7

d = 23,

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:6 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08
Secrete Key p=17, q=11 and d = 23
Public Key n = 187 and e = 7

Step 3 calculation

Using Step 2
C1 = 06823 = 682 (mod 187)
682 = 68*68 = 136 mod 187
684 =136*136= 170 mod 187
688 = 170*170 = 102 mod 187
6816 = 102*102 = 119 mod 187
6822 = 119*170*136 = 136 mod 187
6823 = 136*68 = 85 mod 187

C2 = 03123 = 31 23 (mod 187)

312 = 31*31 = 961 = 26 mod 187


314 = 26*26= 115 mod 187
318 = 115*115 = 135 mod 187
3116 = 135*135 = 86 mod 187
3122 = 86*115*26 = 15 mod 187
3123 = 15*31 = 91 mod 187

C3 = 09523 = 95 23 (mod 187)

952 = 95*95 = 9025 = 49 mod 187


954 = 49*49 = 157 mod 187
958 = 157*157 = 152 mod 187
9516 = 152*152 = 103 mod 187
9522 = 103*157*49 = 60 mod 187
9523 = 60*95 = 90 mod 187

Step3:
The result of this RSA decryption will be converted in to the ASCII’s seven digit binary
representation.
using above example; C1 = 85 becomes; 1010101 =
C2 = 91 = 1011011
C3 = 90 = 1011010

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:7 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08
Step4: Now we add 0010100 to each 7-bits as following;
C1 = 85 becomes; 0010100 + 1010101 = 1000001 = 65 = A

C2 = 91
0010100 + 1011011 = 1001111 = 79 = O

C3 = 90
0010100 + 1011010 = 1001110 = 78 = N
We have A O and N

Step5: The last step is to convert ASCII numbers into ASCII decimal representation, then to
characters; for example (using above example);

65 = A
79 = O
78 = N

Plaintext (Real message or decrypted)

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:8 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Chapter 4
Encryption Diagram:

B= I00000I0 bit
Text I00000I, to ASCII 7
Plain 0010100
Convert
e.g. A=
Add
into
representation
ASCII 7-bit

characters
D = 23 , ASCII
e =7, Numbers Convert in to Represent
blocks of 3
i
C = m e (mod n) Numbers
N = 187
11 digits
P = 17, Q =
Algorithm
Apply RSA

If no = 1 digit ;
then add 00 in front of
the no.
else if
no = 2 digits
then add 0 (one zero) in front of
2 digits.
end;
end;

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:9 out of 45
page no:10 out of 45 Group Members: Alice, Eliyas, Sara, Sulma, Yogesh
Add 0010100
Convert it in to ASCII
to ASCII 7-bit
bits Decryption
representation,
Numbers
Numbers Represe
2-bit number Take nt
representing M= Ci d (mod each Decimal
ASCII bit, character
character n)
s
Decryption Diagram:
Date:01/05/08 Group: KRYPTOS Cryptography & Numbers Theory
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Chapter : 5

Example 1:

INFORMATION

I = 1001001 = 73 Dec
N = 1001110 = 78 Dec
F = 1000110 = 70 Dec
O = 1001111 = 79 Dec
R = 1010010 = 82 Dec
M = 1001101 = 77Dec
A = 1000001 = 65 Dec
T = 1010100 = 84 Dec
I = 1001001 = 73 Dec
O = 1001111 = 79 Dec
N = 1001110 = 78 Dec

Now we Add 0010100 Key each Above Plaintext Letters; then convert into ASCII characters,
Reason why we add 0010100: for prior algorithm we tried to swap 3rd and 5th position bit, as it
was inspired from, tutorial exercise, however, when we actually implemented the algorithms, we
found that nearly half of the characters did not effected by the 0010100. There were around 11
characters which would not change, it would stay the say. They are ADD (11 characters which
did not change its ASCII VALUE)

I = 1001001 + 0010100 = 1010111 = 93 = ]


N = 1001110 + 0010100 = 1011010 = 90 = Z
F = 1000110 + 0010100 = 1010010 = 82 = R
O = 1001111 + 0010100 = 1011011 = 91 = [
R = 1010010 + 0010100 = 1000110 = 70 = F
M = 1001101 + 0010100 = 1011001 = 89 = Y
A = 1000001 + 0010100 = 1010101 = 85 = U
T = 1010100 + 0010100 = 1000000 = 64 = M
I = 1001001 + 0010100 = 1010111 = 93 = ]
O = 1001111 + 0010100 = 1011011 = 91 = [
N = 1001110 + 0010100 = 1011010 = 90 = Z

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:11 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

NEXT STEP Convert into RSA Algoritham

93 = ]
90 = Z
82 = R
91 = [
70 = F
89 = Y
85 = U
64 = @
93 = ]
91 = [
90 = Z

RSA algorithms

KEY GENARATION STEPS

q = 11 , p = 17

n = p*q
n = 17*11 = 187

Φ(n) = (q-1)*(p-1)
(11-1)(17-1) = 10*16 = 160

e = 7 is co-prime to Φ(n) = 160


e=7

gcd (7,160)=1
160 = 7*22+6
7* = 6*1 +1

inverse of 7 is

1 = 7-6*1
1= 7 - (160-7*22)
1*7-160+7*22
1= -160+23*7
-1*160 + 23*7

d = 23,

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:12 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

ENCRIPTION FORMULA C = Me (mod n)

M1 93 = ]
93 7 mod 187 =

932 = 932 mod 187


= 8649 mod 187
= 47

934 = 934 mod 187


= 472 mod 187
= 2209 mod 187
= 152

936 = 936 mod 187


= 47 * 152 mod 187
= 7144 mod 187
= 38

937 = 937 mod 187


= 93 * 38 mod 187
= 3534 mod 187
= 168

M7 = (((M2 )* M4 * )M6) = M2 * M4 = M6

=(M6*M1 ) = M 6+1

* Using Indices rules *

M2 90 = Z
902 = 8100 = 59 mod 187
904 = 59 * 59 = 115 mod 187
906 = 115 *59 = 53 mod 187
907 = 53*90 = 95 mod 187
95

M3 82 = R
822 = 6724 = 179 mod 187
824 = 179 * 179 = 64 mod 187
826 = 64*179 = 49 mod 187
827 = 49 * 82 = 91 mod 187

M4 91 = [
912 = 8281 = 53 mod 187
914 = 53*53 = 4 mod 187
916 = 53*4 = 25 mod 187
917 = 25*91 = 31 mod 187

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:13 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

M5 70 = F
702 = 4900 = 38 mod 187
704 = 38 * 38 = 135 mod 187
706 = 135 * 38 = 81 mod 187
707 = 81* 70 = 60 mod 187

M6 89 = Y
892 = 6724 = 67 mod 187
894 = 67*67 = 1 mod 187
896 = 1*67 = 67 mod 187
897 = 67*89 = 166 mod 187
M7 85 = U
852 = 7225 = 119 mod 187
854 = 119*119 = 136 mod 187
856 = 119*136 = 102 mod 187
857 = 102*85 = 68 mod 187

M8 64 = M
642 = 4096 = 169 mod 187
644 = 169*169 = 137 mod 187
646 = 137*169 = 152 mod 187
647 = 152*64 = 4 mod 187

M9 93 = ]
932 = 8649 = 47 mod 187
934 = 47*47 = 152 mod 187
936 = 152*47 = 38 mod 187
937 = 38*93 = 168 mod 187

M10 91 = [
912 = 8281 = 53 mod 187
914 = 53*53 = 4 mod 187
916 = 53*4 = 25 mod 187
917 = 25*91 = 31 mod 187

M11 90 = Z
902 = 8100 = 59 mod 187
904 = 59*59 = 115 mod 187
906 = 115*59 = 53 mod 187
907 = 53*90 = 95 mod 187

168, 095, 91, 31, 34, 166, 68, 004, 168, 031, 095

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:14 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

now transform into blocks of 3 digits. add “00” (two zero’s) if it is one digit, add “0” if 2 digits

168 095 091 031 060 166 068 004 168 031 095

C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11

DECRIPT ADD formula ( M = Cd (mod n))

RSA algorithms n = 187, e = 7, d = 23, q = 11 , p = 17

C1=168
168 23 (mod 187)

16823
1682 = 168*168 = 28224 = 174 mod 187
1684 = 174*174 = 169 mod 187
1688 = 169*169 = 137 mod 187
16816 = 137*137 = 69 mod 187
16822 = 69*169*174 = 64 mod 187
16823 = 64*168 = 93 mod 187

C2 = 09523
95 23 (mod 187)

952 = 95*95 = 9025 = 49 mod 187


954 = 49*49 = 157 mod 187
958 = 157*157 = 152 mod 187
9516 = 152*152 = 103 mod 187
9522 = 103*157*49 = 60 mod 187
9523 = 60*95 = 90 mod 187

C3 = 09123
91 23 (mod 187)

912 = 91*91 = 8281 = 53 mod 187


914 = 53*53 = 4 mod 187
918 = 4*4 = 16 mod 187
9116 = 16*16 = 69 mod 187
9122 = 69*4*53 = 42 mod 187
9123 = 42*91 = 82 mod 187

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:15 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

C4 = 03123
31 23 (mod 187)
3123
2
31 = 31*31 = 961 = 26 mod 187
314 = 26*26= 115 mod 187
318 = 115*115 = 135 mod 187
3116 = 135*135 = 86 mod 187
3122 = 86*115*26 = 15 mod 187
3123 = 15*31 = 91 mod 187

C5 = 06023
60 23 (mod 187)

602 = 60*60 = 3600 = 47 mod 187


604 = 47*47 = 152 mod 187
608 = 152*152 = 103 mod 187
6016 = 103*103 = 137 mod 187
6022 = 137*152*47 = 157 mod 187
6023 = 157*60 = 70 mod 187

C6 = 16623
1662 (mod 187)
1662 = 166*166 = 67 mod 187
1664 = 67*67= 1 mod 187
1668 = 1*1 = 1 mod 187
16616 = 1*1 = 1 mod 187
16622 = 67*1*1 = 67 mod 187
16623 = 67*166 = 89 mod 187

C7 = 06823
682 (mod 187)

682 = 68*68 = 136 mod 187


684 =136*136= 170 mod 187
688 = 170*170 = 102 mod 187
6816 = 102*102 = 119 mod 187
6822 = 119*170*136 = 136 mod 187
6823 = 136*68 = 85 mod 187

C8 = 00423
42 (mod 187)

42 = 4*4 = 16 = 16 mod 187


44 = 16*16= 69 mod 187
48 = 69*69 = 86 mod 187
416 = 86*86 = 103 mod 187
422 = 103*69*16 = 16 mod 187
423 = 16*4 = 64 mod 187

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:16 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

C9 = 168
168 23 (mod 187)

1682 = 168*168 = 28224 = 174 mod 187


1684 = 174*174 = 169 mod 187
1688 = 169*169 = 137 mod 187
16816 = 137*137 = 69 mod 187
16822 = 69*169*174 = 64 mod 187
16823 = 64*168 = 93 mod 187

C10 = 03123
31 23 (mod 187)

312 = 31*31 = 961 = 26 mod 187


314 = 26*26= 115 mod 187
318 = 115*115 = 135 mod 187
3116 = 135*135 = 86 mod 187
3122 = 86*115*26 = 15 mod 187
3123 = 15*31 = 91 mod 187

C11 = 09523
95 23 (mod 187)

952 = 95*95 = 9025 = 49 mod 187


954 = 49*49 = 157 mod 187
958 = 157*157 = 152 mod 187
9516 = 152*152 = 103 mod 187
9522 = 103*157*49 = 60 mod 187
9523 = 60*95 = 90 mod 187

M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11

93 90 82 91 70 89 85 64 93 91 90

Write Decrypted numbers in to ASCII characters


M1 = 93 = ]

M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11

93 90 82 91 70 89 85 64 93 91 90
] Z R [ F Y U @ ] [ Z

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:17 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

Decryption: now convert them in to binary Add 0010100

0010100 + 1010111 = 1001001 = 73 = I


0010100 + 1011010 = 1001110 = 78 = N
0010100 + 1010010 = 1000110 = 70 = F
0010100 + 1011011 = 1001111 = 79 = O
0010100 + 1000110 = 1010010 = 82 = R
0010100 + 1011001 = 1001101 = 77 = M
0010100 + 1010101 = 1000001 = 65 = A
0010100 + 1000000 = 1010100 = 84 = T
0010100 + 1010111 = 1001001 = 73 = I
0010100 + 1011011 = 1001111 = 79 = O
0010100 + 1011010 = 1001110 = 78 = N

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:18 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

EXAMPLE- 2

CHINESE REMAINDER THEOREM

ENCRYPTION

First add the key (0010100) to each letters of the plaintext

Plaintext Dec Xor Cipher(Bin) Cipher(Dec) Ciphertext

C 67 1000011+0010100 1010111 87 W

H 72 1001000+0010100 1011100 92 \

I 73 1001001+0010100 1011101 93 ]

N 78 1001110+0010100 1011010 90 Z

E 69 1000101+0010100 1010001 81 Q

S 83 1010011+0010100 1000111 71 G

E 69 1000101+0010100 1010001 81 Q

R 82 1010010+0010100 1000110 70 F

E 69 1000101+0010100 1010001 81 Q

M 77 1001101+0010100 1011001 89 Y

A 65 1000001+0010100 1010101 85 U

I 73 1001001+0010100 1011101 93 ]

N 78 1001110+0010100 1011010 90 Z

D 68 1000100+0010100 1010000 80 P

E 69 1000101+0010100 1010001 81 Q

R 82 1010010+0010100 1000110 70 F

T 84 1010100+0010100 1000000 64 @

H 72 1001000+0010100 1011100 92 \

E 69 1000101+0010100 1010001 81 Q

O 79 1001111+0010100 1011011 91 [

R 82 1010010+0010100 1000110 70 F

E 69 1000101+0010100 1010001 81 Q

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:19 out of 45
Cryptography & Numbers Theory Group: KRYPTOS Date:01/05/08

M 77 1001101+0010100 1011001 89 Y
Applying RSA to encrypt the message again

RSA algorithms n = 187, e = 7, d = 23, q = 11, p = 17

ENCRIPTION FORMULA C = Me (mod n)

W \ ] Z Q G Q F Q Y U ]

87 92 93 90 81 71 81 70 81 89 85 93

M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12

Z P Q F @ \ Q [ F Q Y

90 80 81 70 64 92 81 91 70 81 89

M13 M14 M15 M16 M17 M18 M19 M20 M21 M22 M23

RSA calculation see next page .......

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:20 out of 45
M1 87= W M2 92= \
877 (mod 187) 927 (mod 187)
872 = 87*87 = 89 mod 187 922 = 92*92 = 49 mod 187
874 = 89 * 89 = 67mod 187 924 = 49 *49 = 157mod 187
876 = 89 *67 = 166 mod 187 926 = 157 *49 = 26 mod 187
877 = 166*87 = 43 mod 187 927 = 26*92 = 148 mod 187
43 148

M3 93 = ] M4 90 = Z
937 (mod 187) 907 (mod 187)
932 = 93*93 = 47 mod 187
934 = 47*47 = 152 mod 187 902 = 8100 = 59 mod 187
936 = 152*47 = 38 mod 187 904 = 59 * 59 = 115 mod 187
937 = 38*93 = 168 mod 187 906 = 115 *59 = 53 mod 187
168 907 = 53*90 = 95 mod 187 = 95

M5 81 = Q M6 71 = Q
817 (mod 187) 717 (mod 187)

812 = 81*81 = 16 mod 187 712 = 71*71 = 179 mod 187


814 = 16 * 16 = 69 mod 187 714 = 179 * 179 = 64 mod 187
816 = 69*16 = 169 mod 187 716 = 64*179 = 49 mod 187
817 = 169*81 = 38 mod 187 717 = 49*71 = 113 mod 187
38 113

M7 81 = Q M8 70 = F
817 (mod 187) 707 (mod 187)

812 = 81*81 = 16 mod 187 702 = 70*70 = 38 mod 187


814 = 16 * 16 = 69 mod 187 704 = 38 * 38 =135 mod 187
816 = 69*16 = 169 mod 187 706 = 135*38 = 81 mod 187
817 = 169*81 = 38 mod 187 707 = 81*70 = 60 mod 187
38 60

M9 81 = Q M10 89 = Y
817 (mod 187) 892 = 6724 = 67 mod 187
894 = 67*67 = 1 mod 187
812 = 81*81 = 16 mod 187 896 = 1*67 = 67 mod 187
814 = 16 * 16 = 69 mod 187 897 = 67*89 = 166 mod 187
816 = 69*16 = 169 mod 187 166
817 = 169*81 = 38 mod 187
38

M11 85 = U M12 93 = ]
852 = 7225 = 119 mod 187 937 (mod 187)
854 = 119*119 = 136 mod 187 932 = 93*93 = 47 mod 187
856 = 119*136 = 102 mod 187 934 = 47*47 = 152 mod 187
857 = 102*85 = 68 mod 187 936 = 152*47 = 38 mod 187
68 937 = 38*93 = 168 mod 187
168

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:21 out of 45
M13 90 = Z M14 80 = P
907 (mod 187) 807 (mod 187)

902 = 8100 = 59 mod 187 802 = 6400 = 42 mod 187


904 = 59 * 59 = 115 mod 187 804 = 42 * 42 = 81 mod 187
906 = 115 *59 = 53 mod 187 806 = 81 *42 = 36 mod 187
907 = 53*90 = 95 mod 187 807 = 80*36= 75 mod 187
95 75

M15 81 = Q M16 70 = F
817 (mod 187) 707 (mod 187)

812 = 81*81 = 16 mod 187 702 = 70*70 = 38 mod 187


814 = 16 * 16 = 69 mod 187 704 = 38 * 38 =135 mod 187
816 = 69*16 = 169 mod 187 706 = 135*38 = 81 mod 187
817 = 169*81 = 38 mod 187 707 = 81*70 = 60 mod 187
38 60

M17 64 = @ M18 92= \


927 (mod 187)
642 = 4096 = 169 mod 187 922 = 92*92 = 49 mod 187
644 = 169*169 = 137 mod 187 924 = 49 *49 = 157mod 187
646 = 137*169 = 152 mod 187 926 = 157 *49 = 26 mod 187
647 = 152*64 = 4 mod 187 927 = 26*92 = 148 mod 187
4 148

M19 81 = Q M20 91 = [
817 (mod 187) 912 = 8281 = 53 mod 187
812 = 81*81 = 16 mod 187 914 = 53*53 = 4 mod 187
814 = 16 * 16 = 69 mod 187 916 = 53*4 = 25 mod 187
816 = 69*16 = 169 mod 187 917 = 25*91 = 31 mod 187
817 = 169*81 = 38 mod 187 = 38 31

M21 70 = F M22 81 = Q
707 (mod 187) 817 (mod 187)

702 = 70*70 = 38 mod 187 812 = 81*81 = 16 mod 187


704 = 38 * 38 =135 mod 187 814 = 16 * 16 = 69 mod 187
706 = 135*38 = 81 mod 187 816 = 69*16 = 169 mod 187
707 = 81*70 = 60 mod 187 = 60 817 = 169*81 = 38 mod 187 = 38

M23 89 = Y
892 = 6724 = 67 mod 187
894 = 67*67 = 1 mod 187
896 = 1*67 = 67 mod 187
897 = 67*89 = 166 mod 187
166

The final cryptogram in blocks of three decimal digits could be written as:

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:22 out of 45
043 148 168 095 038 113 038 060 038 166 068 168 095 075 038 060 004 148 038
031 060 038 166

C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12

043 148 168 095 038 113 038 060 038 166 068 168

C13 C14 C15 C16 C17 C18 C19 C20 C21 C22 C23

095 075 038 060 004 148 038 031 060 038 166

DECRIPT ADD formula ( M = Cd (mod n))

RSA algorithms n = 187, e = 7, d = 23, q = 11, p = 17

C1= 04323 C2 = 14823


43 23 (mod 187) 148 23 (mod 187)

432 = 43*43 = 166 mod 187 1482 = 148*148 = 25 mod 187


434 = 1666*166= 67 mod 187 1484 = 25*25 = 64 mod 187
438 = 67*67 = 1 mod 187 1488 = 64*64 = 169 mod 187
4316 = 1*1 = 1 mod 187 14816 = 169*169 = 137 mod 187
4322 = 1*67*166 = 89 mod 187 14822 = 137*64*25 = 36 mod 187
4323 = 89*43 = 87 mod 187 14823 = 36 *148 = 92 mod 187
87 92

C3=168 C4 = 09523
168 23 (mod 187) 95 23 (mod 187)

16823 952 = 95*95 = 9025 = 49 mod 187


1682 = 168*168 = 28224 = 174 mod 187 954 = 49*49 = 157 mod 187
1684 = 174*174 = 169 mod 187 958 = 157*157 = 152 mod 187
1688 = 169*169 = 137 mod 187 9516 = 152*152 = 103 mod 187
16816 = 137*137 = 69 mod 187 9522 = 103*157*49 = 60 mod 187
16822 = 69*169*174 = 64 mod 187 9523 = 60*95 = 90 mod 187
16823 = 64*168 = 93 mod 187 90
93

C5 = 03823
38 23 (mod 187) C6 = 11323
113 23 (mod 187)

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:23 out of 45
382 = 38*38 = 135 mod 187
384 = 135*135 = 86 mod 187 1132 = 113*113 = 53 mod 187
388 = 86*86 = 103 mod 187 1134 = 53*53 = 4 mod 187
3816 = 103*103 = 137 mod 187 1138 = 4*4 = 16 mod 187
3822 = 137*186*135 = 135mod 187 11316 = 16*16 = 89 mod 187
3823 = 135*38 = 81 mod 187 11322 = 89*4*53 = 42mod 187
81 11323 = 42*113 = 71 mod 187
71

C7 = 03823 C8 = 06023
38 23 (mod 187) 60 23 (mod 187)

382 = 38*38 = 135 mod 187 602 = 60*60 = 3600 = 47 mod 187
384 = 135*135 = 86 mod 187 604 = 47*47 = 152 mod 187
388 = 86*86 = 103 mod 187 608 = 152*152 = 103 mod 187
3816 = 103*103 = 137 mod 187 6016 = 103*103 = 137 mod 187
3822 = 137*186*135 = 135mod 187 6022 = 137*152*47 = 157 mod 187
3823 = 135*38 = 81 mod 187 6023 = 157*60 = 70 mod 187
81 70

C9 = 03823 C10 = 16623


38 23 (mod 187) 16623 (mod 187)

382 = 38*38 = 135 mod 187 1662 = 166*166 = 67 mod 187


384 = 135*135 = 86 mod 187 1664 = 67*67= 1 mod 187
388 = 86*86 = 103 mod 187 1668 = 1*1 = 1 mod 187
3816 = 103*103 = 137 mod 187 16616 = 1*1 = 1 mod 187
3822 = 137*186*135 = 135mod 187 16622 = 67*1*1 = 67 mod 187
3823 = 135*38 = 81 mod 187 16623 = 67*166 = 89 mod 187
81 89

C11 =06823 C12 = 16823


6823 (mod 187) 16823 (mod 187)

682 = 68*68 = 136 mod 187 1682 = 168*168 = 28224 = 174 mod 187
684 = 136*136= 170 mod 187 1684 = 174*174 = 169 mod 187
688 = 170*170 = 102 mod 187 1688 = 169*169 = 137 mod 187
6816 = 102*102 = 119 mod 187 16816 = 137*137 = 69 mod 187
6822 = 119*170*136 = 136 mod 187 16822 = 69*169*174 = 64 mod 187
6823 = 68*136 = 85 mod 187 16823 = 64*168 = 93 mod 187
85 93

C13 = 09523
95 23 (mod 187) C14 = 07523
75 23 (mod 187)

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:24 out of 45
952 = 95*95 = 9025 = 49 mod 187
954 = 49*49 = 157 mod 187 752 = 75*75 = 15 mod 187
958 = 157*157 = 152 mod 187 754 = 15*15 = 38 mod 187
9516 = 152*152 = 103 mod 187 758 = 38*38 = 135 mod 187
9522 = 103*157*49 = 60 mod 187 7516 = 135*135 = 86 mod 187
9523 = 60*95 = 90 mod 187 7522 = 86*38*15 = 26mod 187
90 7523 = 75*26 = 80 mod 187
80

C15 = 03823 C16 = 06023


38 23 (mod 187) 60 23 (mod 187)

382 = 38*38 = 135 mod 187 602 = 60*60 = 3600 = 47 mod 187
384 = 135*135 = 86 mod 187 604 = 47*47 = 152 mod 187
388 = 86*86 = 103 mod 187 608 = 152*152 = 103 mod 187
3816 = 103*103 = 137 mod 187 6016 = 103*103 = 137 mod 187
3822 = 137*186*135 = 135mod 187 6022 = 137*152*47 = 157 mod 187
3823 = 135*38 = 81 mod 187 6023 = 157*60 = 70 mod 187
81 70

C17 = 00423 C18 = 14823


423 (mod 187) 148 23 (mod 187)

42 = 4*4 = 16 = 16 mod 187 1482 = 148*148 = 25 mod 187


44 = 16*16= 69 mod 187 1484 = 25*25 = 64 mod 187
48 = 69*69 = 86 mod 187 1488 = 64*64 = 169 mod 187
416 = 86*86 = 103 mod 187 14816 = 169*169 = 137 mod 187
422 = 103*69*16 = 16 mod 187 14822 = 137*64*25 = 36 mod 187
423 = 16*4 = 64 mod 187 14823 = 36 *148 = 92 mod 187
64 92

C19 = 03823 C20 = 03123


38 23 (mod 187) 31 23 (mod 187)

382 = 38*38 = 135 mod 187 312 = 31*31 = 961 = 26 mod 187
384 = 135*135 = 86 mod 187 314 = 26*26= 115 mod 187
388 = 86*86 = 103 mod 187 318 = 115*115 = 135 mod 187
3816 = 103*103 = 137 mod 187 3116 = 135*135 = 86 mod 187
3822 = 137*186*135 = 135mod 187 3122 = 86*115*26 = 15 mod 187
3823 = 135*38 = 81 mod 187 3123 = 15*31 = 91 mod 187
81 91

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:25 out of 45
C21 = 06023
60 23 (mod 187) C22 = 03823
38 23 (mod 187)
602 = 60*60 = 3600 = 47 mod 187
604 = 47*47 = 152 mod 187 382 = 38*38 = 135 mod 187
608 = 152*152 = 103 mod 187 384 = 135*135 = 86 mod 187
6016 = 103*103 = 137 mod 187 388 = 86*86 = 103 mod 187
6022 = 137*152*47 = 157 mod 187 3816 = 103*103 = 137 mod 187
6023 = 157*60 = 70 mod 187 3822 = 137*186*135 = 135mod 187
70 3823 = 135*38 = 81 mod 187
81

C23 = 16623
16623 (mod 187)

1662 = 166*166 = 67 mod 187


1664 = 67*67= 1 mod 187
1668 = 1*1 = 1 mod 187
16616 = 1*1 = 1 mod 187
16622 = 67*1*1 = 67 mod 187
16623 = 67*166 = 89 mod 187
89

Group Members: Alice, Eliyas, Sara, Sulma, Yogesh page no:26 out of 45
Converting RSA numbers into 7-bits then adding 0010100 to all the 7-bit binary to get
Plaintext.

Cipher(Dec) Ciphertext Cipher(Bin Xor Plaintext(Bin) Dec Plaintext

87 W 1010111 1010111+0010100 1000011 67 C

92 \ 1011100 1011100+0010100 1001000 72 H

93 ] 1011101 1011101+0010100 1001001 73 I

90 Z 1011010 1011010+0010100 1001110 78 N

81 Q 1010001 1010001+0010100 1000101 69 E

71 G 1000111 1000111+0010100 1010011 83 S

81 Q 1010001 1010001+0010100 1000101 69 E

70 F 1000110 1000110+0010100 1010010 82 R

81 Q 1010001 1010001+0010100 1000101 69 E

89 Y 1011001 1011001+0010100 1001101 77 M

85 U 1010101 1010101+0010100 1000001 65 A

93 ] 1011101 1011101+0010100 1001001 73 I

90 Z 1011010 1011010+0010100 1001110 78 N

80 P 1010000 1010000+0010100 1000100 68 D

81 Q 1010001 1010001+0010100 1000101 69 E

70 F 1000110 1000110+0010100 1010010 82 R

64 @ 1000000 1000000+0010100 1010100 84 T

92 \ 1011100 1011100+0010100 1001000 72 H

81 Q 1010001 1010001+0010100 1000101 69 E

91 [ 1011011 1011011+0010100 1001111 79 O

70 F 1000110 1000110+0010100 1010010 82 R

81 Q 1010001 1010001+0010100 1000101 69 E

89 Y 1011001 1011001+0010100 1001101 77 M


Example-3
Plaintext: “SEND ME THE DECRYPTION ALGORITHM”

Plaintext Dec Xor Cipher(Bin) Cipher(Dec) Ciphertext

S 83 1010011+0010100 1000111 71 G

E 69 1000101+0010100 1010001 81 Q

N 78 1001100+0010100 1011000 88 X

D 68 1000100+0010100 1010000 80 P

M 77 1001101+0010100 1011001 89 Y

E 69 1000101+0010100 1010001 81 Q

T 84 1010100+0010100 1000000 64 @

H 72 1001000+0010100 1011100 92 \

E 69 1000101+0010100 1010001 81 Q

D 68 1000100+0010100 1010000 80 P

E 69 1000101+0010100 1010001 81 Q

C 67 1000011+0010100 1010111 87 W

R 82 1010010+0010100 1000110 70 F

Y 89 1011001+0010100 1001101 77 M

P 80 1010000+0010100 1000100 68 D

T 84 1010100+0010100 1000000 64 @

I 73 1001001+0010100 1011101 93 ]

O 79 1001101+0010100 1011011 91 [

N 78 1001100+0010100 1011000 88 X

A 65 1000001+0010100 1010101 85 U

L 76 1001110+0010100 1011010 90 Z

G 71 1000111+0010100 1010011 83 S

O 79 1001101+0010100 1011011 91 [

R 82 1010010+0010100 1000110 70 F

I 73 1001001+0010100 1011101 93 ]

T 84 1010100+0010100 1000000 64 @
H 72 1001000+0010100 1011100 92 \

M 77 1001011+0010100 1011001 89 Y

Applying RSA to encrypt the message again

RSA algorithms n = 187, e = 7, d = 23, q = 11, p = 17

ENCRIPTION FORMULA C = Me (mod n)

G Q X P Y Q @ \ Q P Q W F M D

71 81 88 80 89 81 64 92 81 80 81 87 70 77 68

M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15

@ ] [ X U Z S [ F ] @ \ Y

64 93 91 88 85 90 83 91 70 93 64 92 89

M16 M17 M18 M19 M20 M21 M22 M23 M24 M25 M26 M27 M28

For Encryption RAS calculation see next page .........


M1 71= G M2 81 = Q
717 (mod 187) 817 (mod 187)
712 = 71*71 = 179 mod 187
714 = 179 * 179 = 64mod 187 812 = 81*81 = 16 mod 187
716 = 179 *64 = 49 mod 187 814 = 16 * 16 = 69 mod 187
717 = 49*71 = 113 mod 187 816 = 69*16 = 169 mod 187
113 817 = 169*81 = 38 mod 187
38

M3 88= X M4 80 = P
887 (mod 187) 807 (mod 187)
882 = 88*88 = 77 mod 187
884 = 77 *77 = 132mod 187 802 = 6400 = 42 mod 187
886 = 77 *132 = 66 mod 187 804 = 42 * 42 = 81 mod 187
887 = 110*88 = 11 mod 187 806 = 81 *42 = 36 mod 187
11 807 = 80*36= 75 mod 187
75

M5 89 = Y M6 81 = Q
892 = 6724 = 67 mod 187 817 (mod 187)
894 = 67*67 = 1 mod 187 812 = 81*81 = 16 mod 187
896 = 1*67 = 67 mod 187 814 = 16 * 16 = 69 mod 187
897 = 67*89 = 166 mod 187 816 = 69*16 = 169 mod 187
166 817 = 169*81 = 38 mod 187
38

M7 64 = @ M8 92= \
642 = 4096 = 169 mod 187 927 (mod 187)
644 = 169*169 = 137 mod 187 922 = 92*92 = 49 mod 187
646 = 137*169 = 152 mod 187 924 = 49 *49 = 157mod 187
647 = 152*64 = 4 mod 187 926 = 157 *49 = 26 mod 187
4 927 = 26*92 = 148 mod 187
148

M9 81 = Q M10 80 = P
817 (mod 187) 807 (mod 187)
812 = 81*81 = 16 mod 187
814 = 16 * 16 = 69 mod 187 802 = 6400 = 42 mod 187
816 = 69*16 = 169 mod 187 804 = 42 * 42 = 81 mod 187
817 = 169*81 = 38 mod 187 806 = 81 *42 = 36 mod 187
38 807 = 80*36= 75 mod 187
75

M11 81 = Q M12 87= W


817 (mod 187) 877 (mod 187)
812 = 81*81 = 16 mod 187 872 = 87*87 = 89 mod 187
814 = 16 * 16 = 69 mod 187 874 = 89 * 89 = 67mod 187
816 = 69*16 = 169 mod 187 876 = 89 *67 = 166 mod 187
817 = 169*81 = 38 mod 187 877 = 166*87 = 43 mod 187
38 43
M13 70 = F M14 77 = M
707 (mod 187) 777 (mod 187)

702 = 70*70 = 38 mod 187 772 = 77*77 = 132 mod 187


704 = 38 * 38 =135 mod 187 774 = 132 * 132 =33 mod 187
706 = 135*38 = 81 mod 187 776 = 33*132 = 55 mod 187
707 = 81*70 = 60 mod 187 777 = 55*77 = 121 mod 187
60 121

M15 68 = D M16 64 = @
687 (mod 187)
642 = 4096 = 169 mod 187
682 = 68*68 = 136 mod 187 644 = 169*169 = 137 mod 187
684 = 136 * 136 =170 mod 187 646 = 137*169 = 152 mod 187
686 = 170*136 = 119 mod 187 647 = 152*64 = 4 mod 187
687 = 119*68 = 51 mod 187 4
51

M17 93 = ] M18 91 = [
937 (mod 187) 912 = 8281 = 53 mod 187
932 = 93*93 = 47 mod 187 914 = 53*53 = 4 mod 187
934 = 47*47 = 152 mod 187 916 = 53*4 = 25 mod 187
936 = 152*47 = 38 mod 187 917 = 25*91 = 31 mod 187
937 = 38*93 = 168 mod 187 = 168 31

M19 88= X M20 85 = U


887 (mod 187) 852 = 7225 = 119 mod 187
882 = 88*88 = 77 mod 187 854 = 119*119 = 136 mod 187
884 = 77 *77 = 132mod 187 856 = 119*136 = 102 mod 187
886 = 77 *132 = 66 mod 187 857 = 102*85 = 68 mod 187
887 = 110*88 = 11 mod 187 68
11

M21 90 = Z M22 83 = S
907 (mod 187) 837 (mod 187)

902 = 8100 = 59 mod 187 832 = 83*83 = 157 mod 187


904 = 59 * 59 = 115 mod 187 834 = 157 * 157 = 152 mod 187
906 = 115 *59 = 53 mod 187 836 = 103 *152 = 115 mod 187
907 = 53*90 = 95 mod 187 837 = 115*83 = 8 mod 187
95 8

M23 91 = [ M24 70 = F
912 = 8281 = 53 mod 187 707 (mod 187)
914 = 53*53 = 4 mod 187
916 = 53*4 = 25 mod 187 702 = 70*70 = 38 mod 187
917 = 25*91 = 31 mod 187 704 = 38 * 38 =135 mod 187
31 706 = 135*38 = 81 mod 187
707 = 81*70 = 60 mod 187
60
M25 93 = ] M26 64 = @
937 (mod 187)
932 = 93*93 = 47 mod 187 642 = 4096 = 169 mod 187
934 = 47*47 = 152 mod 187 644 = 169*169 = 137 mod 187
936 = 152*47 = 38 mod 187 646 = 137*169 = 152 mod 187
937 = 38*93 = 168 mod 187 647 = 152*64 = 4 mod 187
168 4

M27 92= \
927 (mod 187) M28 89 = Y
922 = 92*92 = 49 mod 187 892 = 6724 = 67 mod 187
924 = 49 *49 = 157mod 187 894 = 67*67 = 1 mod 187
926 = 157 *49 = 26 mod 187 896 = 1*67 = 67 mod 187
927 = 26*92 = 148 mod 187 897 = 67*89 = 166 mod 187
148 166
Cryptography and Numbers Theory Group Coursework Date:30/04/20008

The final cryptogram in blocks of three decimal digits could be written as:

113 038 011 075 166 038 004 148 038 075 038 043 060 121 051 004 168 031 011 068 095
008 038 060 168 004 148 166

C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14

113 038 011 075 166 038 004 148 038 075 038 043 060 121

C15 C16 C17 C18 C19 C20 C21 C22 C23 C24 C25 C26 C27 C28

051 004 168 031 011 068 095 008 031 060 168 004 148 166

C1= 113 C2= 38


113 (mod 187) 38 (mod 187)
1132 = 113*113 = 53 mod 187 382 = 38*38 = 135 mod 187
1134 = 53*53= 4 mod 187 384 = 135*135= 86 mod 187
1138 = 4*4= 16 mod 187 388 = 86*86= 16 mod 187
11316 = 16*16 = 69 mod 187 3816 = 16*16 = 69 mod 187
11322 = 69*4*53 = 42mod 187 3822 = 69*86*135 = 169mod 187
11323 = 42*113 = 71 mod 187 3823 = 42*113 = 64 mod 187

C3= 11 C4= 75
11(mod 187) 75(mod 187)
112 = 11*11 = 121 mod 187 752 = 75*75 = 15 mod 187
114 = 121*121= 55 mod 187 754 = 15*15= 38 mod 187
118 = 55*55= 33 mod 187 758 = 38*38= 135 mod 187
1116 = 33*33= 154 mod 187 7516 = 135*135= 86 mod 187
1122 = 154*55*121 = 110mod 187 7522 = 86*38*15 = 26mod 187
1123 = 11*110 = 88 mod 187 7523 = 75*26 = 80 mod 187

C5 = 16623 C6 = 03823
16623 (mod 187) 38 23 (mod 187)

1662 = 166*166 = 67 mod 187 382 = 38*38 = 135 mod 187


1664 = 67*67= 1 mod 187 384 = 135*135 = 86 mod 187
1668 = 1*1 = 1 mod 187 388 = 86*86 = 103 mod 187
16616 = 1*1 = 1 mod 187 3816 = 103*103 = 137 mod 187
16622 = 67*1*1 = 67 mod 187 3822 = 137*186*135 = 135mod 187
16623 = 67*166 = 89 mod 187 3823 = 135*38 = 81 mod 187
89 81

C7 = 00423 C8 = 14823
423 (mod 187) 14823 (mod 187)

Alice, Eliyas, Sulma, Sara, Yogesh page no:33 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

42 = 4*4 = 16 = 16 mod 187 1482 = 148*148 = 25 mod 187


44 = 16*16= 69 mod 187 1484 = 25*25= 64 mod 187
48 = 69*69 = 86 mod 187 1488 = 64*64 = 169 mod 187
416 = 86*86 = 103 mod 187 14816 = 169*169 = 137 mod 187
422 = 103*69*16 = 16 mod 187 14822 = 137*64*25 = 36 mod 187
423 = 16*4 = 64 mod 187 14823 = 36*148 = 92 mod 187
64 92

C9 = 03823 C10= 75
38 23 (mod 187) 75(mod 187)
752 = 75*75 = 15 mod 187
382 = 38*38 = 135 mod 187 754 = 15*15= 38 mod 187
384 = 135*135 = 86 mod 187 758 = 38*38= 135 mod 187
388 = 86*86 = 103 mod 187 7516 = 135*135= 86 mod 187
3816 = 103*103 = 137 mod 187 7522 = 86*38*15 = 26mod 187
3822 = 137*186*135 = 135mod 187 7523 = 75*26 = 80 mod 187
3823 = 135*38 = 81 mod 187
81

C11 = 03823 C12= 04323


38 23 (mod 187) 43 23 (mod 187)

382 = 38*38 = 135 mod 187 432 = 43*43 = 166 mod 187
384 = 135*135 = 86 mod 187 434 = 1666*166= 67 mod 187
388 = 86*86 = 103 mod 187 438 = 67*67 = 1 mod 187
3816 = 103*103 = 137 mod 187 4316 = 1*1 = 1 mod 187
3822 = 137*186*135 = 135mod 187 4322 = 1*67*166 = 89 mod 187
3823 = 135*38 = 81 mod 187 4323 = 89*43 = 87 mod 187
81 87

C13 = 06023 C14 = 12123


60 23 (mod 187) 121 23 (mod 187)

602 = 60*60 = 3600 = 47 mod 187 1212 = 121*121 = 14641 = 55 mod 187
604 = 47*47 = 152 mod 187 1214 = 55*55 = 33 mod 187
608 = 152*152 = 103 mod 187 1218 = 33*33 = 154 mod 187
6016 = 103*103 = 137 mod 187 12116 = 154*154 = 154 mod 187
6022 = 137*152*47 = 157 mod 187 12122 = 154*33*55 = 132 mod 187
6023 = 157*60 = 70 mod 187 12123 = 132*121 = 77 mod 187
70 77

C15 = 05123 C16 =00423


51 23 (mod 187) 423 (mod 187)

Alice, Eliyas, Sulma, Sara, Yogesh page no:34 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

512 = 51*51 = 2601 = 170mod 187 42 = 4*4 = 16 = 16 mod 187


514 = 170*170 = 102 mod 187 44 = 16*16= 69 mod 187
518 = 102*102 = 119 mod 187 48 = 69*69 = 86 mod 187
5116 = 119*119 = 136 mod 187 416 = 86*86 = 103 mod 187
5122 = 136*102*170 = 170 mod 187 422 = 103*69*16 = 16 mod 187
5123 = 170*51 = 68 mod 187 423 = 16*4 = 64 mod 187
68 64

C17 = 16823 C18 = 03123


16823 (mod 187) 31 23 (mod 187)

1682 = 168*168 = 28224 = 174 mod 187 312 = 31*31 = 961 = 26 mod 187
1684 = 174*174 = 169 mod 187 314 = 26*26= 115 mod 187
1688 = 169*169 = 137 mod 187 318 = 115*115 = 135 mod 187
16816 = 137*137 = 69 mod 187 3116 = 135*135 = 86 mod 187
16822 = 69*169*174 = 64 mod 187 3122 = 86*115*26 = 15 mod 187
16823 = 64*168 = 93 mod 187 3123 = 15*31 = 91 mod 187
93 91

C19= 11 C20 =06823


11(mod 187) 6823 (mod 187)
112 = 11*11 = 121 mod 187
114 = 121*121= 55 mod 187 682 = 68*68 = 136 mod 187
118 = 55*55= 33 mod 187 684 = 136*136= 170 mod 187
1116 = 33*33= 154 mod 187 688 = 170*170 = 102 mod 187
1122 = 154*55*121 = 110mod 187 6816 = 102*102 = 119 mod 187
1123 = 11*110 = 88 mod 187 6822 = 119*170*136 = 136 mod 187
6823 = 68*136 = 85 mod 187
85

C21 = 09523 C22 = 00823


95 23 (mod 187) 423 (mod 187)

952 = 95*95 = 9025 = 49 mod 187 82 = 8*8 = 64 = 64 mod 187


954 = 49*49 = 157 mod 187 84 = 64*64= 169 mod 187
958 = 157*157 = 152 mod 187 88 = 169*169 = 137 mod 187
9516 = 152*152 = 103 mod 187 816 = 137*137 = 69 mod 187
9522 = 103*157*49 = 60 mod 187 822 = 69*169*64 = 174 mod 187
9523 = 60*95 = 90 mod 187 823 = 174*8 = 83 mod 187
90 83

C23 = 03123 C24 = 06023


31 23 (mod 187) 60 23 (mod 187)

Alice, Eliyas, Sulma, Sara, Yogesh page no:35 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

312 = 31*31 = 961 = 26 mod 187 602 = 60*60 = 3600 = 47 mod 187
314 = 26*26= 115 mod 187 604 = 47*47 = 152 mod 187
318 = 115*115 = 135 mod 187 608 = 152*152 = 103 mod 187
3116 = 135*135 = 86 mod 187 6016 = 103*103 = 137 mod 187
3122 = 86*115*26 = 15 mod 187 6022 = 137*152*47 = 157 mod 187
3123 = 15*31 = 91 mod 187 6023 = 157*60 = 70 mod 187
91 70

C25 = 16823 C26 = 00423


16823 (mod 187) 423 (mod 187)

1682 = 168*168 = 28224 = 174 mod 187 42 = 4*4 = 16 = 16 mod 187


1684 = 174*174 = 169 mod 187 44 = 16*16= 69 mod 187
1688 = 169*169 = 137 mod 187 48 = 69*69 = 86 mod 187
16816 = 137*137 = 69 mod 187 416 = 86*86 = 103 mod 187
16822 = 69*169*174 = 64 mod 187 422 = 103*69*16 = 16 mod 187
16823 = 64*168 = 93 mod 187 423 = 16*4 = 64 mod 187
93 64

C27 = 14823 C28 = 16623


14823 (mod 187) 16623 (mod 187)

1482 = 148*148 = 25 mod 187 1662 = 166*166 = 67 mod 187


1484 = 25*25= 64 mod 187 1664 = 67*67= 1 mod 187
1488 = 64*64 = 169 mod 187 1668 = 1*1 = 1 mod 187
14816 = 169*169 = 137 mod 187 16616 = 1*1 = 1 mod 187
14822 = 137*64*25 = 36 mod 187 16622 = 67*1*1 = 67 mod 187
14823 = 36*148 = 92 mod 187 16623 = 67*166 = 89 mod 187
92 89

C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15

71 81 88 80 89 81 64 92 81 80 81 87 70 77 68

G Q X P Y Q @ \ Q P Q W F M D

C16 C17 C18 C19 C20 C21 C22 C23 C24 C25 C26 C27 C28

Alice, Eliyas, Sulma, Sara, Yogesh page no:36 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

64 93 91 88 85 90 83 91 70 93 64 92 89

@ ] [ X U Z S [ F ] @ \ Y

Cipher(Dec) Ciphertext Cipher(Bin) Add Xor Dec Plaintext


(Key)

71 G 1000111 +0010100 1010011 83 S

81 Q 1010001 +0010100 1000101 69 E

88 X 1011000 +0010100 1001100 78 N

80 P 1010000 +0010100 1000100 68 D

89 Y 1011001 +0010100 1001101 77 M

81 Q 1010001 +0010100 1000101 69 E

64 @ 1000000 +0010100 1010100 84 T

92 \ 1011100 +0010100 1001000 72 H

81 Q 1010001 +0010100 1000101 69 E

80 P 1010000 +0010100 1000100 68 D

81 Q 1010001 +0010100 1000101 69 E

87 W 1010111 +0010100 1000011 67 C

70 F 1000110 +0010100 1010010 82 R

77 M 1001101 +0010100 1011001 89 Y

68 D 1000100 +0010100 1010000 80 P

64 @ 1000000 +0010100 1010100 84 T

93 ] 1011101 +0010100 1001001 73 I

91 [ 1011011 +0010100 1001101 79 O

88 X 1011000 +0010100 1001100 78 N

85 U 1010101 +0010100 1000001 65 A

90 Z 1011010 +0010100 1001110 76 L

83 S 1010011 +0010100 1000111 71 G

91 [ 1011011 +0010100 1001101 79 O

Alice, Eliyas, Sulma, Sara, Yogesh page no:37 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

70 F 1000110 +0010100 1010010 82 R

93 ] 1011101 +0010100 1001001 73 I

64 @ 1000000 +0010100 1010100 84 T

92 \ 1011100 +0010100 1001000 72 H

89 Y 1011001 +0010100 1001011 77 M

Chapter 6

Alice, Eliyas, Sulma, Sara, Yogesh page no:38 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

Conclusion
For prior algorithm kryptos group members dicided to use ASCII 7-bit binary and Vigèner
cipher, ASCII 7-bit binary was inspired from Tutorial Exercises, while the RSA algorithm
was inspired from number theory. While implementing the above algorithms to practise, we
found out that overall our algorithm was very weak , as the Vigèner Cipher is public and the
7-bit ASCII representation can be brute forced. We also discovered that using 7-bit binary
and swapping 3rd and 5th position makes it more vulnerable, to outside world, meaning it’s
easy to break, because, there were 11 characters which did not have any affects of swapping
(shift) 3rd and 5th position. Hence we decided to drop the Vigèner cipher and change the 7-
bit to 0010100, which we add to ASCII , DEC characters.

There are two algorithms in Kryptos algorithm, which are combinations of ASCII and RSA.
RSA makes cryptography techniques more safe and very hard to guess and to break. the
public key, can be known to anybody that won’t ffect the safer encryption translation
process, “n” and “e” are public, however, the p and q are secret hence it makes it very
difficult to break.

We can define the weakness of RSA algorithm in several points.


The factorisation of very large numbers takes an enormous amount of time. The ciphertext
can be caused the problem if attacker knows both the plaintext and ciphertext. They can
break the key to find the private key, d.

Another possible attack is on encryption exponent, e. If e = 5 or lower the message can


easily be encrypted 5 times with different keys by using Chinese Remainder Theorem and
find the message.

Appendix 1

Alice, Eliyas, Sulma, Sara, Yogesh page no:39 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

ASCII Table:

Appendix 2
ASCII Table with 7-bit binary sequences

Alice, Eliyas, Sulma, Sara, Yogesh page no:40 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

Dec Oct Hex Bin Symbol Dec Oct Hex Bin Symbol Dec Oct Hex Bin Symbol
32 040 20 0100000 64 100 40 1000000 @ 96 140 60 1100000 `
33 041 21 0100001 ! 65 101 41 1000001 A 97 141 61 1100001 a
34 042 22 0100010 " 66 102 42 1000010 B 98 142 62 1100010 b
35 043 23 0100011 # 67 103 43 1000011 C 99 143 63 1100011 c
36 044 24 0100100 $ 68 104 44 1000100 D 100 144 64 1100100 d
37 045 25 0100101 % 69 105 45 1000101 E 101 145 65 1100101 e
38 046 26 0100110 & 70 106 46 1000110 F 102 146 66 1100110 f
39 047 27 0100111 ' 71 107 47 1000111 G 103 147 67 1100111 g
40 050 28 0101000 ( 72 110 48 1001000 H 104 150 68 1101000 h
41 051 29 0101001 ) 73 111 49 1001001 I 105 151 69 1101001 i
42 052 2A 0101010 * 74 112 4A 1001010 J 106 152 6A 1101010 j
43 053 2B 0101011 + 75 113 4B 1001011 K 107 153 6B 1101011 k
44 054 2C 0101100 , 76 114 4C 1001100 L 108 154 6C 1101100 l
45 055 2D 0101101 - 77 115 4D 1001101 M 109 155 6D 1101101 m
46 056 2E 0101110 . 78 116 4E 1001110 N 110 156 6E 1101110 n
47 057 2F 0101111 / 79 117 4F 1001111 O 111 157 6F 1101111 o
48 060 30 0110000 0 80 120 50 1010000 P 112 160 70 1110000 p
49 061 31 0110001 1 81 121 51 1010001 Q 113 161 71 1110001 q
50 062 32 0110010 2 82 122 52 1010010 R 114 162 72 1110010 r
51 063 33 0110011 3 83 123 53 1010011 S 115 163 73 1110011 s
52 064 34 0110100 4 84 124 54 1010100 T 116 164 74 1110100 t
53 065 35 0110101 5 85 125 55 1010101 U 117 165 75 1110101 u
54 066 36 0110110 6 86 126 56 1010110 V 118 166 76 1110110 v
55 067 37 0110111 7 87 127 57 1010111 W 119 167 77 1110111 w
56 070 38 0111000 8 88 130 58 1011000 X 120 170 78 1111000 x
57 071 39 0111001 9 89 131 59 1011001 Y 121 171 79 1111001 y
58 072 3A 0111010 : 90 132 5A 1011010 Z 122 172 7A 1111010 z
59 073 3B 0111011 ; 91 133 5B 1011011 [ 123 173 7B 1111011 {
60 074 3C 0111100 < 92 134 5C 1011100 \ 124 174 7C 1111100 |
61 075 3D 0111101 = 93 135 5D 1011101 ] 125 175 7D 1111101 }
62 076 3E 0111110 > 94 136 5E 1011110 ^ 126 176 7E 1111110 ~
63 077 3F 0111111 ? 95 137 5F 1011111 _ 127 177 7F 1111111

References

Alice, Eliyas, Sulma, Sara, Yogesh page no:41 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

Lecture
Dr Danni Novakovic, Lecture Notes compiled, London Metropolitan University, 2008.

Book
M.R. Schroeder, Number Theory in Science and Communication, Third Edition, 1997.

William Stallings, Cryptography and Network Security, Third Edition, Prentice Hall, 2003.

Douglas R. Stinson, Cryptography Theory and Practice, Second Edition, Chapman &
Hall/CRC, 2002.

Web:
http://en.wikipedia.org/wiki/RSA (20/04/2008)

http://www.di-mgt.com.au/rsa_alg.html ( 20/04/08)

Group Meetings Minutes

Alice, Eliyas, Sulma, Sara, Yogesh page no:42 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

Meeting Date: 27.02.2008


Meeting Time Start: 2PM
Meeting Time Finish: About 3PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------

Yogesh suggested looking for an algorithm on Internet or other sources. We tried to know
each other.

Meeting Date: 12.03.2008


Meeting Time Start: 2PM
Meeting Time Finish: About 4PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh
AGENDA
--------

Alice and Eliyes suggested Vigenère Ciphers and Modern Block Ciphers. It approved by
other members of group. We implemented real example using our algorithm.

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

Meeting Date: 18.03.2008


Meeting Time Start: 2:30PM
Meeting Time Finish: About 3PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------

Wrote Action plan: Each members of group were given task to do.
Do practical example; using our chosen algorithm.
-----------------------------------------------------------------------------------------------------

Meeting Date: 02.04.2008


Meeting Time Start: 2:00PM
Meeting Time Finish: About 4PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------
We compared examples, which we set for previous week.

Alice, Eliyas, Sulma, Sara, Yogesh page no:43 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

-------------------------------------------------------------------------------------------------------
Meeting Date: 16.04.2008
Meeting Time Start: 2:00PM
Meeting Time Finish: About 5PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------
We worked on an example,
1) “ Kryptos Meeting is after the lecture”
2) Early Greek mathematics deal with the problems of Primes and divisibility.
3) The theory of numbers is one of the oldest areas of mathematics dating back several
thousand years. we used Vigenère and ASCII 7-bit binary sequences to encrypt above 3
plaintext.

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

Meeting Date: 20.04.2008


Meeting Time Start: 1:00PM
Meeting Time Finish: About 4PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------
We found Earlier algorithms was not secure and it was very weak, hence we decided to use
ASCII + RSA Algorithms. Thus new algorithm consist of ASCII 7-bit binary sequences and
RSA algorithm.

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

Meeting Date: 23.04.2008


Meeting Time Start: 2:00PM
Meeting Time Finish: About 4PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------
We practiced three new example, using our new algorithms. ASCII+ RSA Algorithms. We
Encrypt 1st and 2nd plaintext
1) INFORMATION
2) CHINESE REMAINDER THEOREM
3) SEND ME THE DECRYPTION ALGORITHM
Sara, Eliyas and Sulma did “CHINES REMAINDER THEOREM”
Alice and Yogesh did “INFORMATION”

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

Meeting Date: 27.04.2008


Meeting Time Start: 1:00PM

Alice, Eliyas, Sulma, Sara, Yogesh page no:44 out of 45


Cryptography and Numbers Theory Group Coursework Date:30/04/20008

Meeting Time Finish: About 5PM


Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------

We practiced three new example, using our new algorithms. ASCII+ RSA Algorithms. We
Decrypt 1st and 2nd Plaintext.
1) INFORMATION
2) CHINESE REMAINDER THEOREM
Sara, Eliyas and Sulma did “CHINES REMAINDER THEOREM”
Alice and Yogesh did “INFORMATION”

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

Meeting Date: 30.04.2008


Meeting Time Start: 2:00PM
Meeting Time Finish: About 6PM
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------

Sara, Eliyas and Sulma did 3)“ SEND ME THE DECRYPTION ALGORITHM they did
encryption, when they complete Alice and Yogesh did Decryption.
-----------------------------------------------------------------------------------------------------

Meeting Date: 01.05.2008


Meeting Time Start: 10:00am
Meeting Time Finish: About 2 pm
Attended Persons: Alice, Eliyes, Sara, Sulma , Yogesh

AGENDA
--------
We structured our work and combined all the work in one file. and Ready to submit, we
also singed Group coursework template.

Alice, Eliyas, Sulma, Sara, Yogesh page no:45 out of 45

Anda mungkin juga menyukai