====== Public Key Cryptographic Standard ====== Tous les PKCS sont sur [[http://www.rsa.com/rsalabs/node.asp?id=2124|rsa.com]]. * PKCS#1: RSA Cryptography Standard * PKCS#3: Diffie-Hellman Key Agreement Standard * PKCS#5: Password-Based Cryptography Standard * PKCS#6: Extended-Certificate Syntax Standard * [[#pkcs_7_-_cryptographic_message_syntax_standard|PKCS#7]]: Cryptographic Message Syntax Standard * PKCS#8: Private-Key Information Syntax Standard * PKCS#9: Selected Attribute Types * PKCS#10: Certification Request Syntax Standard * [[#pkcs_11_-_cryptographic_token_interface_standard|PKCS#11]]: Cryptographic Token Interface Standard * [[#pkcs_12_-_personnal_information_exchange_syntax_standard|PKCS#12]]: Personal Information Exchange Syntax Standard * PKCS#13: Elliptic Curve Cryptography Standard * PKCS#15: Cryptographic Token Information Format Standard Voir [[/glossaire/pkcs|/glossaire/pkcs]] pour des liens de références. ===== PKCS#7 - Cryptographic Message Syntax Standard ===== [[http://www.rsa.com/rsalabs/node.asp?id=2129|PKCS#7 sur rsa.com]] Décrit la syntaxe pour les données sur lesquelles ont été appliquées des opérations cryptographiques, comme la signature électronique ou le chiffrement. Cette spécification fait partie des [[http://www.rsa.com/rsalabs/node.asp?id=2124|Public-Key Cryptography Standards]] produits par la société [[:glossaire#RSA]]. PKCS#7 décrit la syntaxe pour pour les données sur lesquelles ont été appliquées des opérations cryptographiques, comme la signature électronique ou le chiffrement. La récursivité est supportée, comme par exemple le chiffrement de données signées. Voir aussi Cryptographic Message Syntax (CMS) [[http://tools.ietf.org/html/rfc2315|RFC2315]] [[http://tools.ietf.org/html/rfc2630|RFC2630]] [[http://tools.ietf.org/html/rfc3369|RFC3369]] [[http://www.ietf.org/rfc/rfc3852.txt|RFC 3852]]. Voir aussi la [[http://tools.ietf.org/html/rfc3851|RFC3851]] (Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.1 Message Specification) qui indique notamment les conten-type et les extensions des fichiers ([[http://tools.ietf.org/html/rfc3851#section-3.2|chapitre 3.2.1.]] The name and filename Parameters). La spécification Cryptographic Message Syntax (CMS, RFC 2630), utilisée par S/MIME 3, est issue de PKCS#7. Extensions usuelles de fichiers PKCS#7 : .p7s (données signées), .p7m (données chiffrées) ^ MIME Type ^ File Extension ^ | application/pkcs7-mime (SignedData, EnvelopedData) | .p7m | | application/pkcs7-mime (degenerate SignedData certificate management message) | .p7c | | application/pkcs7-mime (CompressedData) | .p7z | | application/pkcs7-signature (SignedData) | .p7s | Un message signé par Mozilla ou Outlook a en pièce jointe un fichier PKCS#7 (ou CMS) qui contient la signature (.p7s). Le contenu d‘un message chiffré par Mozilla ou Outlook est placé dans une pièce jointe (.p7m). Exemple d'un mail signé avec Thunderbird : {{documentation:technologies:crypto:mail_signe.txt|mail_signe.txt}} ra ===== PKCS#11 - Cryptographic Token Interface Standard ===== * API Mozilla, approvisionnement PKCS [[https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/pkcs11|]] * exemple avec la webextension [[https://github.com/open-eid/firefox-pkcs11-loader/blob/master/webextension/background.js|firefox-pkcs11-loader]] par la "Estonian Information System Authority" * Chromium [[https://www.chromium.org/developers/design-documents/chaps-technical-design/#pkcs-11-software-mechanisms|PKCS #11 Software Mechanisms]] and [[https://www.chromium.org/developers/design-documents/chaps-technical-design/#resources|Resources]] * Chrome does not provide a mechanism to specify a PKCS#11 provider, only Firefox does. * Use any of the available chrome extension like * [[https://chrome.google.com/webstore/detail/signerdigital-digital-sig/glghokcicpikglmflbbelbgeafpijkkf|Signer.Digital Chrome Extension]] (Digital Signature of eReturns, PDF & Web User Auth, RSA Encryption/Decryption, Certificate Enrollment/Download on Smartcard) * ''wget'' et ''curl'' permettent l'authentification depuis un token pkcs11 [[https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/security_hardening/configuring-applications-to-use-cryptographic-hardware-through-pkcs-11_security-hardening#configuring-applications-to-authenticate-using-certificates-from-smart-cards_configuring-applications-to-use-cryptographic-hardware-through-pkcs-11|6.3. Configuring applications to authenticate using certificates from smart cards (RedHat)]] * [[https://github.com/OpenSC/OpenSC/wiki|OpenSC]] provides a set of libraries and utilities to work with smart cards. Its main focus is on cards that support cryptographic operations, and facilitate their use in security applications such as authentication, mail encryption and digital signatures. OpenSC implements the standard APIs to smart cards * OpenSC [[https://htmlpreview.github.io/?https://github.com/OpenSC/OpenSC/blob/master/doc/tools/tools.html|tools]] comme gérer les tokens PKCS#11 et PKCS#15 Token products: * **[[/informatique/SafeNet eToken 5110|SafeNet eToken 5110]]** (37 €) * Product brief by Gemalto https://www.linux.org/attachments/safenet-etoken-5110-product-brief-pdf.3477/ * Digicert knowledge base [[https://knowledge.digicert.com/solution/initialize-safenet-etoken-5110cc.html|Initialize a SafeNet eToken 5110CC]] * **[[/informatique/SafeNet eToken 5300|Gemalto SafeNet eToken 5300]]** (49 €) * La technologie basée sur certificat génère et enregistre les données d'accès personnelles d'un utilisateur, comme les clés privées, mots de passe et certificats numériques, au sein de l'environnement sécurisé de la puce Smartcard. * fiche vendeur https://www.qscd.eu/usb-tokens/gemalto-safenet-etoken-5300-mini/ * **Nitrokey Start** (29 €) * Cryptographic algorithms: RSA 2048 bit, RSA 4096 bit, ECC 256 bit EdDSA, ECDSA (with NIST P256 and secp256k1), ECDH (with X25519, NIST P256 and secp256k1), MD5, RIPEMD-160, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 * Storage capacity: 3 keys (decryption, signing, authentication) * [[https://www.nitrokey.com/files/doc/Nitrokey_Start_factsheet.pdf|Fact sheet]] * [[https://www.nitrokey.com/fr#comparison|Nitrokey]] products * [[https://docs.nitrokey.com/fr/start/linux/|Documentation]] dont linux et en français * OpenSC compatible * **Feitian ePass2003** (9 £) * Onboard key-generation, digital signature and crypto operations, PKCS#11, Onboard RSA, ECC, AES, SHA-1, SHA-2, X.509 Certificate Storage, 64KB EEPROM * OpenSC compatible * [[https://www.microcosm.com/it-security-hardware/pki-tokens|fiche produit]] Token sellers: * https://www.bechtle.com/fr/finder?query=etoken&origin=searchbar * https://www.qscd.eu/search/?string=Gemalto+SafeNet+eToken * https://www.javacardos.com – dedicated to building a comprehensive Java Card platform. * http://www.aventra.fi – ships from Finland, Aventra-MyEID-PKI-card card * http://www.cryptoshop.com – ships from Austria * http://shop.kernelconcepts.de/ – ships from Germany, OpenPGP v2 card and CryptoStick token * http://www.logidata-int.fr – ships from France * http://www.smartcardfocus.com – ships from UK Fournisseurs de signature électronique "officielle" hardware (avec token usb) * [[signature_electronique#token_officiel_en_france|]] * https://www.chambersign.fr/p-offre-cci-store/ Pour des **essais de manips avec pkcs#11**, OpenSC (pkcs-tool) et OpenSSL voir la page du token [[/informatique/SafeNet eToken 5110|SafeNet eToken 5110]]. ==== Chiffrement et déchiffrement avec Javascript dans navigateur ==== Questions/discussions * https://github.com/OpenSC/OpenSC/discussions/2839 * https://www.developpez.net/forums/d2154735/javascript/general-javascript/cryptographie-navigateur-web-token-pkcs11/ * [What about a WASM API](https://github.com/ThalesGroup/pycryptoki/issues/42) at ThalesGroup/pycryptoki Thales propose une [[https://github.com/ThalesGroup/pycryptoki|API en Python]] * https://github.com/ThalesGroup/pycryptoki/blob/master/docs/getting_started.rst * https://pycryptoki.readthedocs.io/en/latest/ [[https://web-eid.eu/|Web eID]]: electronic ID smart cards on the Web * Utilise la Browser Native Messaging API * Exemple avec [[https://github.com/web-eid/web-eid-authtoken-validation-php/blob/main/examples/public/js/web-eid.js|Javascript et Php]] Les technos pour permettre l'usage d'un eToken: * Ne pourrait-on pas faire la même chose avec WASM ? * [[https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/export_native_api.md|Export native API to WASM application]] * Browser Native Messaging * https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging * C'est la techno utilisée par [[https://libersign.libriciel.fr/updates.json|libersign]] de [[https://www.libriciel.fr|Libriciel]] ===== PKCS#12 - Personnal Information Exchange Syntax Standard ===== [[http://www.rsa.com/rsalabs/node.asp?id=2138|PKCS#12 sur rsa.com]] Cette spécification fait partie des [[http://www.rsa.com/rsalabs/node.asp?id=2124|Public-Key Cryptography Standards]] produits par la société [[:glossaire#RSA]]. C‘est un standard pour stocker des clés privées, des clés publiques et des certificats en les protégeant en confidentialité et en intégrité (soit par mot de passe - le plus courant - soit avec de la cryptographie asymétrique - plus rare et non utilisé dans les produits grands publics). Les données sont stockées dans un format binaire. C‘est le format communément utiliser pour stocker un certificat et sa clé privée associée dans un fichier protégé en confidentialité et intégrité par un mot de passe. Ce format est utilisé par Mozilla et Internet Explorer/Outlook pour importer et exporter un certificat avec sa clé privée associée. Extensions usuelles de fichiers PKCS#12 : .p12, .pfx (Microsoft utilise cette extension pour désigner des fichiers au format PKCS#12 ; voir la rubrique PFX)