OpenSSL: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Geist (Diskussion | Beiträge) |
Geist (Diskussion | Beiträge) |
||
Zeile 52: | Zeile 52: | ||
-missing-help List missing detailed help strings | -missing-help List missing detailed help strings | ||
-options val List options for specified command | -options val List options for specified command | ||
− | |||
− | |||
== '''Symmetric encryption with openssl''' == | == '''Symmetric encryption with openssl''' == | ||
Zeile 61: | Zeile 59: | ||
'''$ openssl enc -aes-256-cbc -d -in sslmessage -pass pass:test''' | '''$ openssl enc -aes-256-cbc -d -in sslmessage -pass pass:test''' | ||
− | == '''Asymmetric encryption with openssl | + | == '''Asymmetric encryption with openssl''' == |
− | ===== | + | ===== Generate a private key ===== |
− | $ openssl genrsa -out key1.pem 512 | + | '''$ openssl genrsa -out key1.pem 512''' |
− | $ openssl genrsa -out key1.pem 4096 | + | '''$ openssl genrsa -out key1.pem 4096''' |
− | |||
− | |||
− | |||
− | $ openssl rsa -in key1.pem -text | + | ===== Generate a public key from private key ===== |
− | $ openssl rsa -in key1.pem -noout | + | '''$ openssl rsa -in key1.pem -outform PEM -pubout -out key1.pub''' |
+ | '''$ openssl rsa -in key1.pem -text''' | ||
+ | '''$ openssl rsa -in key1.pem -noout''' | ||
− | + | ===== Encrypt ===== | |
− | $ openssl rsa -in key1.pem -des3 -out key1.enc | + | '''$ openssl rsa -in key1.pem -des3 -out key1.enc''' |
− | $ openssl genrsa -des3 -out key1.enc | + | '''$ openssl genrsa -des3 -out key1.enc''' |
Version vom 7. Dezember 2021, 10:34 Uhr
Inhaltsverzeichnis
OpenSSL Version 1.1.1
Encryption for: - data - communication - traffic - secret - signing plain --> cipher
Types of encryption
Symmetric encryption ==> Same key for encrypt/decrypt Algorithms examples: - AES - DES - Triple DES - Serpent - Twofish
Asymmetric encryption ==> Different key for encrypt/decrypt Algorithms examples: - RSA - DSA - PGP - SHA-1 - SHA-2 - SHA-24 - SHA-256 - SHA-512
$ whereis openssl $ which openssl $ openssl rsautl
$ openssl version $ openssl help $ openssl help list $ openssl list -help Valid options are: -help Display this summary -1 List in one column -commands List of standard commands -digest-commands List of message digest commands -digest-algorithms List of message digest algorithms -cipher-commands List of cipher commands -cipher-algorithms List of cipher algorithms -public-key-algorithms List of public key algorithms -public-key-methods List of public key methods -disabled List of disabled features -missing-help List missing detailed help strings -options val List options for specified command
Symmetric encryption with openssl
$ openssl enc -aes-256-cbc -in sslmessage -out sslmessage.enc
Symmetric decryption with openssl
$ openssl enc -aes-256-cbc -d -in sslmessage -pass pass:test
Asymmetric encryption with openssl
Generate a private key
$ openssl genrsa -out key1.pem 512 $ openssl genrsa -out key1.pem 4096
Generate a public key from private key
$ openssl rsa -in key1.pem -outform PEM -pubout -out key1.pub $ openssl rsa -in key1.pem -text $ openssl rsa -in key1.pem -noout
Encrypt
$ openssl rsa -in key1.pem -des3 -out key1.enc $ openssl genrsa -des3 -out key1.enc