2. • Lab 1: Installing and configuring OpenSSL
• Lab 2: Introduction and commands used in openSSL
• Lab 3: Encryption using conventional algorithms
• Lab 4: Symmetric encryption with OpenSSL
• Lab 5: Encrypting file using RSA
• Lab 6: Asymmetric encryption with OpenSSL
3. • Run OpenSSL Installer
• using CMD paste the following command
• set OPENSSL_CONF=C:Program FilesOpenSSL-Win64binopenssl.cfg
• set Path=%Path%;C:Program FilesOpenSSL-Win64bin
4. First steps
• Open cmd and type openssl
• For commands: type help
• description of some commands
ca To create certificate authorities.
dgst To compute hash functions.
enc To encrypt/decrypt using secret key algorithms. It is possible to
generate using a password or directly a secret key stored in a file.
genrsa This command permits to generate a pair of public/private
key for the RSA algorithm.
password Generation of “hashed passwords”.
rsa RSA data management.
rsautl To encrypt/decrypt or sign/verify signature with RSA.
6. example
• Let us create text document named TEST.txt
• Write the message that you want
To encrpt the test.txt
• Open cmd write openssl >enter
• Openssl enc -aes-256-ecb -a -salt -in TEST.txt -
out cipher.txt
• Enter password and verify it
7. To decrypt
• enc -d -aes-256-ecb -a -salt -in cipher.txt -out
plain.txt
• Enter the pass word that entered before
• Done
8. • Conventional Encryption involves
transforming plaintext messages into cipher
text messages that are to be decrypted only
by the intended receiver. Both sender and
receiver agree upon a secrete key to be used
in encrypting and decrypting. Usually the
secrete key is transmitted via public key
encryption methods. .
10. • Symmetric encryption is a means of
protecting data using a secret key to encrypt
(lock) and decrypt (unlock) it.
• The sender and recipient share the key or
password to gain access to the information.
• AES, RC4, DES, RC5, and RC6 are examples of
symmetric encryption.
11.
12. • Asymmetric encryption is also a process of
encrypting data between two parties — but
instead of using a single key (as with conventional
cryptographic systems),
• it uses two unique yet mathematically related
keys to do so.
• The first key, known as the public key, encrypts
your data before sending it over the internet; the
other private key decrypts the data on the
recipient’s end of the exchange.
13.
14. • GENERATING A RSA PRIVATE KEY
• Openssl genpkey -algorithm RSA -pkeyopt
rsa_keygen_bits:2048 -out private-key.pem
• TO GENERATE A PASSWORD PROTECTED PRIVATE
KEY
Openssl genpkey -aes256 -algorithm RSA -pkeyopt r
• sa_keygen_bits:2048 -out private-key.pem
15. • Openssl> pkey -in private-key.pem -out public-
key.pem –pubout
• TO SEE THE PUBLIC KEY
• Openssl> pkey -in public-key.pem -pubin –text
16. • example, I will be hashing an arbitrary file on my
system using the MD5, SHA1, and SHA384
algorithms.
• OpenSSL dgst -md5 use.mp4
• OpenSSL dgst -sha1 use.mp4
• OpenSSL dgst -sha384 use.mp4
Encrypting video file
• Openssl enc -aes-256-cbc -e -iter 1000 -salt -in
use.mp4 -out unuse.enc
18. Hashing vs Encryption Differences
• Hashing is a digital signature orignally designed to
check if data was modified
Password hashing is a mathematical algorithm that
maps data of arbitrary size (often called the
"message") to a bit array of a fixed size (the "hash
value", "hash", or "message digest").
It is a one-way function, that is, a function which is
practically infeasible to invert or reverse the
computation
19. Cracking
• Cracking file passwords using passfab
• Cracking windows passwords using usb
• Cracking rar passwords using kraken