Outils pour utilisateurs

Outils du site


informatique:openssl

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:openssl [30/11/2010 08:22] cyrilleinformatique:openssl [17/08/2021 15:43] (Version actuelle) – [CSR generation] cyrille
Ligne 1: Ligne 1:
 ====== OpenSSL ====== ====== OpenSSL ======
  
-Voir aussi : [[/informatique/igc|Infrastructure de Gestion de Clefs]]+Voir aussi : 
 +  * [[/informatique/igc|Infrastructure de Gestion de Clefs]] 
 +  * [[/informatique/apache/mod_ssl|Mod_SSL]]
  
 +On line tools:
 +  * http://www.sslshopper.com/ssl-certificate-tools.html
 ===== Code Signing with OpenSSL ===== ===== Code Signing with OpenSSL =====
  
Ligne 11: Ligne 15:
  
   * http://isc.sans.edu/diary.html?storyid=8686   * http://isc.sans.edu/diary.html?storyid=8686
- 
 <code> <code>
  openssl s_client -connect isc.sans.org:443  openssl s_client -connect isc.sans.org:443
 </code> </code>
  
-===== Time Stamping =====+on line tools: 
 +  * Thawte SSL Toolbox [[https://ssltools.thawte.com/checker/views/certCheck.jsp|Check certificate installation]]
  
-==== OpenTSA ==== +===== Certificate Chaining =====
-  +
-http://www.opentsa.org+
  
-The aim of the OpenTSA project is to develop an RFC 3161 compliantstablesecureopen source and free time stamping authority client and server application. The following deliverables have already been produced:+On this page you'll find how to create only one file which contains 
 +your certificate and others chain certificates (Concatenate them in 
 +one)likeI thinkyou could have only one configuration directive 
 +to use : the CertificateFile, and to not need the CertificateChainFile 
 +anymore :
  
-    * Time Stamp patch for OpenSSLThe time stamp request creation, response generation and response verification functionality is implemented as an extension to the latest stable version of OpenSSLThis patch adds a new ts command to OpenSSL with which the time stamping operations can be carried outThis patch and the time stamp client have been merged into the official version of OpenSSL and will be available from openssl-0.9.9 onwards. +[[http://help.globalscape.com/help/eft5/admin/certificate_chaining.htm]]
-    * Time Stamp client: A simple command-line driven TSA client that can be used for creating and sending time stamp requests over HTTP or HTTPS to a TSA and for receiving and verifying the responses. The utility is distributed with the OpenSSL Time Stamp patch. +
-    * Time Stamp module for Apache: This package is an extension module for the latest stable version of the Apache HTTP server. Using the functionality of the OpenSSL Time Stamp patch this module functions as an RFC 3161 compliant time stamp server over HTTP and HTTPS transport protocols, issued time stamp tokens can be stored in a MySQL or a FireBird database.  +
-    * +
  
-===== PKI GUI ===== 
  
-==== XCA ====+===== Key generation =====
  
-http://xca.hohnstaedt.de+[[http://www.fil.univ-lille1.fr/~wegrzyno/portail/PAC/Doc/TP5/tp-certif002.html]]
  
-[[http://salpers.de/index.php?id=270|une p'tite doc]]+<code bash> 
 +  # Génération des clés 
 +  openssl genrsa -out maCle.pem 1024 
 +  # Exportation de la partie publique 
 +  openssl rsa -in maCle.pem -pubout -out maClePublique.pem 
 +</code> 
 + 
 +===== CSR generation ===== 
 + 
 +La [[/glossaire/CSR|CSR (Certificate Signing Request)]] est un fichier contenant les informations de votre demande de certificat, y compris votre clé publique. 
 + 
 +<code bash> 
 +  openssl req -nodes -newkey rsa:2048 -keyout monserveur.key -out serveur.csr 
 +</code> 
 + 
 +===== Create Certificate Authority ===== 
 + 
 +https://www.golinuxcloud.com/create-certificate-authority-root-ca-linux/#Step_4_Create_Certificate_Authority_Certificate 
 + 
 +===== Decode ===== 
 + 
 +Afficher les données d'un [[/glossaire/CSR|CSR]]: 
 +<code bash> 
 +openssl req -in theCertificateSigningResquest.csr -noout -text 
 +</code> 
 + 
 +Afficher les données d'un certificat encodé [[/glossaire/PEM|PEM]]: 
 +<code bash> 
 +openssl x509 -in theCertificate.crt -noout -text 
 +</code> 
 + 
 +=====Heartbleed===== 
 + 
 +[[wp>CVE-2014-0160]], [[https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0160|CVE-2014-0160 on nist.gov]] 
 + 
 +The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packets, which allows remote attackers to obtain sensitive information from process memory via crafted packets that trigger a buffer over-read, as demonstrated by reading private keys, related to d1_both.c and t1_lib.c, aka the Heartbleed bug. 
 + 
 +  * Thawte SSL Toolbox [[https://ssltools.thawte.com/checker/views/certCheck.jsp|Check certificate installation]] 
 +  * [[http://filippo.io/Heartbleed/|Heartbleed test]] 
 + 
 +L'analyse de l'APRIL : "[[http://www.april.org/heartbleed-une-chance-quopenssl-soit-un-logiciel-libre|HeartBleed, tous à poil sur Internet]]
 + 
 +===== Chiffrer des fichiers en asymétrique (clé privée/publique) ===== 
 + 
 +On ne peut pas crypter un fichier avec une clé publique, la taille ne correspondra pas à l’algorithme. On créé donc un secret aléatoire que l'on chiffre avec la clé publique (asymétrique) et avec lequel on chiffre le fichier (symétrique). Pour déchiffrer la fichier on retrouve le secret en le déchiffrant avec la clé privée. 
 + 
 +<code bash> 
 +# blowfish may be faster in code implementation, 
 +# but recent cpu embed hard coded aes which should be faster ;-) 
 +#ALGO=-blowfish 
 +ALGO=-aes256 
 + 
 +# Create a random secret: 
 +#  - secret size must be compatible with RSA 
 +#  - use hex because base64 add newline 
 +#    which will shorter the secret in next commands 
 +#    because only first line will be used. 
 +SECRET=`openssl rand -hex 64` 
 + 
 +# encrypt the secret: 
 +echo $SECRET \ 
 + | openssl rsautl -encrypt -inkey /home/debian/.ssl/public.pem -pubin -out ${THE_FILE}.key 
 +# encrypt file with the secret: 
 +echo $SECRET \ 
 + | openssl enc $ALGO -pbkdf2 -salt -pass stdin -in $THE_FILE -out ${THE_FILE}.ssl 
 + 
 +# decrypt the secret: 
 +SECRET=`openssl rsautl -decrypt -inkey ~/.ssl/private.pem -in ${THE_FILE}.key` 
 +# decrypt the file: 
 +echo $SECRET \ 
 + | openssl enc -d $ALGO -pbkdf2 -salt -pass stdin -in ${THE_FILE}.ssl -out ${THE_FILE}.clear 
 + 
 +</code>
  
 +Sources:
 +  * https://wiki.openssl.org/index.php/Enc
 +  * https://unix.stackexchange.com/questions/507131/openssl-1-1-1b-warning-using-iter-or-pbkdf2-would-be-better-while-decrypting
 +  * https://www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php
 +  * https://linuxconfig.org/using-openssl-to-encrypt-messages-and-files-on-linux
 +  * https://raymii.org/s/tutorials/Encrypt_and_decrypt_files_to_public_keys_via_the_OpenSSL_Command_Line.html
  
informatique/openssl.1291101723.txt.gz · Dernière modification : 19/05/2012 00:15 (modification externe)

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki