Public-key Infrastructure. Computer Center, CS, NCTU 2 Cryptosystems  Cryptosystems Symmetric Asymmetric (public-key)  RSA Public key: n=3233, e=17.

Slides:



Advertisements
Similar presentations
CP3397 ECommerce.
Advertisements

HTTPS/SSL Oleh: Idris Winarno. Persiapan Pastikan repository debian # vim /etc/apt/sources.list deb etch main contrib non-freehttp://kebo.vlsm.org/debian.
Apache2 HTTPS. 1. Install webserver Apache # apt-get install apache2 2. Buat direktori untuk menyimpan file https # mkdir /var/www/secure 3. Instalasi.
1 Lecture 17: SSL/TLS history, architecture basic handshake session initiation/resumption key computation negotiating cipher suites application: SET.
Cryptography Chapter 7 Part 4 Pages 833 to 874. PKI Public Key Infrastructure Framework for Public Key Cryptography and for Secret key exchange.
Cryptography and Network Security
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
Module 5: TLS and SSL 1. Overview Transport Layer Security Overview Secure Socket Layer Overview SSL Termination SSL in the Hosted Environment Load Balanced.
Chapter 7 Web Security MSc. NGUYEN CAO DAT Dr. TRAN VAN HOAI.
More on SSL/TLS. Internet security: TLS TLS is one of the more prominent internet security protocols. TLS is one of the more prominent internet security.
1 Pertemuan 12 Authentication, Encryption, Digital Payments, and Digital Money Matakuliah: M0284/Teknologi & Infrastruktur E-Business Tahun: 2005 Versi:
Apache ssl Objectives Contents Practical Summary Setup Apache + ssl
Apr 2, 2002Mårten Trolin1 Previous lecture On the assignment Certificates and key management –Obtaining a certificate –Verifying a certificate –Certificate.
Mar 12, 2002Mårten Trolin1 This lecture Diffie-Hellman key agreement Authentication Certificates Certificate Authorities SSL/TLS.
An Introduction to Security Concepts and Public Key Infrastructure (PKI) Mary Thompson.
Cryptography and Network Security Chapter 17
Apr 22, 2003Mårten Trolin1 Agenda Course high-lights – Symmetric and asymmetric cryptography – Digital signatures and MACs – Certificates – Protocols Interactive.
Topic 11: Key Distribution and Agreement 1 Information Security CS 526 Topic 11: Key Distribution & Agreement, Secure Communication.
Chapter 8 Web Security.
TLS/SSL Review. Transport Layer Security A 30-second history Secure Sockets Layer was developed by Netscape in 1994 as a protocol which permitted persistent.
CSCI 6962: Server-side Design and Programming
Digital Certificates Public Key Deception Digital Certificates Certificate Authorities Public Key Infrastructures (PKIs)
Digital Certificates With Chuck Easttom. Digital Signatures  Digital Signature is usually the encryption of a message or message digest with the sender's.
Network Security. An Introduction to Cryptography The encryption model (for a symmetric-key cipher).
Networks and Security. Types of Attacks/Security Issues  Malware  Viruses  Worms  Trojan Horse  Rootkit  Phishing  Spyware  Denial of Service.
Securing Data at the Application Layer Planning Authenticity and Integrity of Transmitted Data Planning Encryption of Transmitted Data.
Digital Certificates Made Easy Sam Lutgring Director of Informational Technology Services Calhoun Intermediate School District.
Secure Socket Layer (SSL)
SSL / TLS in ITDS Arun Vishwanathan 23 rd Dec 2003.
Public-key Infrastructure. Computer Center, CS, NCTU 2 Public-key Infrastructure  A set of hardware, software, people, policies, and procedures.  To.
1 Apache and Virtual Sites and SSL Dorcas Muthoni.
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
Introduction to Secure Sockets Layer (SSL) Protocol Based on:
Unit 1: Protection and Security for Grid Computing Part 2
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
Certificate-Based Operations. Module Objectives By the end of this module participants will be able to: Define how cryptography is used to secure information.
Module 9: Fundamentals of Securing Network Communication.
Cryptography and Network Security (CS435) Part Twelve (Electronic Mail Security)
Internet Security. 2 PGP is a security technology which allows us to send that is authenticated and/or encrypted. Authentication confirms the identity.
1 Security Protocols in the Internet Source: Chapter 31 Data Communications & Networking Forouzan Third Edition.
Data Encryption using SSL Topic 5, Chapter 15 Network Programming Kansas State University at Salina.
CS 4244: Internet Programming Security 1.0. Introduction Client identification and cookies Basic Authentication Digest Authentication Secure HTTP.
X.509 Topics PGP S/MIME Kerberos. Directory Authentication Framework X.509 is part of the ISO X.500 directory standard. used by S/MIME, SSL, IPSec, and.
Security CNS 4650 Fall 2004 Rev. 2 SSL, SASL, PKI.
Washington System Center © 2005 IBM Corporation August 25, 2005 RDS Training Secure Socket Layer (SSL) Overview z/Series Security (Mary Sweat, Greg Boyd)
Topic 14: Secure Communication1 Information Security CS 526 Topic 14: Key Distribution & Agreement, Secure Communication.
Public-key Infrastructure. Computer Center, CS, NCTU 2 Public-key Infrastructure  A set of hardware, software, people, policies, and procedures.  To.
INFORMATION SECURITY MANAGEMENT P ROTECTION M ECHANISMS - C RYPTOGRAPHY.
Digital Signatures and Digital Certificates Monil Adhikari.
Lecture 11 Overview. Digital Signature Properties CS 450/650 Lecture 11: Digital Signatures 2 Unforgeable: Only the signer can produce his/her signature.
Mar 28, 2003Mårten Trolin1 This lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
X509 Web Authentication From the perspective of security or An Introduction to Certificates.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
Public-key Infrastructure
Secure Sockets Layer (SSL)
Public-key Infrastructure
Public-key Infrastructure
Cryptography and Network Security
Public-key Infrastructure
Cryptography and Network Security
Presentation transcript:

