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 [13/04/2014 02:04] – [Decode] cyrille | informatique:openssl [17/08/2021 15:43] (Version actuelle) – [CSR generation] cyrille | ||
---|---|---|---|
Ligne 15: | Ligne 15: | ||
* http:// | * http:// | ||
- | |||
< | < | ||
| | ||
</ | </ | ||
+ | on line tools: | ||
+ | * Thawte SSL Toolbox [[https:// | ||
===== Certificate Chaining ===== | ===== Certificate Chaining ===== | ||
Ligne 42: | Ligne 43: | ||
openssl rsa -in maCle.pem -pubout -out maClePublique.pem | 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 ===== | ===== Decode ===== | ||
Ligne 63: | Ligne 76: | ||
* Thawte SSL Toolbox [[https:// | * Thawte SSL Toolbox [[https:// | ||
* [[http:// | * [[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.1397347478.txt.gz · Dernière modification : 13/04/2014 02:04 de cyrille