Docsity

Data Protection - Biomedical Data Protection, Appunti di Ingegneria Biomedica

Toggle sidebar
bg1
BIOMEDICAL DATA PROTECTION
Personal data
They are divided into general personal data , that are much connected with the privacy and special
or sensitive data. The special data are more delicate, since they can cause discrimination. Based on
this data we can identify a person, but we can also discriminate the person, so they need to be
protected. Almost of personal data are special one.
General Data Protection Regulation (GDPR)
This is the most important regulation, it was approved by EU Parliament on 14 April 2016 and
enforced on 2018. It makes privacy laws homogenous in Europe :
- Protect and empower EU citizens data privacy
- Reshape the way organizations of the region approach data privacy
GDPR guarantee rights to the patient such as:
- Right to information
- Right of access
- Right of rectification
- Right to object
- Right to be forgotten
- Right to data portability
The article 5 of GDPR shows the principles relating to processing of personal data:
Personal data shall be processed lawfully, fairly and in a transparent manner in relation to the data
subject.
They must be collected for specified, explicit and legitimate purposes.
The article 9 of GDPR shows the processing of special categories of personal data.
Processing of personal data that provides discriminations shall be prohibited: Processing of
personal data revealing racial or ethnic origin, political opinions, religious or philosophical beliefs,
data concerning a natural person’s sex life or sexual orientation shall be prohibited, unless the data
subject has given explicit consent to process those personal data.
The article 32 of GDPR: security of processing
We need to estimate the risks to the freedom and rights for the people. Based on the risks we
need to take protections for data collected. The protections are pseudonymization and encryption of
personal data. It is necessary to guarantee the confidentiality, integrity, availability and resilience of
processing systems and services. And is important the ability to restore the availability and access to
personal data in the event of some incident.
Data protection in GDPR covers:
- Confidentiality: the state of keeping secret or private
- Integrity: internal consistency (coerenza interna) or lack of corruption in electronic data
- Availability: the quality of being able to be used or obtained.
These three are called CIE.
GDPR ACTORS:
1- European Data Protection Board: the board is composed of the head (capo) of one
supervisory authority of each member State and of the European Data Protection
Supervisor. It has the role of reviewing what is working and what is not working and also of
giving guidance. The board has a president and there are consultations between the
European Union Commission and the Board.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50

Anteprima parziale del testo

Scarica Data Protection - Biomedical Data Protection e più Appunti in PDF di Ingegneria Biomedica solo su Docsity!

BIOMEDICAL DATA PROTECTION

Personal data

They are divided into general personal data , that are much connected with the privacy and special

or sensitive data. The special data are more delicate, since they can cause discrimination. Based on

this data we can identify a person, but we can also discriminate the person, so they need to be

protected. Almost of personal data are special one.

General Data Protection Regulation ( GDPR )

This is the most important regulation, it was approved by EU Parliament on 14 April 2016 and

enforced on 2018. It makes privacy laws homogenous in Europe :

  • Protect and empower EU citizens data privacy
  • Reshape the way organizations of the region approach data privacy

GDPR guarantee rights to the patient such as:

  • Right to information
  • Right of access
  • Right of rectification
  • Right to object
  • Right to be forgotten
  • Right to data portability

The article 5 of GDPR shows the principles relating to processing of personal data:

Personal data shall be processed lawfully, fairly and in a transparent manner in relation to the data

subject.

They must be collected for specified, explicit and legitimate purposes.

The article 9 of GDPR shows the processing of special categories of personal data.

Processing of personal data that provides discriminations shall be prohibited: Processing of

personal data revealing racial or ethnic origin, political opinions, religious or philosophical beliefs,

data concerning a natural person’s sex life or sexual orientation shall be prohibited, unless the data

subject has given explicit consent to process those personal data.

The article 32 of GDPR: security of processing

We need to estimate the risks to the freedom and rights for the people. Based on the risks we

need to take protections for data collected. The protections are pseudonymization and encryption of

personal data. It is necessary to guarantee the confidentiality, integrity, availability and resilience of

processing systems and services. And is important the ability to restore the availability and access to

personal data in the event of some incident.

Data protection in GDPR covers:

  • Confidentiality: the state of keeping secret or private
  • Integrity: internal consistency (coerenza interna) or lack of corruption in electronic data
  • Availability: the quality of being able to be used or obtained.

