Lab3 Cryptography
Lab3 Cryptography
LAB3ͲƌLJƉƚŽŐƌĂƉŚLJ
^ĞƐƐŝŽŶZĞƋƵŝƌĞŵĞŶƚƐ͗
¾ &ŽƌDŝĐƌŽƐŽĨƚtŝŶĚŽǁƐƵƐĞƌƐ͕ŝĨLJŽƵŚĂǀĞŶΖƚĚŽŶĞďĞĨŽƌĞ͗
ͲWůĞĂƐĞŝŶƐƚĂůůsŝƌƚƵĂůŽdžŽƌsDǁĂƌĞŽŶLJŽƵƌW
ͲWůĞĂƐĞŝŶƐƚĂůůhďƵŶƚƵϭϲ͘Ϭϰ;>d^ͿŽƌĂůĂƚĞƌǀĞƌƐŝŽŶ
¾ WůĞĂƐĞĨŝŶĚďĞůŽǁƐŽŵĞůŝŶŬƐĨŽƌĚŽǁŶůŽĂĚŝŶŐǀŝƌƚƵĂůŵĂĐŚŝŶĞƐ͗
ŚƚƚƉƐ͗ͬͬǁǁǁ͘ǀŝƌƚƵĂůďŽdž͘ŽƌŐ
ŚƚƚƉƐ͗ͬͬǁǁǁ͘ŽƐďŽdžĞƐ͘ŽƌŐͬǀŵǁĂƌĞͲŝŵĂŐĞƐͬ
ŚƚƚƉƐ͗ͬͬǁǁǁ͘ŽƐďŽdžĞƐ͘ŽƌŐͬǀŝƌƚƵĂůďŽdžͲŝŵĂŐĞƐͬ
ŚƚƚƉƐ͗ͬͬǀŝƌƚƵĂůͲŵĂĐŚŝŶĞ͘ŽƌŐͬĚŽǁŶůŽĂĚͲůŝƐƚ
ͲtŝŶĚŽǁƐsDƐ͗
ŚƚƚƉƐ͗ͬͬĚĞǀĞůŽƉĞƌ͘ŵŝĐƌŽƐŽĨƚ͘ĐŽŵͬĞŶͲƵƐͬŵŝĐƌŽƐŽĨƚͲĞĚŐĞͬƚŽŽůƐͬǀŵƐͬ
¾ ůůƚŚĞƋƵĞƐƚŝŽŶƐŵƵƐƚďĞĂŶƐǁĞƌĞĚĂŶĚŝŶĐůƵĚĞĚŝŶƚŚĞƌĞƉŽƌƚ͘
¾ zŽƵŚĂǀĞƚŽĐůĞĂƌůLJǁƌŝƚĞLJŽƵƌŶĂŵĞƐŽŶĂĐŽǀĞƌƉĂŐĞ
¾ DĂŬĞĂŝƉĨŝůĞĐŽŶƚĂŝŶƐĂůůĨŝůĞƐŐĞŶĞƌĂƚĞĚŝŶdĂƐŬϰ͕ŬĞĞƉŝŶŐƚŚĞƐĂŵĞĨŝůĞŶĂŵĞƐ͕ĂŶĚĂW&ƌĞƉŽƌƚ
ĨŽƌĂůůdĂƐŬƐ͕ŝŶĐůƵĚŝŶŐĂůůĐŽŵŵĂŶĚƐƵƐĞĚ͘KŶůLJW&ĨŽƌŵĂƚŝƐĂĐĐĞƉƚĞĚ;ϯƉŽŝŶƚƐƉĞŶĂůƚLJĨŽƌŽƚŚĞƌĨŽƌŵĂƚƐͿ
¾ ĂĐŚŐƌŽƵƉ;ĐŽŵƉŽƐĞĚŽĨϯƉĞƌƐŽŶƐĂƚŵŽƐƚͿŵƵƐƚƐƵďŵŝƚĂƌĞƉŽƌƚ͘
Content
Activity objective:
The learning objective of this lab is to get familiar with the toolkit OpenSSL. In
this lab, we will use openssl commands and libraries.
OpenSSL is an open-source implementation of the SSL and TLS protocols. It
provides:
a. The core library, written in the C programming language, implements
basic cryptographic functions and provides various utility functions, and
produce a secured applications Client/Server using SSL/TLS
b. We use line command OpenSSL to:
1. Generate RSA, DSA keys (signing)
2. Generate X509 certificate
3. Calculate fingerprint (MD5, SHA…..)
4. Encrypt and decrypt files (RSA, DES, 3DES ...)
5. Testing Client/Server SSL/TLS
6. Signing and crypt emails (S/MIME)
Lab Environment
In this lab, we will use openssl commands and libraries. You should first install
openssl package, you will use apt-get install openssl.
· To see the manuals, you can type man openssl
The OpenSSL is an entry point for many functions. You call it following the
pattern:
Page 2|5
ING4 (SI) 2020/2021
Page 3|5
ING4 (SI) 2020/2021
Page 4|5
ING4 (SI) 2020/2021
Job Aids
$diff file1.txt file2.txt –q: compares the contents of the two files
$sftp username@remote_hostname_or_IP
ls (list remote files)
lls ( list local files)
cd (change directory / remote)
lcd (change directory / local)
get remoteFile
put localfile
exit
Page 5|5