SlideShare a Scribd company logo
comp security lab.ppsx
• 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
• Run OpenSSL Installer
• using CMD paste the following command
• set OPENSSL_CONF=C:Program FilesOpenSSL-Win64binopenssl.cfg
• set Path=%Path%;C:Program FilesOpenSSL-Win64bin
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.
AES cipher-commands
• cipher-commands
• aes-128-cbc
• aes-128-ecb
• aes-192-cbc
• aes-192-ecb
• aes-256-cbc
• aes-256-ecb
• base64
• Cbc stands for Cipher Blocker Chaining
• Ecb stands for Electronic Codebook
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
To decrypt
• enc -d -aes-256-ecb -a -salt -in cipher.txt -out
plain.txt
• Enter the pass word that entered before
• Done
• 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. .
• Triple DES(Data Encryption Standard) Encryption:
• RSA Encryption. ...
• Advanced Encryption Standards (AES)
• Twofish encryption algorithm.
• Blowfish encryption algorithm.
• IDEA encryption algorithm.
• MD5 encryption algorithm.
• HMAC encryption algorithm etc
• 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.
comp security lab.ppsx
• 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.
comp security lab.ppsx
• 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
• Openssl> pkey -in private-key.pem -out public-
key.pem –pubout
• TO SEE THE PUBLIC KEY
• Openssl> pkey -in public-key.pem -pubin –text
• 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
• Openssl enc -aes-256-cbc -d -iter 1000 -in
unuse.enc -out prime.mp4
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
Cracking
• Cracking file passwords using passfab
• Cracking windows passwords using usb
• Cracking rar passwords using kraken

More Related Content

PPTX
SSL Primer
PDF
Computer Security Laboratory Manual .pdf
PPTX
501 ch 10 understanding cryptography and pki
PPTX
Cryptography for the mere mortals
PDF
Basic Cryptography.pdf
PPTX
Cryptography for the mere mortals - for phpXperts Seminar 2011 by Hasin and Tonu
PPT
CISSP EXAM PREPARATION FOR A PASSED SCORE
ODP
Applying Security Algorithms Using openSSL crypto library
SSL Primer
Computer Security Laboratory Manual .pdf
501 ch 10 understanding cryptography and pki
Cryptography for the mere mortals
Basic Cryptography.pdf
Cryptography for the mere mortals - for phpXperts Seminar 2011 by Hasin and Tonu
CISSP EXAM PREPARATION FOR A PASSED SCORE
Applying Security Algorithms Using openSSL crypto library

Similar to comp security lab.ppsx (20)

PPTX
501 ch 10 cryptography
PDF
Intro to Cryptography
PDF
Introduction to Cryptography
PPT
OpenPGP/GnuPG Encryption
PPT
(Crypto) DES And RSA Algorithms Overview
PDF
Fundamentals of Cryptography: Securing Data in the Digital Age
PPT
Cryptography in Human computer interaction powerpoint
PDF
Go paranoid
PPT
Cryptography
PPT
Java Crypto
PPTX
Data encryption
PPT
Introduction to cryptography and Network Security
PPSX
Linux for Cybersecurity CYB110 - Unit 7.ppsx
PPTX
Cryptography
PDF
Classic Cryptography
PPT
BCS_PKI_part1.ppt
PDF
Encryption Recap: A Refresher on Key Concepts
PPTX
Cryptography and network security
PPT
What is Encryption
501 ch 10 cryptography
Intro to Cryptography
Introduction to Cryptography
OpenPGP/GnuPG Encryption
(Crypto) DES And RSA Algorithms Overview
Fundamentals of Cryptography: Securing Data in the Digital Age
Cryptography in Human computer interaction powerpoint
Go paranoid
Cryptography
Java Crypto
Data encryption
Introduction to cryptography and Network Security
Linux for Cybersecurity CYB110 - Unit 7.ppsx
Cryptography
Classic Cryptography
BCS_PKI_part1.ppt
Encryption Recap: A Refresher on Key Concepts
Cryptography and network security
What is Encryption
Ad

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
sap open course for s4hana steps from ECC to s4
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Review of recent advances in non-invasive hemoglobin estimation
“AI and Expert System Decision Support & Business Intelligence Systems”
Ad

comp security lab.ppsx

  • 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.
  • 5. AES cipher-commands • cipher-commands • aes-128-cbc • aes-128-ecb • aes-192-cbc • aes-192-ecb • aes-256-cbc • aes-256-ecb • base64 • Cbc stands for Cipher Blocker Chaining • Ecb stands for Electronic Codebook
  • 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. .
  • 9. • Triple DES(Data Encryption Standard) Encryption: • RSA Encryption. ... • Advanced Encryption Standards (AES) • Twofish encryption algorithm. • Blowfish encryption algorithm. • IDEA encryption algorithm. • MD5 encryption algorithm. • HMAC encryption algorithm etc
  • 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.
  • 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.
  • 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
  • 17. • Openssl enc -aes-256-cbc -d -iter 1000 -in unuse.enc -out prime.mp4
  • 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