These three are called CIE.

GDPR ACTORS:

1 - European Data Protection Board: the board is composed of the head (capo) of one

supervisory authority of each member State and of the European Data Protection

Supervisor. It has the role of reviewing what is working and what is not working and also of

giving guidance. The board has a president and there are consultations between the

European Union Commission and the Board.

2 - Supervisory authority is an independent public authority established by any Member State to

enforce legislation locally. It is responsible for imposing and managing administration fines

(multe) to controllers and processors. It must coordinate with other Supervisory authorities

when there are multiple actors in more than one member state.

3 - Data processor (organizations) is a natural or legal person, public authority or other body

which processes personal data on behalf of the controller (per conto del controller). The

processors don’t determine the purpose or means of the processing. They just process the

data as requested by the controller.

This also occurs when data processing is outsourced by the controller and data is processed

by a third party. Under the previous directive, it was only the data controller that would be

fined (punito/multato) in case of non-compliance; under the new legislation, the processor is

also liable (responsabile).

4 - Data controller (organizations): it defines what personal data the company needs and for

what purposes. The data controller is responsible for compliance with the regulation. Under

the new law, the controller must be able to demonstrate compliance at any time following a

request from the SA or the Data Subject.

5 - Data subject (individuals) is a natural person, a living human being

6 - Third counties/ international organizations

7 - Third parties

GDPR – KEY ELEMENTS

  • Breach notification (notifica di violazione): it is mandatory for any data breach that can

lead to risks for the rights and freedoms of individuals. It must be done within 72 hours after

discovering the breach. The data processors must notify data controllers without delay after

first becoming aware of a data breach.

  • Right to access (diritto di accesso): obtain from the data controller confirmation if citizen’s

personal data are being processed or not, where and for what purpose. The controller should

provide a copy of the personal data in an electronic format.

  • Right to be forgotten: (oblio dei dati): the subject can request the data controller to

erase/delete his personal data, stop further dissemination of the data.

  • Data portability: the subject has the right to receive his personal data in a commonly use and

machine readable format and has the right to transmit that data to another controller.

Attack strategy: it infects obsolete software. For example the PAC system, which then becomes the

central point of the attack. From this point the attack is much easier because it is inside the network.

It performs a lateral movement and infects weak devices. Then opens a backdoor in the corporate

network.

Personal data are sold for money in the black market.

VULNERABILITIES

The attacker attacks the systems and devices through the vulnerabilities, which depend on:

  • Organization aspects: we need in our company a specific internal organization for the data,

with separated permissions for the staff.

  • Human factors: people working with data need to be prepared, to know the system that are

using.

  • Technical aspects: hardware and software are important to prevent the attacks.

The solution is the perfect cybersecurity but is impossible to reduce the risks to zero, so we must

accept same risk.

CYBERSECURITY TOOLKIT includes:

  • Standards, regulations (GDPR, ISO)
  • Data protection technique and protocols based on cryptography. We could have data at rest

(rest in the computer), data in transit (when the data are sent to other computers, transmitted

over the network) and data in news (more vulnerable). When the data are at rest we can use

the cryptography.

  • Network security techniques based on intrusion prevention (strong system) and detection

(alarm system)

  • Secure software design
  • Analysis and control techniques such as vulnerability assessment and penetration testing

to simulate the attack. This is possible for ethical hacker who work for companies and

institutions.

REGULATIONS for Italian Healthcare Facilities:

  • Mandatory: there are three regulations regulated by GDPR. NIS2 is very different from

GDPR, because in GDPR we care about personal data, instead NIS2 care about system and

network.

  • Optional:

“CIS controls” are useful because with it we can see the situation of the hospital and it is

faster to be applied.

ISO: is important to obtain the certification of the hospital, with increased reputation.

NIST: here there isn’t certification, we can do itself. The Italian version of this is released

and maintained by the CINI.

PRIVACY AND DATA PROTECTION

PERSONAL DATA

Data that identify or make identifiable a person and can provide details about his characteristics, his

lifestyle, his personal relationships, his health ecc…

Any information related to a natural person that can be used to directly or indirectly identify the

person.

Particularly important are:

  • Identity data : those that allow direct identification, such as personal data (picture or name)
  • Sensitive data : those that may reveal racial or ethnic origin, religious and philosophical

