SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
@jcsirot#WebCryptoAPI
De la cryptographie dans le
navigateur avec WebCrypto API
@jcsirot
Développeur & Responsable Qualité
Arkena
@YourTwitterHandle@YourTwitterHandle@jcsirot#WebCryptoAPI
Pourquoi une API Crypto ?
@jcsirot#WebCryptoAPI
Transport Layer Security
@jcsirot#WebCryptoAPI
Transport Layer Security
@jcsirot#WebCryptoAPI
Des bibliothèques...
• sjcl (https://crypto.stanford.edu/sjcl/)
• crypto-js (https://code.google.com/p/crypto-js/)
• forge (https://github.com/digitalbazaar/forge)
• digest.js (https://github.com/jcsirot/digest.js)
@jcsirot#WebCryptoAPI
... et des problèmes
@jcsirot#WebCryptoAPI
... et des problèmes
• Pas d’entier de 64 bits natifs, pas de big integer, pas de tableaux
performants
@jcsirot#WebCryptoAPI
... et des problèmes
• Pas d’entier de 64 bits natifs, pas de big integer, pas de tableaux
performants
• Impossibilité des «calculs longs» (thread unique)
@jcsirot#WebCryptoAPI
... et des problèmes
• Pas d’entier de 64 bits natifs, pas de big integer, pas de tableaux
performants
• Impossibilité des «calculs longs» (thread unique)
• Pas de générateur de nombres aléatoires de qualité (PRNG)
@jcsirot#WebCryptoAPI
... et des problèmes
• Pas d’entier de 64 bits natifs, pas de big integer, pas de tableaux
performants
• Impossibilité des «calculs longs» (thread unique)
• Pas de générateur de nombres aléatoires de qualité (PRNG)
• Sandbox
@jcsirot#WebCryptoAPI
Solutions ?
@jcsirot#WebCryptoAPI
Solutions ?
• Source d’aléa : https://random.org
@jcsirot#WebCryptoAPI
Solutions ?
• Source d’aléa : https://random.org
• Applet Java (intégration Java Javascript)
@jcsirot#WebCryptoAPI
Solutions ?
• Source d’aléa : https://random.org
• Applet Java (intégration Java Javascript)
WebCrypto API : http://www.w3.org/TR/WebCryptoAPI/
@jcsirot#WebCryptoAPI
var array = new Uint8Array(16);
window.crypto.getRandomValues(array);
Générateur aléatoire
• ArrayBufferView pour représenter les données
• Fonction synchrone, non bloquante
• Utilise une source d’aléa «sûre» du système
(par exemple /dev/urandom)
@jcsirot#WebCryptoAPI
window.crypto.subtle
• Interface avec les primitives cryptographiques : encrypt,
decrypt, sign, digest, generateKey...
• Données sont passées sous forme de ArrayBufferView
• Retourne une Promise javascript
@jcsirot#WebCryptoAPI
var data = toArrayBufferView("Hello World!");
var algorithm = {
name: "SHA-256"
};
window.crypto.subtle.digest(algorithm, data)
.then(function(result) {
console.log(result);
})
.catch(function(error) {
console.error(error);
});
Promise
@YourTwitterHandle@YourTwitterHandle@jcsirot#WebCryptoAPI
Démo
@jcsirot#WebCryptoAPI
Can I use ?
http://caniuse.com/#feat=cryptography
@jcsirot#WebCryptoAPI
Limitations
• Modèle de sécurité : faire confiance aux applications web
• Pas encore disponible partout, tous les algorithmes ne sont pas
disponibles
• version 1 de l’API n’est pas parfaite (pas de update/finish, pas de
streaming, impossibilité d’utiliser les clés déjà présentes sur le
système...)
• Working Draft WebCrypto Key Discovery (http://www.w3.org/
TR/webcrypto-key-discovery/)
@YourTwitterHandle@YourTwitterHandle@jcsirot#WebCryptoAPI
Qestions & Réponses
@jcsirot#WebCryptoAPI
Pour aller plus loin
https://www.schneier.com/book-applied.html
Applied Cryptography
Handbook of Applied Cryptography
http://cacr.uwaterloo.ca/hac/

Más contenido relacionado

Destacado

SignalR for ASP.NET Developers
SignalR for ASP.NET DevelopersSignalR for ASP.NET Developers
SignalR for ASP.NET Developers
Shivanand Arur
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
Mohd Arif
 
How to learn a language in 90 days (2013)
How to learn a language in 90 days (2013)How to learn a language in 90 days (2013)
How to learn a language in 90 days (2013)
Brian Kwong
 
50 Incredible Wi-Fi Tech Statistics That Businesses Must Know
50 Incredible Wi-Fi Tech Statistics That Businesses Must Know50 Incredible Wi-Fi Tech Statistics That Businesses Must Know
50 Incredible Wi-Fi Tech Statistics That Businesses Must Know
Vala Afshar
 

Destacado (20)

Rc6 algorithm
Rc6 algorithmRc6 algorithm
Rc6 algorithm
 
Cloud computing ppt
Cloud computing pptCloud computing ppt
Cloud computing ppt
 
SignalR for ASP.NET Developers
SignalR for ASP.NET DevelopersSignalR for ASP.NET Developers
SignalR for ASP.NET Developers
 
I want to learn english but .........
I want to learn english  but .........I want to learn english  but .........
I want to learn english but .........
 
De l'IPv4 à l'IPv6, Que ce passe t-il réellement?
De l'IPv4 à l'IPv6, Que ce passe t-il réellement?De l'IPv4 à l'IPv6, Que ce passe t-il réellement?
De l'IPv4 à l'IPv6, Que ce passe t-il réellement?
 
Algorithme de chiffrement RC4, A5/1 & A5/2
Algorithme de chiffrement RC4, A5/1 & A5/2Algorithme de chiffrement RC4, A5/1 & A5/2
Algorithme de chiffrement RC4, A5/1 & A5/2
 
AM modulation and Demodulation with Circuit and Output
AM modulation and Demodulation with Circuit and OutputAM modulation and Demodulation with Circuit and Output
AM modulation and Demodulation with Circuit and Output
 
RC4&RC5
RC4&RC5RC4&RC5
RC4&RC5
 
True Love
True LoveTrue Love
True Love
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 
Learning English as a second language - the myths, facts and realities
Learning English as a second language - the myths, facts  and realitiesLearning English as a second language - the myths, facts  and realities
Learning English as a second language - the myths, facts and realities
 
Learn To Love
Learn To LoveLearn To Love
Learn To Love
 
How Digital Learning Contributes to Deeper Learning
How Digital Learning Contributes to Deeper Learning How Digital Learning Contributes to Deeper Learning
How Digital Learning Contributes to Deeper Learning
 
Philosophy of love
Philosophy of lovePhilosophy of love
Philosophy of love
 
From The Wild To The Classroom
From The Wild To The ClassroomFrom The Wild To The Classroom
From The Wild To The Classroom
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
How to learn a language in 90 days (2013)
How to learn a language in 90 days (2013)How to learn a language in 90 days (2013)
How to learn a language in 90 days (2013)
 
50 Incredible Wi-Fi Tech Statistics That Businesses Must Know
50 Incredible Wi-Fi Tech Statistics That Businesses Must Know50 Incredible Wi-Fi Tech Statistics That Businesses Must Know
50 Incredible Wi-Fi Tech Statistics That Businesses Must Know
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 

Similar a De la cryptographie dans le navigateur avec WebCrypto API (Devoxx France 2015)

Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Jean-Laurent de Morlhon
 
Sécurité des Applications WEB -LEVEL1
 Sécurité des Applications WEB-LEVEL1 Sécurité des Applications WEB-LEVEL1
Sécurité des Applications WEB -LEVEL1
Tarek MOHAMED
 
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshopConfoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
Frédéric Harper
 

Similar a De la cryptographie dans le navigateur avec WebCrypto API (Devoxx France 2015) (20)

I don't always write reactive application but when I do, it run on raspberry pi
I don't always write reactive application but when I do, it run on raspberry piI don't always write reactive application but when I do, it run on raspberry pi
I don't always write reactive application but when I do, it run on raspberry pi
 
L'Open Web en tant que pierre angulaire du développement multi-objets
L'Open Web en tant que pierre angulaire du développement multi-objetsL'Open Web en tant que pierre angulaire du développement multi-objets
L'Open Web en tant que pierre angulaire du développement multi-objets
 
Devoxx java script-1280-720
Devoxx java script-1280-720Devoxx java script-1280-720
Devoxx java script-1280-720
 
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
 
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
Démo Gatling au Performance User Group de Casablanca - 25 sept 2014
 
Sécurité des applications web: attaque et défense
Sécurité des applications web: attaque et défenseSécurité des applications web: attaque et défense
Sécurité des applications web: attaque et défense
 
Introduction aux RIA (Rich Internet Applications)
Introduction aux RIA (Rich Internet Applications)Introduction aux RIA (Rich Internet Applications)
Introduction aux RIA (Rich Internet Applications)
 
Codedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
Codedarmor 2012 - 06/03 - HTML5, CSS3 et JavascriptCodedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
Codedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
 
Nouveaux apis
Nouveaux apisNouveaux apis
Nouveaux apis
 
ReST API Security
ReST API SecurityReST API Security
ReST API Security
 
ReST API Security
ReST API SecurityReST API Security
ReST API Security
 
Sécurité des Applications WEB -LEVEL1
 Sécurité des Applications WEB-LEVEL1 Sécurité des Applications WEB-LEVEL1
Sécurité des Applications WEB -LEVEL1
 
Vert.x 3
Vert.x 3Vert.x 3
Vert.x 3
 
Développer sereinement avec Node.js
Développer sereinement avec Node.jsDévelopper sereinement avec Node.js
Développer sereinement avec Node.js
 
TypeScript for dummies
TypeScript for dummiesTypeScript for dummies
TypeScript for dummies
 
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshopConfoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
Confoo - 2012-02-27 au 2012-02-28 - HTML5 workshop
 
Du JavaScript dans mon projet
Du JavaScript dans mon projetDu JavaScript dans mon projet
Du JavaScript dans mon projet
 
Une visite guidée d’Internet Explorer 9 et HTML5 pour les développeurs Web
Une visite guidée d’Internet Explorer 9 et HTML5 pour les développeurs WebUne visite guidée d’Internet Explorer 9 et HTML5 pour les développeurs Web
Une visite guidée d’Internet Explorer 9 et HTML5 pour les développeurs Web
 
Trucs et astuces sur le dévelopment Android
Trucs et astuces sur le dévelopment AndroidTrucs et astuces sur le dévelopment Android
Trucs et astuces sur le dévelopment Android
 
Hacking your home
Hacking your homeHacking your home
Hacking your home
 

De la cryptographie dans le navigateur avec WebCrypto API (Devoxx France 2015)