Public-key Infrastructure

Computer Center, CS, NCTU 2 Cryptosystems  Cryptosystems Symmetric Asymmetric (public-key)  RSA Public key: n=3233, e=17 Private key: d=2753 Let m=65  Encryption: c = (mod 3233) = 2790  Decryption: m = (mod 3233) = 65

Computer Center, CS, NCTU 3 Public-key Infrastructure  Each person has his own public-private key pair  PKI is a set of hardware, software, people, policies, and procedures to create, manage, distribute, use, store, and revoke digital certificates  Then, we can do Encryption Authentication Digital signature Bootstrapping secure communication protocols

Computer Center, CS, NCTU 4 In God We Trust

Computer Center, CS, NCTU 5 Certificate – (1) Alice: (1)Generate A pub, A priv CA X: (3) Generate Sig( X priv, Alice, A pub, T ) (2) Alice, A pub, ID proof (4) Sig(X priv, Alice, A pub, T) Cert A,X =[Alice, A pub, Sig(X priv, Alice, A pub, T) ] Note Note: CA does not know A priv

Computer Center, CS, NCTU 6 Certificate – (2)  Also called Network Identity  A certificate is issued by a CA X  A certificate of a user A consists: The name of the issuer CA X His/her public key A pub The signature Sig(X priv, A, A pub, T) by the CA X The expiration date Applications  Encryption / Signature …

Computer Center, CS, NCTU 7 Root CA  Root CA ( 最高層認證中心 ) In Micro$oft: 「根目錄授權憑證」 Root CA do not sign the certificates for users  Authorize CA to sign the certificates for users, instead. Root CA signs for itself.  It is in the sky. To trust Root CA  Install the certificate of Root CA via the secure channel

Computer Center, CS, NCTU 8 Certificate and CA  Certificate Authority (CA) “ 憑證授權 ” in Windows CHT version In X.509, it is itself a certificate  The data of CA  To sign certificates for others Each CA contains a signature of Root CA.  To verify the validity of a certificate, check the signature of Root CA in the certificate of CA the signature of CA in this certificate

Computer Center, CS, NCTU 9 The Cost of Certificate  Tree structure of CA  Cost of certificate VeriSign : NT $18,000 / per year / per host Myself : NT $0

Computer Center, CS, NCTU 10 Secure communication protocols  Security of transmitting DATA Transmit session key first  Public-key cryptosystem Transmit DATA by session key  Symmetric-key cryptosystem  Reference:

SSL & TLS

Computer Center, CS, NCTU 12 SSL/TLS  SSL/TLS Provide communication security over the Internet  Prevent eavesdropping and tampering Encrypt the segments over Transport Layer

Computer Center, CS, NCTU 13 History – (1)  SSL – developed by Netscape SSL 1.0: never publicly released SSL 2.0: released in 1995  A number of security flaws SSL 3.0: released in 1996  A complete redesign  Newer versions of SSL/TLS are based on SSL 3.0  TLS – IETF RFC TLS 1.0(SSL 3.1): RFC 2246 in  Backward compatible to SSL 3.0  CBC vulnerability discovered in 2002