beliefs, political opinions, sex life ecc.. they can cause discrimination.

  • Judicial data : those that can reveal the existence of certain judicial orders in the criminal

records or the status of accused or suspected.

PREVIOUS PRIVACY REGULATIONS

“European union data protection directive” was adopted in 1998 by the EU to guarantee that

member states protected privacy rights when processing personal information; to prevent member

states from restricting the free flow of personal information within the EU.

The directive was not a law, but requires member states to enact laws encompassing its terms.

“Italian privacy code” is a law related to protection of personal data as a provision (disposizione)

of the Italian republic, enacted with Legislative Decree 30 june 2003. The first articles recognized

the absolute right of each individual on its own data. The purpose of the legislation was to prevent

that the processing of data is done without the consent of the person entitled.

For this purpose the Title II defined the rights of those concerned (interessati), the collection

modalities and data requirements, the obligations of those who collect, hold and process personal

data, the responsibilities and sanctions in case of damage.

CURRENT PRIVACY REGULATION

Now there is only one regulation for all the country, the General Data Protection Regulation

( GDPR ), regulation by which the European Parliament, the Council of the EU and the European

commission intend to unify data protection for all individuals within the European union. It is

enforced since 25 May 2018.

DATA PROTECTION OFFICER:

He is a person who usually works between legal and technical issues. He is between a lawer and

computer scientist.

Mandatory only for those controllers and processors whose core activities consist of processing

operations which requires regular and systematic monitoring of subjects on a large scale or of

special categories of data.

He must :

  • Be appointed on the basis of professional qualities and expert knowledge on data

protection law and practices.

  • Be a staff member or an external professional
  • Be provided with/ have appropriate resources to carry out their tasks
  • Report directly to the highest level of management
  • Not carry out any other tasks that could result in a conflict of interest.

PSEUDONYMIZATION and ANONYMIZATION

GDPR is only concerned with the processing of personal data related to a natural person that allows

the identification of an individual directly or indirectly.

If the data is anonymized so individuals can no longer be identified, GDPR doesn’t see it as

personal data anymore.

Pseudonymization : data management and de-identification procedure by which personally

identifiable information fields within a data record are replaced by one or more artificial identifiers,

or pseudonyms. So we replace the personal data with other data that can be related back to the

original data. Instead, in the anonymization the data are removed. With the pseudonyms we still

INTRODUCTION TO CRYPTOGRAPHY

Cryptography is in general a defensive technique from potential attacks, for single data, groups of

data and for all types of data.

1 - Cryptology: studies communication over insecure channels and its problems

2 - Cryptography: studies the design of secure systems

3 - Cryptoanalysis : studies techniques to ‘break’ cryptographic systems. (attack technique)

SCYTALE :

Is a very old example. It was an encryption tool used by the

Greeks and Spartans, in particular for military purposes, to

transmit secret messages.

The message was written on a strip of parchment wrapped around a stick , of a specific diameter.

The recipient, in possession of a stick of the same diameter, wrapped the strip around it. The letters

realigned correctly, revealing the original message.

So the two people that want to communicate know a common secret to do it, the diameter of the

stick. This secret is unknown to the attacker.

Alice and Bob are users that want to communicate. Eve is the third person who is trying to read to

message without permission. Eve stands for Evestropper who is a person try to listen other people

without permission, is a passive attacker , thus the message is only received to the attacker, the

attacker doesn’t transmit.

Alice and Bob make the message impossible to understand through the encryption. So the initial

message in clear (plaintext) has been transformed in cyphertext. Bob to read the message has to be

able to perform another operation, the decryption. We assume that they know the secret key, with

which is possible perform the two operations (encryption and decryption). So we have to guarantee

that Eve doesn’t know the secret key.

So we assume that Alice and Bob share the same secret key manually. We don’t care about the

secretive of the encryption algorithm, so the key is secret, but the message doesn’t need to be secret.

EVE’ goals:

  • Read one or more secret messages
  • Find the secret key and then read all secret messages
  • Alter the secret message
  • Impersonate ALICE

The first two are passive attacks, the last are active attacks because the attacker do something.

POSSIBLE ATTACKS

1 - Ciphertext only: Eve only knows the ciphertext

2 - Known plaintext: Eve knows the ciphertext and the corresponding plaintext

3 - Chosen plaintext: Eve has temporary access to the encryption machine. Es: Eve can use my

computer to send a message to herself with my encryption machine, in this way she can

