The German mathematician C. F. Gauss introduced the concept of congruence in the first chapter of his work “Disquisitiones Arithmeticae”, published in 1801. This concept is fundamental in the coding and decoding of keys in the RSA system. The public key cryptosystem, called RSA, was developed by scientists R. Rivest, A. Shamir and L. Adleman.

To encode a text according to the RSA system you need:

(1) a large number ** N**which is the product of two distinct prime numbers

**and**

*P***, that is,**

*what***=**

*N***۰**

*P***.**

*what*(2) an integer ** AND**, known as a coding key, which satisfies the following properties:

the maximum common divider (MDC) between ** AND** and the product (

**- 1)۰(**

*P***-1) is 1, and the MDC**

*what* in between ** AND **and

**is also 1.**

*N*To decode a text, according to the RSA system, you need:

(3) an integer ** D**, known as a decryption key, which satisfies the condition:

** AND**۰

**≡ 1 (mod (**

*D***-1)۰(**

*P***- 1)).**

*what* The relationship between ** AND **and

**is symmetrical, that is, if**

*D***is the decryption key for**

*D***, then**

*AND***is the decryption key for**

*AND***.**

*D* In the previous column we coded the message **PUBLIC KEY** using the RSA system with

** N **= 2.537 = 43•59,

**= 43,**

*P***= 59 and with the encryption key**

*what***= 13.**

*AND* First, we observed that ** N **= 2.537 has 4 digits and so we break the text into pairs of letters:

**PU BL IC KE Y**and complete the last block with the letter C getting:

**PU BL IC KE YC**.

Using the conversion table that associates natural numbers with letters of the alphabet, the converted blocks of the message are:** 1520 0111 0802 1004 2402**. This way, the receiver will receive the encrypted message:** 0095 1648 1410 1299 0811**.

Our goal is to take the necessary steps to decode this message according to the RSA cryptosystem. To decrypt this message we need the public key ** D** of decoding.

Is there a method for determining ** D**if

**,**

*AND***and**

*P***They are known. However, if**

*what***and**

*P***are not known,**

*what***cannot be determined. The security of the RSA cryptosystem lies in this fact.**

*D* If ** P **and

**are extremely large for example larger than 10**

*what*^{200}then determine these prime numbers in a reasonable time, which is equivalent to factoring

**=**

*N***۰**

*P***,may be beyond the capacity of the fastest supercomputers.**

*what* Our goal is to determine ** D**such that

**۰**

*AND***≡ 1 (mod (**

*D***- 1)۰(**

*P***- 1)), in other words**

*what***is the inverse of**

*D***module (**

*AND***- 1)۰(**

*P***- 1).**

*what* The method consists of using Euclid's algorithm applied to the key ** AND** coding and number (

**- 1)۰(**

*P***- 1). How**

*what***and (**

*AND***- 1)۰(**

*P***- 1) are prime to each other, the MDC among them is 1. First, we go through all the steps of Euclid's Algorithm to determine the MDC which in this case is 1.**

*what*By the Euclidean Algorithm we have to

(** P** - 1)۰(

**- 1) =**

*what*

*what*_{1}۰

**+**

*AND*

*r*_{2}, 0 ≤

*r*_{2}<

**.**

*AND* How do we know that MDC ((** P** - 1)۰(

**- 1),**

*what***) = 1, we continue applying the Euclidean Algorithm until we get the remainder of the division equal to 1. Therefore, we perform the division of**

*AND***per**

*AND***and so on until we get the rest of 1:**

*r*_{2}* AND* =

*what*_{2}۰

*r*_{2 }+

*r*_{3, }

**0 ≤**

*r*_{3}<

*r*_{2}

*r*_{2} = *what*_{3}۰** r**

_{3}+

*r*_{4},0 ≤

*r*_{4}<

*r*_{3}

…

*r*_{n-4} = *what*_{n-3}۰** r**

_{n-3 }+

*r*_{n-2},0 ≤

*r*_{n-2}<

*r*_{n-3}

*r*_{n-3} = *what*_{n-2}۰** r**

_{n-2 }+

*r*_{n-1},0 ≤

*r*_{n-1}<

*r*_{n-2}

*r*_{n-2} = *what*_{n-1}۰** r**

_{n-1 }+ 1,0 ≤ 1<

*r*_{n-1}.

Now using the Euclidean algorithm in reverse we can calculate ** D** such that

** AND**۰

**≡ 1 (mod (**

*D***-1)۰(**

*P***- 1)).**

*what* Therefore, ** D** It is the decryption key.

Note that:

<>

1 = *r*_{n-2} - *what*_{n-1}۰**<>**

*r*_{<>}

n-1<>

(1)

*<>*

* r*_{<>}

n-1<>

=* r*_{n-3} - *what*_{n-2}۰**<>**

*r*_{<>}

n-2<>

(2)

*<>*

* r*_{<>}

n-2 <>

=* r*_{n-4} - *what*_{n-3}۰**<>**

*r*_{<>}

n-3<>

(3)

…

*r*_{4 } = _{}r_{2}-_{}what_{3}۰** r**

_{3}

**(**

*no*- 3)

* r*_{3}= ** AND** -

*what*_{2}۰

*r*_{2, }(

*no*- 2)

* r*_{2} = (** P** - 1)۰(

**- 1) -**

*what*

*what*_{1}

**(**

*AND**no*- 1)

Overriding the value of *r*_{n-1} from (2) to (1) we get

1 = (1 + *what*_{n-1}۰*what*_{n-2})۰*r*_{n-2 }- *what*_{n-1}۰*r*_{n-3}

and substituting in this equality the value of* r*_{n-2 }from (3) we get

*r*_{no} = - (*what*_{n-3 }+ *what*_{n-1}۰*what*_{n-2}۰*what*_{n-3} + *what*_{n-1})۰*r*_{n-3} + (1 + *what*_{n-1}۰*what*_{n-2})۰*r*_{n-4}.

So we proceed successively until we get the integer at the end ** D** such that

** AND**۰

**≡ 1 (mod (**

*D***-1)۰(**

*P***- 1)).**

*what*In our example we have:

** N **= 2.537 = 43۰59,

**= 43,**

*P***= 59 and (**

*what***- 1)۰(**

*P***- 1) = 42۰58 = 2,436 and**

*what***= 13.**

*AND* Using Euclid's Algorithm to determine the MDC between (** P** - 1)۰(

**- 1) = 2,436 and**

*what***= 13 we get:**

*AND*2.436 = 187۰13 + 5, 13 = 2۰5 + 3, 5 = 1۰3 + 2, 3 = 1۰2 + 1.

Now, using Euclid's Algorithm in reverse, we get:

1 = 3 - 1۰2, 2 = 5 - 1۰3, 3 = 13 - 2۰5, 5 = 2436 - 187۰13

Therefore, substituting as explained above, we have:

1 = 3 - 1۰2 = 3 - 1۰( 5 - 1۰3) = 3 - 1۰5 + 1۰3 = - 5 + 2۰3;

1 = - 5 + 2۰3 = - 5 + 2۰( 13 - 2۰5) = - 5 + 2۰13 - 4۰5 = 2۰13 - 5۰5;

1 = 2۰13 - 5۰5 = 2۰13 - 5۰( 2.436 - 187۰13) = 2۰13 - 5۰2.436 + 935.۰13 =

= 937۰13 - 5۰2.436.

Thus we get 1 = 937۰13 - 5۰2.436 which implies 937۰13 = 5۰2.436 +1.

Therefore, 13۰937 ≡ 1 (mod 2.436), ie ** AND**37937 ≡ 1 (mod (

**-1)۰(**

*P***- 1)).**

*what* We concluded that ** D** = 937.

In the next column we will decode the message.

Back to columns

<