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édente | ||
informatique:openssl [27/04/2011 23:47] – Openssl Certificate Chaining cyrille | informatique:openssl [17/08/2021 15:43] (Version actuelle) – [CSR generation] 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 ===== | ===== Certificate Chaining ===== | ||
Ligne 30: | Ligne 33: | ||
+ | ===== 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 | ||
+ | </ | ||
+ | |||
+ | ===== Create Certificate Authority ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | ===== 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:// | ||
+ | * https:// | ||
+ | * https:// | ||
informatique/openssl.1303940829.txt.gz · Dernière modification : 19/05/2012 00:15 (modification externe)