decrypt any message because she knows the secret key.

4 - Chosen ciphertext: Eve has temporary access to the decryption machine

KERCHOFFS PRINCIPLE (1883)

The security of a cryptographic system cannot be based on the secrecy of the encryption/decryption

algorithm; conversely, it is based on the secrecy of the key.

SYMMETRIC CRYPTOGRAPHY

Everyone can see the ciphertext while the plaintext is secret. It is the oldest form of cryptography.

Today the best symmetric cryptosystem is DES (Data Encryption Standard ).

In this case we assume that they have the copy of the same key, shared manually before

communicating ( PSK-pre shared key ).

But the problem is that in real life there are a lot of internet connections with cryptography, how can

we share the secret key between us and Instagram for example? We need manually get the key from

Instagram , which is impossible. We cannot also transmit the key through the internet, because we

assume internet is insecure. Is exploited another type of cryptography, asymmetric cryptography.

Secret sharing over public channels

Example of the colors.

Alice and Bob know the yellow color, they then mix this colour with

a secret colour, obtaining two different mixtures, that are public. (the

mixture separation is assumed to be expensive). Then, they

exchange the mixtures and add their secret colours obtaining the

same result, because the mixture is the same.

The key could be the type of the colour and the quantity of the

colour needed to obtain the new colour.

Limitation: Alice and Bob didn’t decide the final brown colour.

Because the two choices are independent from each other, thus the

result is random. With this process we share the key and then we

can start the communication. The asymmetric encryption allow to

decide the secret message.

Alice, since the key is public. Bob uses the public key to encrypt the message.

Relation between the two keys: starting from the private key, we can always compute the public

key, but the inverse is impossible.

Process:

  • Alice generates randomly a private key, from it she computes the corresponding public key.
  • Bob looks the Alice’s public key and use it to encrypt the message and closes the box with

the public key.

  • Alice is the only one able to reopen the box with the private key and read the message in the

box.

So we don’t need to send the secret key to Bob. The key is travelling is public.

DIGITAL SIGNATURES

We have a message, and Bob uses his

private key to generate the digital

signature for the message. So we have

the message and one string generated

by Bob. Then, using the public key of

Bob, we can verify the digital

signature of Bob through the

verification algorithm. If p transmitted

from the private key is equal to p

obtained from the public one, S is

generated by Bob only.

Here we don’t have confidentiality,

because anyone can use the public key

to re-obtain the message. We don’t

want to hide the message; we want to certify the message. So, we have no confidentiality, but we

have another feature that is called authentication.

SYMMETRIC VS ASYMMETRIC CRYPTOGRAPHY

  • Public-key algorithms (asymm.) typically require a much greater computational load than

private-key algorithms

  • Public-key algorithms are not used for the encryption of large amounts of data
  • Public-key algorithms are used for digital signatures and for exchanging session keys that

are then used by private-key algorithms.

We could have different situations:

b- In the second case we don’t have

authentication because the public key

is public so anyone could encrypt the

message.

c- Here we don’t have confidentiality

because anyone can decrypt the

message with the public key.

d- Both Alice and Bob generate two

keys, private and public.

TRAPDOOR (function)

It is like a door with the trap, which is easily to open in one direction and impossible to open in the

other direction. There are only some people that knows same secrets to open the door in both

directions. In order to create an asymmetric crypto system we need mathematical trapdoor, that is

a function.

Everybody can compute the direct function. Only those who know some secret can compute the

inverse function.

ONE-WAY FUNCTION- Hash functions

It is a family of important functions in cryptography. Everybody

can compute the direct function, but nobody can compute the

inverse function. Hash function is exactly a digital mixture, we

put digital data, and we will obtain digital string. In the hash

functions the output has fixed length.

Stream and block ciphers

  • Stream ciphers : the data are divided into fragments consisting of a single bit or a single

character and processed one at a time.

  • Block ciphers : the input bits are collected in a block and processed all together by the

algorithm, providing another block as its output.

Asymmetric cryptosystems work on blocks.

Codes vs ciphers

  • In a code, words or combinations of symbols are replaced with codewords. Codes don’t

allow the use of unexpected words.

  • A cipher doesn’t consider the linguistic structures of the message. A cipher encrypts every

meaningful or not string with some algorithm.

Alphabets : when we deal with digital data we deal with final data. We have the alphabets to write a

