ΥΣ13 computer security pgp › csec › assets › slides › pgp.pdf · intro how does...
TRANSCRIPT
![Page 1: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/1.jpg)
ΥΣ13 Computer SecurityPGP
![Page 2: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/2.jpg)
Intro
How does cryptography work?
A cryptographic algorithm, or cipher, is a mathematical function used in the encryption and decryption process. A cryptographic algorithm works in combination with a key — a word, number, or phrase — to encrypt the plaintext. The same plaintext encrypts to different ciphertext with different keys.
The security of encrypted data is entirely dependent on two things: ● the strength of the cryptographic algorithm● the secrecy of the key
2
![Page 3: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/3.jpg)
Symmetric vs Asymmetric Encryption
● Symmetric encryption uses a single key that needs to be shared among the people who need to receive the message while asymmetrical encryption uses a pair of public key and a private key to encrypt and decrypt messages when communicating.
● Asymmetric encryption was introduced to complement the inherent problem of the need to share the key in symmetrical encryption model, eliminating the need to share the key by using a pair of public-private keys.
● Asymmetric encryption takes relatively more time than the symmetric encryption.
3
![Page 4: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/4.jpg)
Symmetric vs Asymmetric Encryption
4
![Page 5: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/5.jpg)
Symmetric vs Asymmetric Encryption
5
![Page 6: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/6.jpg)
Symmetric vs Asymmetric Encryption
Symmetric Encryption Algorithms● Blowfish, AES, RC4, DES, RC5, RC6● Most commonly used AES-128, AES-192, and AES-256
Asymmetric Encryption Algorithms● EIGamal, RSA, DSA, Elliptic curve techniques, PKCS, Diffie-Hellman
6
![Page 7: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/7.jpg)
PGP
What is PGP ?
● Created by Phil Zimmermann on 1991.● PGP uses a private-key that must be kept secret and a public-key that sender and receiver
must share.● GPG (Gnu Privacy Guard) is an independent implementation of the OpenPGP standards.● Stores pubic-keys on public key servers ( https://pgp.mit.edu/ )● Other uses:
○ Web of trust○ Digital signatures○ A digital certificate contains the user’s identifying information, their public key and one
or more digital signatures.○ Digital Certificates
7
![Page 8: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/8.jpg)
PGP
8
![Page 9: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/9.jpg)
PGP
9
![Page 10: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/10.jpg)
PGP
10
![Page 11: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/11.jpg)
PGP
gpg --full-generate-key
11
![Page 12: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/12.jpg)
PGP
gpg --full-generate-key
12
![Page 13: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/13.jpg)
PGP
gpg --list-keys
13
![Page 14: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/14.jpg)
PGP
gpg --list-secret-keys
14
![Page 16: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/16.jpg)
PGP
gpg --list-keys --keyid-format SHORT
16
![Page 17: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/17.jpg)
PGP
gpg --output mygpg.key --armor --export 776F4468
17
![Page 18: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/18.jpg)
PGP
gpg --fingerprint 776F4468
18
![Page 20: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/20.jpg)
PGP
gpg --keyserver pgp.mit.edu --send-keys 776F4468
gpg --keyserver pgp.mit.edu --recv-keys 776F4468
20
![Page 23: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/23.jpg)
PGP
23
![Page 24: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/24.jpg)
PGP
gpg --decrypt
24
![Page 25: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/25.jpg)
PGP
25
![Page 26: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/26.jpg)
PGP
gpg --clearsign
26
![Page 27: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/27.jpg)
PGP
gpg --verify
27
![Page 28: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/28.jpg)
Next slides are from some topics that we talked about + ssh key creation.
28
![Page 29: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/29.jpg)
SSH
ssh-keygen -f test_key -t rsa -b 4096-f <filename_to_save_private_key>-t <algorithm_to_use> rsa, dsa, ecdsa, ed25519 -b <key_size> differs to each algorithm
More info: https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys 29
![Page 30: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/30.jpg)
SSH
Private key
30
![Page 31: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/31.jpg)
SSH
Public key (store this to the remote computer that you want to connect to)
31
![Page 32: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/32.jpg)
Openssl, x509, CA
Creating certificate authority ca.key and ca.cer
32
![Page 33: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/33.jpg)
Openssl, x509, CA
Generating our server’s private key
33
![Page 34: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/34.jpg)
Openssl, x509, CA
Generating a certificate signing request that we send to our ca .
34
![Page 35: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/35.jpg)
Openssl, x509, CA
CA receives our request and generates our x509 certificate.
35
![Page 36: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/36.jpg)
Openssl, x509, CA
We need to enable apache2 to use our ssl certificate.After that we have One way SSL authentication to our web server.
More info on configuring apache to use a certificate: https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-16-04https://www.digitalocean.com/community/tutorials/openssl-essentials-working-with-ssl-certificates-private-keys-and-csrs
https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-debian-8
36
![Page 37: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/37.jpg)
Openssl, x509, CA
Finally, our web server with our certificate.
37
![Page 38: ΥΣ13 Computer Security PGP › csec › assets › slides › pgp.pdf · Intro How does cryptography work? A cryptographic algorithm, or cipher, is a mathematical function used](https://reader033.vdocuments.site/reader033/viewer/2022052801/5f1551a8872ad95aed369f88/html5/thumbnails/38.jpg)
Openssl, x509, CA
Finally, our web server with our certificate.Our certificate information that we can get from any browser.
38