• Aucun résultat trouvé

+HOFJCH=FDO BH AJMHI

N/A
N/A
Protected

Academic year: 2021

Partager "+HOFJCH=FDO BH AJMHI"

Copied!
57
0
0

Texte intégral

(1)

Cryptography for Networks

Pierre-Louis Cayrel

CASED [email protected]

Network Security (NetSec)

(2)

Crypto for Networks

6 half hours over two days (27/04/2011 and 28/04/2011)

Topics

intro to crypto and private key encryption

intro to public key crypto

signature scheme

certificates

authentication

pitfalls

(3)

Some references

Menezes A. J., Vanstone S. A. and Oorschot P. C. V., Handbook of Applied Cryptography,

Computer Sciences Applied Mathematics Engineering, CRC Press, Inc., 1st edition, 1996,

http://www.cacr.math.uwaterloo.ca/hac/

Schneier B.,

Applied Cryptography,

Vuibert, Wiley and International Thomson Publishing, NY, 2nd edition, 1997. http://www.schneier.com/book-applied.html

Stinson D.R,

Cryptography : Theory and Practice,

Chapman & Hall/CRC Press, 2nd edition, 2002.http:

//www.cacr.math.uwaterloo.ca/dstinson/CTAP2/CTAP2.html

Pr Buchmann’s lectures !

(4)

Part 1

(5)

Where do we use crypto ?(1)

Internet(confidentiality, anonymity, authentication)

(6)

Where do we use crypto ?(2)

eSignature(verifiable, authenticity, non-repudiation)

(7)

Where do we use crypto ?(3)

e-voting

(8)

Where do we use crypto ?(4)

Bank card payment

(9)

Where do we use crypto ?(5)

TV decoders

(10)

Where do we use crypto ?(6)

eCash

(11)

Where do we use crypto ?(7)

Secure data bases

(12)

Where do we use crypto ?(8)

underlies security features of many Red Hat products, including :

signed and encrypted email,

form signing,

object signing,

single sign-on,

and the Secure Sockets Layer (SSL) protocol.

this lecture introduces the basic concepts of cryptography (especially for the internet) : secret and public key crypto.

(13)

Internet Security Issues (already seen)

All communication over the Internet uses the :

Transmission Control Protocol/Internet Protocol (TCP/IP).

TCP/IP allows information to be sent from one computer to another through a variety of intermediate computers and separate networks before it reaches its destination.

The great flexibility of TCP/IP has led to its worldwide acceptance as the basic Internet and intranet communications protocol.

At the same time, the fact that TCP/IP allows information to pass through intermediate computers makes it possible for athird party to interfere with communications.

(14)

Internet Security Issues (already seen)

Eavesdropping.

Information remains intact, but its privacy is compromised.

For example,someone could learn your credit card number, record a sensitive conversation, or intercept classified information.

Tampering.

Information in transit is changed or replaced and then sent on to the recipient.

For example,someone could alter an order for goods or change a person’s resume.

(15)

Internet Security Issues (already seen)

Impersonation.

Information passes to a person who poses as the intended recipient.

Impersonation can take two forms :

Spoofing.A person can pretend to be someone else.

Misrepresentation.A person or organization can misrepresent itself.

(16)

Internet Security Issues (already seen)

Users of the many cooperating computers that make up the Internet don’t monitor or interfere with the network traffic that continuously passes through their machines.

However, many sensitive personal and business communications over the Internet require precautions that address the threats listed above.

Fortunately, a set of well-established techniques and standards known ascryptography make it relatively easy to take such precautions.

(17)

Internet Security Issues

Cryptography facilitates the following tasks :

Encryptionanddecryptionallow two communicating parties to disguise information they send to each other.

The sender encrypts, or scrambles, information before sending it.

The receiver decrypts, or unscrambles, the information after receiving it.

While in transit, the encrypted information is unintelligible to an intruder.

(18)

Internet Security Issues

Tamper detectionallows the recipient of information to verify that it has not been modified in transit.

Any attempt to modify data or substitute a false message for a legitimate one will be detected.

Authenticationallows the recipient of information to determine its origin-that is, to confirm the sender’s identity.