message, we could have:

Latin alphabet - > 26 letters, so there are 26

strings formed by x characters.

CLASSICAL CRYPTOSYSTEMS

Conventions:

Plaintext written in small letters, the ciphertext written in capital letters. A number is assigned to

each letter of the alphabet. Spaces and punctuation are omitted.

TRANSPOSITIONS AND PERMUTATIONS

A transformation that changes the order of two elements of a set and fixes all the others is called

transposition.

Any one-to-one transformation of a set of ordered elements onto itself is called a permutation of

elements of the set.

Every permutation of ordered elements can be expressed as a sequence of transpositions.

If I want to encrypt a message, transposition is optimal. We apply more than one transposition, in

which we don’t change the letters but only their positions.

TRANSPOSITION CIPHERS

The scytale is an example of a transposition cipher: the letters of the message are written in columns

instead of rows.

In general, a transposition cipher makes an anagram of the plaintext. The number of possible

anagrams become very high, if we have 30 letters, we will have 30! anagrams.

Transpositions can only be performed according to a prefixed order, and this makes the system

vulnerable, even for the need to use practical secret keys. If X is the length, the key space should be

X!.

SUBSTITUTION CIPHERS

In substitution ciphers each character is substituted by a different character.

The substitution rule is determined by the secret key.

Polybius Cipher is a substitution cipher with characters being substituted by pairs of digits. It

exploits the Polybius square for performing substitutions. In Polybius square we replace the

message with numbers.

MODULAR ARITHMETIC (clock arithmetic)

It is a mathematical tool useful when dealing with data in mathematical presentation. Is the

algorithm used in our clock, we have a loop , in this arithmetic the numbers stop for increasing and

the given point start over again.

All the numbers that are along the same line are collected and we consider one of them. In our clock

the modulo is 12, but we can change the modulo.

SHIFT CIPHERS( Caesar cipher)

It is another type of operation performed on the value of the letters , so the value is altered. If we

have a message, in shift ciphers we shift the letters in the alphabet.

Considering the alphabet equal to a clock with modulo 26, each letter is shifted forward by k

positions in the alphabet.

General rule: choose an integer number k: 0 ≤ 𝑘 ≤ 25 as secret key.

Encryption: 𝑥 → 𝑥 + 𝑘(𝑚𝑜𝑑 26 )

Decryption: 𝑥 → 𝑥 − 𝑘(𝑚𝑜𝑑 26 )

This crypto system is not secure because by looking the ciphertext we can get some information

about the plaintext, that is the length.

Attacks on the shift cipher:

  • Only ciphertext, best strategy is the exhaustive search. If the message cannot be reduced to

a few letters, it is unlikely that there is more than one message with meaning that may be the

plaintext. If the message is long enough, another possible attack is to count the frequency

of various letters. For example, the letter “e” is the most frequent in most English texts.

Comparing the frequency of letters in the plaintext and in the ciphertext, we can try to find

the key. So, the Caesar cipher is not secure.

Frequency analysis is a technique introduced by Al Kindi.

  • Known plaintext: if you know one plaintext letter with the corresponding ciphertext letter,

then the secret key is easily found. If we know that T (19) is encrypted in D (3), the key is

k= 3-19= - 16 =10 (mod 26)

  • Chosen-plaintext: choose the letter A as plaintext, then the ciphertext just provides the secret

key. If the ciphertext is H, the key is k=7.

  • Chosen-ciphertext: choose the letter A as ciphertext, then the plaintext is the opposite of the

secret key.

MONO-ALPHABETIC CIPHERS

Many classical ciphers are mono-alphabetic, meaning that they use a fixed mapping between each

letter of the plaintext and the corresponding letter of the ciphertext. So we apply the same key for

all the letters.

VIGENÈRE CIPHER- polyalphabetic cipher

We choose the length of the key (ex. 6) and choose a vector of this length whose components are

integers between 0 and 25. The key may be a word easy to remember. The security of the system

depends on the fact that both the key and its length are secret.

In Caesar cipher the same secret key is applied to all the letters, here instead, the key changes for

different letters. To don’t make the secret key too long, the same secret keys are used again.

Attacks on the Vigenère cipher:

  • Known plaintext: if we know enough characters, the key is simply obtained by subtracting

the plaintext from the ciphertext (mod 26).

  • Chosen-plaintext: choosing the plaintext we will get the key. This attack is not consider