Computer Center, CS, NCTU 14 History – (2)  TLS – IETF RFC TLS 1.1(SSL 3.2): RFC 4346 in 2006  Prevent CBC attacks TLS 1.2(SSL 3.3): RFC 5246 in 2008  Enhance security strength  Introduce new cryptographic algorithms

Computer Center, CS, NCTU 15 SSL/TLS Negotiation  (C) Request a secure connection, and present a list of supported ciphers and hash functions  (S) Select common cipher and hash function, and send back with server’s digital certificate  (C) Confirm the validity of the certificate  (C) Encrypt a random number with server’s public key, and send it to server  (C/S) Generate session key(s) from the random number

Computer Center, CS, NCTU 16 SSL/TLS Applications  Implemented on top of Transport Layer prototols TCP UDP(DTLS)  Protect application-specific protocols HTTP, FTP, SMTP, NNTP, … VPN(OpenVPN), SIP, VoIP  Activate SSL/TLS connection Use a different port number (https/433, smtps/465) Use a protocol specific mechanism (STARTTLS)

Computer Center, CS, NCTU 17 Support for Named-based Virtual Servers  All virtual servers belong to the same domain Wildcard certificate Add all virtual host names in subjectAltName Disadvantages  Certificate needs reissuing whenever adding a new virtual server  Cannot support named-based virtual hosts for web service  Server Name Indication (SNI) RFC The client browser must also support SNI

OpenSSL in FreeBSD

Computer Center, CS, NCTU 19 OpenSSL   In system /usr/src/crypto/openssl  In ports security/openssl

Computer Center, CS, NCTU 20 ports/Mk/bsd.openssl.mk # WITH_OPENSSL_BASE=yes - Use the version in the base system. # WITH_OPENSSL_PORT=yes - Use the port, even if base is up to date # WITH_OPENSSL_BETA=yes - Use a snapshot of recent openssl # WITH_OPENSSL_STABLE=yes - Use an older openssl version …… # if no preference was set, check for an installed base version # but give an installed port preference over it..if !defined(WITH_OPENSSL_BASE) && \ !defined(WITH_OPENSSL_BETA) && \ !defined(WITH_OPENSSL_PORT) && \ !defined(WITH_OPENSSL_STABLE) && \ !exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so) && \ exists(${DESTDIR}/usr/include/openssl/opensslv.h) WITH_OPENSSL_BASE=yes.endif

Example: Apache SSL settings

Computer Center, CS, NCTU 22 Flow  Flow Generate random seed Generate RootCA  Generate private key of RootCA  Fill the Request of Certificate.  Sign the certificate itself. Generate certificate of Web Server  Generate private key of Web Server  Fill the Request of certificate  Sign the certificate using RootCA Modify apache configuration  restart apache

Computer Center, CS, NCTU 23 Generate random seed  Generate num pseudo-random bytes % openssl rand -out rnd-file num  Protect the psuedo-random file % chmod go-rwx rnd-file

Computer Center, CS, NCTU 24 Generate private key of RootCA  Generate public-private key pairs % openssl genrsa -des3 -rand rnd-file -out rootca-key-file num Note: phrase are asked (something like password)  Protect the private key % chmod go-rwx rootca-key-file

Computer Center, CS, NCTU 25 Fill the Request of Certificate  Generate the request of certificate % openssl req -new -key rootca-key-file -out rootca-req-file Enter pass phrase for rootca-key-file: Country Name (2 letter code) [AU]:TW State or Province Name (full name) [Some-State]:Taiwan Locality Name (eg, city) []:HsinChu Organization Name (eg, company) [Internet Widgits Pty Ltd]:NCTU Organizational Unit Name (eg, section) []:CS Common Name (eg, YOUR name) []:nasa.cs.nctu.edu.tw Address A challenge password []: (No need , Enter please) An optional company name []: (Enter please)

Computer Center, CS, NCTU 26 Sign the certificate itself  Sign the certificate of RootCA % openssl x509 -req -days num -sha1 -extfile path_of_openssl.cnf -extensions v3_ca -signkey rootca-key-file -in rootca-req-file -out rootca-crt-file  Delete the request file (Optional) % rm -f rootca-req-file

Computer Center, CS, NCTU 27 Generate private key of Web Server  Generate the public-private key pair % openssl genrsa -out host-key-file num  Protect the private key % chmod go-rwx host-key-file

Computer Center, CS, NCTU 28 Fill the Request of Certificate  Generate the request of certificate % openssl req -new -key host-key-file -out host-req-file

Computer Center, CS, NCTU 29 Sign the certificate using RootCA  Tramsmit host-req-file to Root CA  Sing the certificate by RootCA % openssl x509 -req -days num -sha1 -extfile path_of_openssl.cnf -extensions v3_ca -CA rootca-crt-file -CAkey rootca-key-file -CAserial rootca-srl-file -CAcreateserial -in host-req-file -out host-crt-file  Remove the request file in RootCA and Web Server  Transmit host-crt-file back to Web Server

Computer Center, CS, NCTU 30 Certificate Authority Include etc/apache22/extra/httpd-ssl.conf ## ## SSL Virtual Host Context ## # General setup for the virtual host DocumentRoot /home/wwwadm/data Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all ServerName nasa.cs.nctu.edu.tw:443 ServerAdmin ErrorLog /var/log/httpd/nasa.cs-error.log CustomLog /var/log/httpd/nasa.cs-access.log common SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP:+eNULL SSLCertificateFile /etc/ssl/nasa/nasa.crt.pem SSLCertificateKeyFile /etc/ssl/nasa/private/nasa.key.pem

Computer Center, CS, NCTU 31 View the content of Certificate – (1)  % vim host-crt-file -----BEGIN CERTIFICATE----- MIIE0DCCA7igAwIBAgIJAL5UBzbv+hl1MA0GCSqGSIb3DQEBBQUAMIGgMQswCQYD VQQGEwJUVzEPMA0GA1UECBMGVGFpd2FuMRAwDgYDVQQHEwdIc2luQ2h1MQ0wCwYD VQQKEwROQ1RVMQswCQYDVQQLEwJBTTEiMCAGA1UEAxMZZXZpbGJpZzUubWF0aC5u …… 9xMw8qMBHnxUVHOUVbECAwEAAaOCAQkwggEFMB0GA1UdDgQWBBR958Azmc9N7gbm kFLgfOpw+9RW9TCB1QYDVR0jBIHNMIHKgBR958Azmc9N7gbmkFLgfOpw+9RW9aGB pqSBozCBoDELMAkGA1UEBhMCVFcxDzANBgNVBAgTBlRhaXdhbjEQMA4GA1UEBxMH SHNpbkNodTENMAsGA1UEChMETkNUVTELMAkGA1UECxMCQU0xIjAgBgNVBAMTGWV2 aWxiaWc1Lm1hdGgubmN0dS5lZHUudHcxLjAsBgkqhkiG9w0BCQEWH3JhbmR5QGV2 aWxiaWc1Lm1hdGgubmN0dS5lZHUudHeCCQC+VAc27/oZdTAMBgNVHRMEBTADAQH/ MA0GCSqGSIb3DQEBBQUAA4IBAQCLkNba9LSpCTOh7Ws3h18WSKQXVxnLHxWUepC8 ZG3Q/dT++L54EiyBLmXwnr67gfUPhN1Qb/v1ixThlNBIjIrOZvEiyqjrmrQBABpt x0+APW8TAdYfslQvGfhDptNeKWoYc7fxlxw3TXwQf2JhL+a10m2ZeEMSg1iuIyqg +Dq3jGCb3R66NoKo/ToO5J6CAnkG7spYiDNukkvoEPNKaqXMC3K6pOzBDQwWBpH7 pCE9dEqbmHvUb+hwvI2OTJAKcM0G1wBmFF7au1G9e6O9hj34voppLdfVz5+mu5ai ELgGQXpVrFPSzZG0PyAr5rxtOI8E7yl7jl2pu7yXk9jgsiWl -----END CERTIFICATE-----

Computer Center, CS, NCTU 32 View the content of Certificate – (2)  % openssl x509 -text -in host-crt-file Certificate: Data: Signature Algorithm: sha1WithRSAEncryption Issuer: C=TW, ST=Taiwan, L=HsinChu, O=NCTU, OU=CS, CN=../ Address=.. Validity... Subject: C=TW, ST=Taiwan, L=HsinChu, O=NCTU, OU=CS, CN=../ Address=. Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): Exponent: (0x10001) X509v3 extensions: Signature Algorithm: sha1WithRSAEncryption 8b:90:d6:da:f4:b4:a9:09:33:a1:ed:6b:37:87:5f:16:48:a4: e0:b2:25:a BEGIN CERTIFICATE----- MIIE0DCCA7igAwIBAgIJAL5UBzbv+hl1MA0GCSqGSIb3DQEBBQUAMIGgMQswCQYD ELgGQXpVrFPSzZG0PyAr5rxtOI8E7yl7jl2pu7yXk9jgsiWl -----END CERTIFICATE-----

Appendix

Computer Center, CS, NCTU 34 PGP – Pretty Good Privacy  security/gnupg GNU’s Privacy Guard  Public-key system Encryption Signature Use with mutt    Ref: