Grégory Paul - Mappy
Google préfère un site en HTTPS.
Sans HTTPS, Firefox et Chrome (50) bloquent certaines API JavaScript :
fullscreen
,
geolocation
,
service worker
,
device motion / orientation
,
getUserMedia
,
encrypted Media Extensions
, ...
Apple force HTTPS avec AppTransportSecurity depuis iOS 9.0 et OS X v10.11.
$ echo -n "Hello World" | sha1sum
0a4d55a8d778e5022fab701977c5d840bbc486d0
$ echo -n "Hello World." | sha1sum
b701146cf2c1262a6385c8b1fb1db98f05820499
$ sha1sum ubuntu-12.04.3-desktop-amd64.iso
0c06d876dabb4403cede1245e3b0bf1d81afd497
MD5, SHA-1, SHA-2 (SHA-224, SHA-256, SHA-384 et SHA-512), SHA3.
Influencé par une clé
echo -n "Hello World" | openssl dgst -sha1 -hmac "key"
cc24f1acdb06cf429bcf9861b6d708b6ec20a8fa
Permet de vérifier l’intégrité des données.
HMAC_MD5, HMAC_SHA1, HMAC_SHA256.
ms = PRF(client.preMasterSecret, client.random, server.random)
// ms = masterSecret
[ clientCipherKey, serverCipherKey ] = extractCipherKeys(ms)
[ clientHMACKey, serverHMACKey ] = extractHMACKeys(ms)
encrypt(request, clientCipherKey, clientHMACKey) // client
decrypt(request, clientCipherKey, clientHMACKey) // server
encrypt(response, serverCipherKey, serverHMACKey) // server
decrypt(response, serverCipherKey, serverHMACKey) // client
Échange de clé, authentication (asymétrique), chiffrement (symétrique), MAC/HMAC
$ openssl x509 -in GandiStandardSSLCA2.pem -inform pem -noout -text
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 05:e4:dc:3b:94:38:ab:3b:85:97:cb:a6:a1:98:50:e3
Signature Algorithm: sha384WithRSAEncryption
Issuer: C=US, ST=New Jersey, L=Jersey City, O=The USERTRUST Network, CN=USERTrust RSA Certification Authority
Validity Not Before: Sep 12 00:00:00 2014 GMT Not After : Sep 11 23:59:59 2024 GMT
Subject: C=FR, ST=Paris, L=Paris, O=Gandi, CN=Gandi Standard SSL CA 2
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus: 00:94:04:2d:a6:79:95:74:ff:d5:00:3c:f5:ae:d8:...
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Authority Key Identifier:
keyid:53:79:BF:5A:AA:2B:4A:CF:54:80:E1:D8:9B:C0:9D:F2:B2:03:66:CB
X509v3 Subject Key Identifier:
B3:90:A7:D8:C9:AF:4E:CD:61:3C:9F:7C:AD:5D:7F:41:FD:69:30:EA
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE, pathlen:0
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Certificate Policies:
Policy: 1.3.6.1.4.1.6449.1.2.2.26
Policy: 2.23.140.1.2.1
X509v3 CRL Distribution Points:
Full Name: URI:http://crl.usertrust.com/USERTrustRSACertificationAuthority.crl
Authority Information Access:
CA Issuers - URI:http://crt.usertrust.com/USERTrustRSAAddTrustCA.crt
OCSP - URI:http://ocsp.usertrust.com
Signature Algorithm: sha384WithRSAEncryption
58:67:fd:72:b2:6a:d7:7c:61:96:19:7e:d9:43:46:d1:26:7d:...
Autorité de certification + Protocole ACME + Agent OSS = Certificat DV à jour
filtre les domaines (Safe Browsing API) et soumission dans Certificate Transparency
type | algo | crack | et aujourd’hui ? |
---|---|---|---|
RSA 512 | 1999 | entre 7 heures et 2,5 jours via EC2 | |
RSA 768 | 2009 | ||
RSA 1024 | 1 an via Conficker (9~15M PC, 100 000 $ à la clé) | ||
RSA 2048 | 232 plus (200 000 $ à la clé) | ||
DES 56 | 1997 | < 24 heures | |
AES 128 | (2304 bits) | avec 1 000 000 000 PC, 660 x l’age de l’univers | |
AES 256 | 8 octodecillion $ (ou 1044 le PIB mondial) |
<img>
, <audio>
, <video>
<script>
, <link>
, <iframe>
, <object>
, XMLHttpRequest
, propriétés CSS
Strict-Transport-Security: max-age=16070400; includeSubDomains
https://
(même si l’utilisateur tape http://
ou si les liens pointent vers http://
),
example.com. IN CAA 0 issue "letsencrypt.org"
example.com. IN CAA 0 iodef "mailto:[email protected]"
example.com. IN CAA 128 future "digicert.com"
<script src="https://example.com/jquery.js"
integrity="sha384-oqVuAfX542FR..."><script>
Content-Security-Policy:default-src 'none';
script-src 'self'; style-src 'self';
upgrade-insecure-requests; block-all-mixed-content;
report-uri
(il existe des générateurs de CSP)
Feature-Policy: vibrate 'none'; speaker *;
geolocation 'self' https://example.com
geolocation
,
midi
,
notifications
,
push
,
vr
,
usb
,
sync-xhr
,
microphone
,
camera
,
magnetometer
,
gyroscope
,
speaker
,
vibrate
,
fullscreen
,
payment
,
...
),
iframe
,
Pour tester le nombre de "poignées de main/seconde" :
$ openssl speed rsa
Sur ce Thinkpad t440s (fin 2013 - Intel Core i7-4600U @ 2.10GHz) :
sign verify sign/s verify/s
rsa 512 bits 0.000051s 0.000005s 19514.8 220139.1
rsa 1024 bits 0.000193s 0.000013s 5182.2 79873.9
rsa 2048 bits 0.001312s 0.000040s 762.3 25034.3
rsa 4096 bits 0.009250s 0.000145s 108.1 6889.3
Facteur 7 entre 1024 et 2048, 2048 et 4096
TLSA
,
export RSA
),
DHE
en DHE_EXPORT
(512 bits),
ECDHE
.
Public-Key-Pins: pin-sha256=""; pin-sha256=""; max-age=259200
Public-Key-Pins-Report-Only: report-uri