because nobody invent or choose it.

  • Chosen-ciphertext: choose the letter A as ciphertext, then the plaintext is the opposite of the

secret key.

  • Only ciphertext: the most used attack is the frequency attack. The frequencies of the letters

are not equal, any letter has divergent frequency, and this is a feature that can be exploited

Vigenère and substitution ciphers don’t possess the properties of diffusion and confusion, and this

is the reason why they are vulnerable to frequency analysis.

PERFECT CIPHER (SHANNON 1949)

It is mathematically unbreakable. Its inviolability is not due to any limitation in the computing

capabilities of opponents.

  • The key is long as the plaintext
  • The key is generated randomly
  • Each key is used only once.

'

'

'

(𝑐𝑖𝑝ℎ𝑒𝑟𝑡𝑒𝑥𝑡) are bits, ⨁ denotes the XOR operator.

Encryption : 𝑐 '

'

'

Decryption : 𝑐 '

'

'

ONE-TIME PAD (G. Vernam, J. Mauborgne 1918)

It is robust because its security can be proved mathematically. The ciphertext has the same length

of the plaintext.

It is like Vigenère but here we have bits and the secret key is long as the plaintext and never re-used

and randomly generated.

INVIOLABILITY OF THE ONE-TIME PAD

Similarly to the binary version, it can be formulated with letters. The key is a random set of

characters between 0 and 25. Decryption uses the same key, but with opposite values.

  • Ciphertext-only attack: unsuccessful because the shifts of the letters are all equally probable

(the key is used only once and randomly generated)

  • Known-plaintext attack: if you have a piece of plaintext, you can find the corresponding

piece of the key, but nothing you can say about the rest of the key. Even if the attacker

knows a part of the secret key, it is not useful because there is not correlation between the

keys.

  • Chosen plaintext or chosen ciphertext attack: you can find key parts or even the entire key,

but the result is useless , since the key parts discovered will no longer be used.

The hard part to make this method practical is the key that has to be changed every time. So is very

costly make this method practical. A practical version of the OTP was used for the POTUS-PRIME

telephone line between Churchill and Roosevelt during World War II.

The key stream was stored on large shellac phonograph discs containing random noise.

The voice signal of the speaker was multiplied by that noise and transmitted across the ocean.

At the other end, the received signal was multiplied by the same noise, provided by an identical,

synchronized recording.

The noise is used for encryption and decryption, it is the secret key. For normal people it cannot be

used because it is too complicate.

PRACTICAL PROBLEMS OF THE PERFECT CIPHER

Alice and Bob must regenerate a new key each time a new message needs to be transmitted. So, a

huge number of key bits is needed, and they must be random. One time pad unfeasible for everyday

communications.

ELEMENTS OF NUMBER THEORY

In modern cryptosystems, messages are represented by numeric values before being encrypted 1 and

transmitted.

Encryption processes are mathematical operations that transform numeric input values into

numeric output values.

To build, analyze and attack these cryptosystems we need appropriate mathematical tools. They

fall within the area of number theory ; the number theory deals with the properties of integer

numbers.

DIVISIBILITY

Some numbers are nicer, the prime numbers. They are divisible only for one and for they self.

PRIME NUMBER THEOREM

If 𝜋(𝑥) is the number of primes less than or equal to x,

That is, the ratio

