informatique:openssl
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
informatique:openssl [20/04/2011 16:21] – [OpenSSL] cyrille | informatique:openssl [24/03/2021 21:48] – [Chiffrer des fichiers en asymétrique (clé privée/publique)] cyrille | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
* [[/ | * [[/ | ||
+ | On line tools: | ||
+ | * http:// | ||
===== Code Signing with OpenSSL ===== | ===== Code Signing with OpenSSL ===== | ||
Ligne 13: | Ligne 15: | ||
* http:// | * http:// | ||
- | |||
< | < | ||
| | ||
</ | </ | ||
+ | on line tools: | ||
+ | * Thawte SSL Toolbox [[https:// | ||
+ | |||
+ | ===== Certificate Chaining ===== | ||
+ | |||
+ | On this page you'll find how to create only one file which contains | ||
+ | your certificate and others chain certificates (Concatenate them in | ||
+ | one), like, I think, you could have only one configuration directive | ||
+ | to use : the CertificateFile, | ||
+ | anymore : | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | |||
+ | ===== Key generation ===== | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | <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 | ||
+ | </ | ||
+ | |||
+ | ===== CSR generation ===== | ||
+ | |||
+ | La [[/ | ||
+ | |||
+ | <code bash> | ||
+ | openssl req -nodes -newkey rsa:2048 -keyout monserveur.key -out serveur.csr | ||
+ | </ | ||
+ | ===== Decode ===== | ||
+ | |||
+ | Afficher les données d'un [[/ | ||
+ | <code bash> | ||
+ | openssl req -in theCertificateSigningResquest.csr -noout -text | ||
+ | </ | ||
+ | |||
+ | Afficher les données d'un certificat encodé [[/ | ||
+ | <code bash> | ||
+ | openssl x509 -in theCertificate.crt -noout -text | ||
+ | </ | ||
+ | |||
+ | =====Heartbleed===== | ||
+ | |||
+ | [[wp> | ||
+ | |||
+ | 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:// | ||
+ | * [[http:// | ||
+ | |||
+ | L' | ||
+ | |||
+ | ===== Chiffrer des fichiers en asymétrique (clé privée/ | ||
+ | |||
+ | 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=-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 / | ||
+ | # 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 ~/ | ||
+ | # decrypt the file: | ||
+ | echo $SECRET \ | ||
+ | | openssl enc -d $ALGO -pbkdf2 -salt -pass stdin -in ${THE_FILE}.ssl -out ${THE_FILE}.clear | ||
+ | |||
+ | </ | ||
+ | Sources: | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
informatique/openssl.txt · Dernière modification : 17/08/2021 15:43 de cyrille