Non-repudiation prevents the sender of information from claiming at a later date that the information was never sent.

(19)

Encryption and Decryption

Encryptionis the process of transforming information so it is unintelligible to anyone but the intended recipient.

Decryptionis the process of transforming encrypted information so that it is intelligible again.

A cryptographic algorithm is a mathematical function used for encryption or decryption.

In most cases, two related functions are employed, one for encryption and the other for decryption.

(20)

Encryption and Decryption

The ability to keep encrypted information secret is based noton the cryptographic algorithm, which is widely known, but on a number called a keythat must be used with the algorithm to produce an encrypted result or to decrypt previously encrypted information.

Decryption with the correct key is simple.

Decryption without the correct key is very difficult, and in some cases impossible for all practical purposes.

(21)

Symmetric-Key Encryption

The encryption key can be calculated from the decryption key and vice versa.

The same key is used for both encryption and decryption, as :

(22)

Symmetric-Key Encryption

Implementations of symmetric-key encryption can be highly efficient, so that users do not experience any significant time delay as a result of the encryption and decryption.

Symmetric-key encryption also provides a degree ofauthentication, since information encrypted with one symmetric key cannot be decrypted with any other symmetric key.

As long as the key is kept secret by the two parties each party can be sure that it is communicating with the other as long as the decrypted messages continue to make sense.

(23)

Symmetric-Key Encryption

Symmetric-key encryption is effective only if the key is kept secret by the two parties involved.

If anyone else discovers the key, it affects bothconfidentialityand authentication.

A person with an unauthorized symmetric key not only can decrypt messages sent with that key, but can encrypt new messages and send them as if they came from one of the two parties who were originally using the key.

(24)

Symmetric-Key Encryption

Symmetric-key encryption plays an important role in the SSL protocol, which is widely used for authentication, tamper detection, and encryption over TCP/IP networks.

SSL also uses techniques of public-key encryption.

algorithms : DES/AES/A5-1/T-DES ...

(25)

One Time Pad

(26)

Symmetric-Key Encryption : Pros and Cons

very fast

easy to implement

perfect security (in an information theoretic sense)

need a secure exchange first

hard to do with several users

(27)

Part 2

(28)

Public-Key Encryption

The most commonly used implementations of public-key encryption are based on algorithms patented by RSA Data Security.

Public-key encryption (also calledasymmetric encryption) involvesa pair of keys– a public key and a private key – associated with an entity that needs to authenticate its identity electronically or to sign or encrypt data.

Each public key is published, and the corresponding private key is kept secret.

Data encrypted with your public key can be decrypted only with

(29)

The next figure shows a simplified view of the way public-key encryption works.

(30)

Public-Key Encryption

The scheme lets you freely distribute a public key, and only you will be able to read data encrypted using this key.

In general, to send encrypted data to someone, you encrypt the data with that person’s public key, and the person receiving the encrypted data decrypts it with the corresponding private key.

Compared with symmetric-key encryption, public-key encryption requires more computation and is therefore not always appropriate for large amounts of data.

However, it’s possible to use public-key encryption to send a symmetric key, which can then be used to encrypt additional data.

(31)

Public-Key Encryption : Pros and Cons

no key management

easy to do with several users

possible key exchange without secure channel

not very fast

not suited for high bandwith data streams

harder to implement

security not perfect (in an information theoretic sense)

(32)

Public-Key Encryption

As it happens, the reverse of the scheme also works : data encrypted with your private key can be decrypted only with your public key.

This would not be a desirable way to encrypt sensitive data, however, because it means that anyone with your public key, which is by definition published, could decrypt the data.

(33)

Public-Key Encryption

Nevertheless, public-key encryption is useful, because it means you can use your private key to sign data – an important requirement for electronic commerce and other commercial applications of

cryptography.

Client software can use your public key to confirm that the message was signed with your private key and that it hasn’t been tampered with since being signed.

(34)

Key Length and Encryption Strength

In general, the strength of encryption is related to the difficulty of discovering the key, which in turn depends on both the cipher used and the length of the key.

For example,the difficulty of discovering the key for the RSA cipher most commonly used for public-key encryption depends on the difficulty of factoring large numbers, a well-known mathematical problem.

(35)

Ronald Rivest, Adi Shamir and Leonard Adleman

(36)

R.S.A.

It is the most used public-key encryption scheme (Netscape, many banks, several websites).

RSA is based on computation in the groupℤ/nℤ, more precisely on modular exponentiation in this group.

(37)

R.S.A.

Alice wants to send a messageM to Bob.

M an integer who represents the message.

Bob choosespandqtwo prime numbers and denotentheir product.

Bob choosese an integer coprime withp−1 andq−1.

We have𝜑(n) = (p−1)(q−1) ande is coprime with𝜑(n).

We obtain (via Bezout) thateis invertible modulo𝜑(n),i.e. it exists an integer d such thated ≡1 (mod𝜑(n)).

The ciphertext is :

C=Me (mod n)

To decrypt C,we computed the inverse ofe mod𝜑(n),and then we computeCd modn.

(38)

R.S.A.

We have,

Cd (modn)≡(Me)d (mod n)≡Med (modn)

Like ed≡1 (mod 𝜑(n)) we have,

ed = 1 +k𝜑(n),with k ∈ℕ.

Then,

Med (modn)≡M⋅Mk𝜑(n) (modn)≡M⋅(M𝜑(n))k (modn)

Ifx is coprime withn; we havex𝜑(n)≡1 (mod n),using Euler theorem.

So finally, the message M is coprime withn:

(39)

Alice Bob M

choosesp andq e coprime withp−1 andq−1

computesn=p×q d such that ed ≡1 (mod 𝜑(n))

←− sends (n,e) to Alice computes C=Me (modn)

and sends it to Bob −→

computesCd (modn) and then deducesM

(40)

RSA : Example

Letp= 47 andq= 59.

We computen=p.q= 47.59 = 2773

We choose e, coprime with𝜙(n) . Ex :e= 17.

We compute,d such that d.e= 1 mod (p−1)(q−1),soit d = 157.

Public key : (e,n) = (17,2773) Private key :d = 157.

Encryption of the messageM = 01000010 = 66 : C=Me modn= 6617 mod 2773 = 872

Decryption of C :

(41)

Key Length and Encryption Strength

Encryption strength is often described in terms of the size of the keys used to perform the encryption : in general, longer keys provide stronger encryption.

Key length is measured in bits.

For example,128-bit keys for use with the RC4 symmetric-key cipher supported by SSL provide significantly better cryptographic

protection than 40-bit keys for use with the same cipher.

Roughly speaking, 128-bit RC4 encryption is 3×1026 times stronger than 40-bit RC4 encryption.

(42)

Key Length and Encryption Strength

Different ciphers may require different key lengths to achieve the same level of encryption strength.

The RSA cipher used for public-key encryption, for example, can use only a subset of all possible values for a key of a given length, due to the nature of the mathematical problem on which it is based.

Other ciphers, such as those used for symmetric key encryption, can use all possible values for a key of a given length, rather than a subset of those values.

(43)

Key Length and Encryption Strength

Thus a 128-bit key for use with a symmetric-key encryption cipher would provide stronger encryption than a 128-bit key for use with the RSA public-key encryption cipher.

This difference explains why the RSA public-key encryption cipher must use a 512-bit key (or longer) to be considered cryptographically strong, whereas symmetric key ciphers can achieve approximately the same level of strength with a 64-bit key.

Even this level of strength may be vulnerable to attacks in the near future.

(44)

Part 3

(45)

Digital Signatures

Encryption and decryption address the problem of eavesdropping, one of the three Internet security issues.

But encryption and decryption, by themselves, do not address the other two problems :tamperingandimpersonation.

(46)

Digital Signatures

This part describes how public-key cryptography addresses the problem oftampering.

The next part describes how it addresses the problem of impersonation.

(47)

Digital Signatures

Tamper detection and related authentication techniques rely on a mathematical function called a one-way hash (also called a message digest).

A one-way hash is a number of fixed length with the following characteristics :

The value of the hash is unique for the hashed data. Any change in the data, even deleting or altering a single character, results in a different value.