(

(

)

!

"#!

Large prime numbers (~100 digits) are used in many cryptographic systems (like RSA).

The number of primes of 100 digits can be estimated as:

FACTORIZATION OF COMPOSITE NUMBERS

A composite number is a non-prime integer n>1 that can be expressed as the product ab of two

integers, with a>1 , b Ex. 5 ∙ 5 ≡ 1 (𝑚𝑜𝑑 6 ) → 5 ≡

$

DIVISION

You can divide a number by 𝑎 (𝑚𝑜𝑑 𝑛) when GCD(a,n)=1. (are coprime )

Proposition : Let a, b, c, d, n be four integers with 𝑛 ≠ 0 and with GCD(a,n)=1.

If 𝑎𝑏 ≡ 𝑎𝑐

, then 𝑏 ≡ 𝑐 (𝑚𝑜𝑑 𝑛). In other words, if a and n are coprime, both members of

the congruence can be simplified by dividing by a.

Ex. 2 𝑥 + 7 ≡ 3

Division by 2 is legitimate because GCD (2,17)=1.

Division by 5 is legitimate because GCD (5,11)=

Proposition : Let GCD(a,n)=1 and s and t are two integers such that 𝑎𝑠 + 𝑛𝑡 = 1 (they can be found

using the extended Euclidean algorithm). Then 𝑎𝑠 ≡ 1 (𝑚𝑜𝑑 𝑛), that is, s is the multiplicative

inverse of 𝒂 (𝒎𝒐𝒅 𝒏). So the extended Euclidean algorithm is efficient enough to compute the

multiplicative inverse of 𝑎.

Summary :

Computing 𝑎

,$

1 - With the extended Euclidean algorithm find s such that 𝑎𝑠 ≡ 1 (𝑚𝑜𝑑 𝑛)

,$

Solving the equation 𝑎𝑥 = 𝑐 (𝑚𝑜𝑑 𝑛)𝑤𝑖𝑡ℎ 𝐺𝐶𝐷(𝑎, 𝑛) = 1 :

1 - With the extended Euclidean algorithm find s such that 𝑎𝑠 ≡ 1

2 - The solution is 𝑥 = 𝑐 ∙ 𝑠 (𝑚𝑜𝑑 𝑛)

If we choose n to be a prime number we can always perform the division (because GCD (a,prime

number) =1). Any integer a such that 0 < 𝑎 < 𝑛 has a multiplicative inverse 𝑎

,$

(𝑚𝑜𝑑 𝑛), and we

say that 𝚭

𝒏

is a finite field/ring. It is a closed group in which we have addition and multiplication,

but we don’t have the multiplicative index.

FERMAT’S LITTLE THEOREM

If p is a prime that doesn’t divide a, then: 𝑎

.,$

Ex. P=11 and a=2. From the theorem it follows that:

$/

This equality can be useful to evaluate for example 2

In fact: ( 2

$/

0

0

It may be 2

1 ,$

≡ 1 (𝑚𝑜𝑑 𝑛) for some values of n that are not primes but these are exceptions.

Applications :

If 2

1 ,$

≢ 1 (𝑚𝑜𝑑 𝑛) then n cannot be a prime number. So it helps searching for prime numbers.

We choose a starting value 𝑛 /

and the test is repeated for each odd number 𝑛 ≥ 𝑛

/

to see if

1 ,$

If n fails the test, we move on to the next value. If n passes the test, more sophisticated techniques

are employed for testing primality.

The procedure is much faster than trying to factor out each n.

EULER’S TOTIENT FUNCTION (𝜑)

It is a generalization of Fermat, it provides the number of integers 1 ≤ 𝑎 ≤ 𝑛 such that

GCD(a,n)=1.

Ex. 𝑛 = 10 → 𝜑

If p is a prime and 𝑛 = 𝑝

2

2

= i 1 −

$

.

j 𝑝

2

In particular if p is prime 𝜑

= (𝑝 − 1 ) all the numbers are coprime.

In general, for every integer n: 𝜑(𝑛) = 𝑛 ∏ ( 1 −

$

.

.| 1

. ex. 𝜑(𝑛 = 6 ) = 6 ∙ i 1 −

$

&

j ∙ i 1 −

$

0

j = 2

If n is the product of two prime numbers p and q (n=pq), 𝜑

EULER’S THEOREM

If 𝐺𝐶𝐷(𝑎, 𝑛) = 1 → 𝑎

4 ( 1 )

If n=p is a prime , being 𝜑(𝑝) = (𝑝 − 1 ), Euler’s theorem reduces to Fermat’ s theorem

FOUNDAMENTAL PRINCIPLE

Given the integers a,n,x and y with n≥ 1 and GCD(a,n)=1, if 𝑥 ≡ 𝑦 (𝑚𝑜𝑑 𝜑(𝑛)) then

5

Dim : let us write 𝑥 = 𝑦 + 𝜑(𝑛)𝑘, then 𝑎

564 ( 1 ) 7

5

4 ( 1 )

7

5

5

(mod n)

Having used Euler’s theorem.

In practice, the principle states that, if you want to work mod n on powers, then you have to work

mod 𝜑

on exponents.

Ex. GCD(a,n)=

𝑥 ≡ 𝑦 m𝑚𝑜𝑑 𝜑(𝑛)n ↔ 𝑎

5