The content of the hashed data cannot, for all practical purposes, be deduced from the hash – which is why it is called ”one-way.”

(48)

Digital Signatures

As mentioned before, it’s possible to use your private key for encryption and your public key for decryption.

Although this is not desirable when you are encrypting sensitive information, it is a crucial part of digitally signing any data.

Instead of encrypting the data itself, the signing software creates a one-way hash of the data, then uses your private key to encrypt the hash.

The encrypted hash, along with other information, such as the hashing algorithm, is known as a digital signature.

(49)

Digital Signatures

The next figure shows a simplified view of the way a digital signature can be used to validate the integrity of signed data.

(50)

Digital Signatures

The previous figure shows two items transferred to the recipient of some signed data :

the original data

the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with the signer’s private key.

(51)

Digital Signatures

To validate the integrity of the data, the receiving software first uses the signer’s public key to decrypt the hash.

It then uses the same hashing algorithm that generated the original hash to generate a new one-way hash of the same data.

(Information about the hashing algorithm used is sent with the digital signature, although this isn’t shown in the figure.)

(52)

Digital Signatures

Finally, the receiving software compares the new hash against the original hash.

If the two hashes match, the data has not changed since it was signed.

If they don’t match, the data may have been tampered with since it was signed, or the signature may have been created with a private key that doesn’t correspond to the public key presented by the signer.

(53)

Digital Signatures

If the two hashes match, the recipient can be certain that the public key used to decrypt the digital signature corresponds to the private key used to create the digital signature.

Confirming the identity of the signer, however, also requires some way of confirming that the public key really belongs to a particular person or other entity.

(54)

Digital Signatures

The significance of a digital signature is comparable to the significance of a handwritten signature.

Once you have signed some data, it is difficult to deny doing so later-assuming that the private key has not been compromised or out of the owner’s control.

This quality of digital signatures provides a high degree of nonrepudiation-that is, digital signatures make it difficult for the signer to deny having signed the data.

(55)

RSA signature

Parameters generation :like the key generation for RSA

Alice chooses randomly two prime numbersp andq.

Alice computesn=p.qand𝜙(n) = (p−1)(q−1)

Alice chooses randomly an odd integer esuch that 1<e< 𝜙(n) andpgcd(e, 𝜙(n)) = 1

Alice computes the integerd such that e.d = 1 mod𝜙(n).

Public key : (n,e) Secret key : d

LetH be a one-way hash function.

(56)

RSA signature (2)

Signature generation

Alice wants to sign the documentM

Alice computes hM=H(M) (we assume 0≤hM<n)

Signature ofM :s(M) = (hM)d modn

The signed document is [M,s(M)].

(57)

RSA signature (3)

Signature verification

Bob receives a signed document [M,s(M)] from Alice.

This document may be altered

He knows Alice’s public key (n,e)

He computes hM =H(M)

He checks the relation : s(M)e =hM modn

We have :s(M)e= (hM)e.d modn=hM modn=hM and if the document is authentical we have : hM =hM.

The security of this scheme is the same as the one of the encryption scheme.

(this basic description is not secure but the important point here is the idea).

Références

Documents relatifs

We define sender-initiated file transfer for IP as a TCP service as follows: a receiver program (the server or &#34;daemon&#34;) listens on port 608 for inbound

* Is compatible with the file format produced by the current widely used gzip utility, in that conforming decompressors will be able to read data produced by the

The Packet by Packet context is cleared between Packets so that this History Buffer is not maintained across Packet boundaries. Packet Integrity

This document defines a HTTP response header field called Safe, which can be used to indicate that repeating a HTTP request is safe.. Such an indication will allow user agents

subarea1 cannot get its zone keys properly signed as its parent zone, region1, is not secured.. The colloquial phrase describing the collection of contiguous secured zones at

The transport layer effectively provides a container capability to mobility support services, as well as any required transport and security operations required to

Qualitatively different categories of descriptions concerning the meaning of evalua- ting technical solutions, performing a house hop and being able to act with presence

histoly- tica (zymodème XIX) et E. Les souches isolées des selles des deux porteurs montrèrent la pré - sence d'une bande dense pour ME, l'absence de bandes rapides pour HK et PGM,