Introduction to PKI Based Application Development cyber Security Div' , NIC HQ - PowerPoint PPT Presentation

1 / 78
About This Presentation
Title:

Introduction to PKI Based Application Development cyber Security Div' , NIC HQ

Description:

Windows 95/98 with Internet Explorer 5 or later. Windows NT 4.0 with SP4 Windows 2000. Windows XP ... JCA(Java cryptographic Architecture) ... – PowerPoint PPT presentation

Number of Views:231
Avg rating:3.0/5.0
Slides: 79
Provided by: nic578
Category:

less

Transcript and Presenter's Notes

Title: Introduction to PKI Based Application Development cyber Security Div' , NIC HQ


1
Introduction to PKI Based Application
Development cyber Security Div. , NIC HQ
2
An Introduction to Public key cryptography (PKC)

3
PKC is based on the following security techniques
  • Authentication
  • Confidentiality
  • Integrity
  • Non-repudiation

4
Symmetric-key Cryptography
  • Data encrypted and decrypted with same key
  • Classical examples Caesar cipher, one-time pad,
    Enigma Machine

5
Asymmetric Key Encryption
  • Important to know who should know which key(s)
  • In general
  • Sender encrypts with recipients public key
  • Recipient decrypts with its private key

6
Matrix of Keys
7
Asymmetric Key Cryptography
8
Asymmetric Key Example
  • Consider a bank and its customers
  • Customers encrypt their messages with banks
    public key
  • Bank decrypts messages with its private key

9
Asymmetric Key Cryptography Example
10
Public Key Cryptography
  • Each user has a key pair, consisting of a public
    and private key
  • Anything encrypted with one key may only be
    decrypted by the other.
  • To make message readable only by B, encrypt
    message using B's public key

11
Digital Signature Concept
  • Sender encrypts message or its fingerprint with
    its private key
  • Guarantees that only the sender could have
    created this message
  • Basis for Non-repudiation

12
Basis for Digital Signatures
13
Digital Signatures
Signature Generation
Signature Verification
14
Message Digest Concept
  • Also called as Hash
  • Unique representation of a message
  • Similar to finger print of a human

15
Message Digest Concept
16
Message Digest Demands - 1
17
Message Digest Demands - 2
18
Message Digest Demands - 3
19
Message Digest Differences
  • Even if the original messages differ minutely,
    message digests differ dramatically
  • Basis for the guarantee of uniqueness

20
Message Digest Example
21
Message Digest Algorithms
  • Basic principle Take the original message, and
    reduce it to a smaller fingerprint
  • Examples MD5, SHA-1
  • SHA-1 is considered stronger

22
Cryptographic Hash Algorithms
  • Reduces a message to a fixed size message digest
  • used for authentication and integrity
  • digital signatures, with public key algorithms
  • Hashed Message Authentication Codes (HMAC) with
    secret key

23
Hash Standards
  • FIPS 180-1
  • SHA-1 160-bit hash preferred hash algorithm
    today
  • FIPS 180-2 planned to include larger hash fields
  • SHA-1 (160-bit)
  • SHA-256
  • SHA-384
  • SHA-512

24
Digital ID ?
  • Binds a Subject with a key pair
  • Contents of a Digital ID
  • Certificate Serial Number
  • Subject
  • Issuer
  • Valid From
  • Valid To

25
Digital ID ?
  • Contents of a Digital ID
  • Public key
  • Key Usage
  • Basic Purpose of Key Digital Signature, Non
    Repudiation, CRL signing
  • Extended Key Usage
  • Secure Email, Server Authentication, Client
    Authentication, Code Signing, Time Stamping

26
Digital ID ?
  • Contents of a Digital ID
  • Thumbprint
  • The CAs signature validating the certificate
  • Thumbprint Algorithm

27
Developing PKI Applications
  • What is CAPICOM
  • Digital Signing with CAPICOM
  • Data Encryption with CAPICOM
  • Accessing Certificate Stores
  • Requesting and Installing Digital Certificate
  • Demo Digital Signing and Verification
  • Java Cryptography

28
What is CAPICOM?
  • CAPICOM is a new security technology from
    Microsoft
  • Allows an application developer to easily
    incorporate digital signing and encryption into
    an application
  • Built on top of MS CAPI
  • COM based for every one!
  • Visual Basic, Visual Basic script,ASP,C
  • Free!

29
Supported Platforms
  • Windows 95/98 with Internet Explorer 5 or later
  • Windows NT 4.0 with SP4
  • Windows 2000
  • Windows XP

30
How to install CAPICOM
  • Packaged as an ActiveX control
  • Have your app install and register it
  • Regsvr32 capicom.dll
  • Use in web application, installation and
    registration done automatically
  • One file, size 249 KB
  • Redistributable

31
What can CAPICOM do?
  • Digitally sign data
  • With software key, smart card, token
  • Uses PKCS7 for interop
  • Verify Digitally sign data
  • Check certificate revocation
  • Encrypt data
  • Uses a password
  • Uses a public key(for enveloping)
  • Access Certificate Stores
  • You dont have to use CAPICOM everywhere
  • Mix and match CAPICOM, CAPI and other toolkit

32
Digital signing in CAPICOM
33
Main Objects in Signing
  • Certificate
  • Represents an X.509 certificate
  • Signer
  • Represents a Signer
  • Authenticated attributes
  • Additional meta-data included with signature
  • Examples document name,description,signing time
  • Protected with the content by the signature
  • SignedData
  • Object used to sign data

34
Steps for Digitally Signing
  • Which certificate to use
  • Where to store the signature
  • More than one signer
  • How to validate a digital signature

35
Supported Certificates
  • Use any X.509 certificate
  • Issued from anywhere
  • From a certificate authority(NICCA,Verisign)
  • From Windows 2000 PKI
  • Use a self signed certificate
  • Use any device to store the private key
  • Can utilize whatever CAPI supports
  • Software keys
  • Smart cards
  • USB tokens

36
Which Certificate to use
  • Application can preselect
  • Enumerate Certificate in store and select
  • Let CAPICOM do it
  • If only one certificate, CAPICOM will use it
  • If more than one certificate, CAPICOM will pop
    certificate selection dialog

37
Certificate Selection Dialog
38
Certificate view Dialog
39
What Is A Signature?
40
Where to store SignatureAttached Signature
  • Signature stored as PKCS 7 format
  • Data stored with signature
  • Only one file to manage
  • Must extract the original data to use it
  • This is done through verify operation

41
Where to store SignatureDetached Signature
  • Data and signature stored seperately
  • Signature stored in PKCS 7 format
  • Both files are required to verify signature
  • Easier to store in separate fields in the
    database

42
More than one signer?
  • Can store one or more signature
  • SignedData.Sign() creates primary signature
  • Add other signature by calling SignedData.Cosign()
  • Cosigning is useful when multiple parties are
    signing a contract

43
Multiple signers, continued
  • Can also layer signature where one attached
    signature is input to another signing operation.
  • Inner signature cannot be removed.

44
Digital Signature Verification
  • Signature verification consists of
  • Integrity check on the signed message
  • Whether data changed?
  • Certificate chain must be valid
  • All certificates in chain can be found
  • No chaining errors
  • Revocation Check
  • Repeat for each signer

45
Certificate validity checking
  • SignedData.verify() does not do a revocation
    check.
  • Use CertificateStatus Object

46
Encryption in CAPICOM
47
Encryption
  • Two ways to encrypt data
  • Encrypt with a password
  • Symmetric encryption
  • Shared secret
  • Encrypt with a public key
  • Asymmetric encryption
  • Only recipients can decode message

48
Symmetric encryption
  • Encrypts with a password
  • Use a long password for better symmetric keys
  • Use a random salt
  • Supported algorithms
  • RC2(40 bit, 60 bit, or 128 bit)
  • RC4(40 bit, 60 bit, or 128 bit)
  • DES
  • Triple DES
  • Underlying platform must support the algorithms.

49
Symmetric Encryption
Decrypt with Symmetric Key
Encrypt with Symmetric Key
Encryption
Decryption
50
Data Enveloping
  • Combines symmetric and asymmetric encryption
  • Message encrypted with symmetric key because
    asymmetric encryption is slow
  • Symmetric key is encrypted using public key
    stored in recipients certificate
  • Recipients decode the symmetric key with their
    private key

51
Data EnvelopingStep one Encrypt message
52
Data Enveloping Step two encrypt the symmetric
key to the recipients
Step Two Encrypt the Symmetric Key to the
Recipients
Symmetric Key
Encryption
53
Data EnvelopingStep three Put it All together
54
Managing Certificate Stores
  • Named, permanent storage for a collection of
    certificates
  • Several predefined Stores
  • My store houses certificates with private keys
  • Root store houses trusted, self-signed
    certificates
  • Application can define their own
  • Logical stores and Physical stores
  • Each logical store has one or more physical store
  • HKLM\Software\Microsoft\SystemCertificates
  • Logical stores support inheritance

55
Logical, Physical stores and inheritance
  • User Root Store

Current User store inherits from Local Computer
store
56
Certificate Stores
  • Two viewing Tools
  • MMC certificate snap in(certmgr.msc)
  • Internet explorer certificate manager
  • Tools-gtoptions-gtContent-gtCertificates
  • CAPICOM
  • Store.open
  • Store Location(User, Machine, AD, Memory)
  • Store Name(user string or predefined constants)
  • Open mode read only, read-write

57
Demo Digital Signing and Verification
58
Cryptography with Java
  • Two main technologies are JCA AND JCE.
  • JCA is part of JRE
  • JCE is an extension to JCA
  • JCE adds simple encryption and decryption to JCA

59
JCA(Java cryptographic Architecture)
  • JCA is composed of number of classes in
    java.security package and its sub-packages.
  • Provides APIs for functions like digital
    signatures and message digests.
  • Important classes are MessageDigest, Signature,
    KeyPairGenerator etc

60
Message Digest Example
  • Import java.security.
  • //Use the MD5 algorithm
  • MessageDigest md MessageDigest.getInstance(MD5
    )
  • byte buf Message.getBytes()
  • //Update the data
  • Md.update(byte)
  • //after input is ready, digest the data
  • Byte digestBuf md.digest()

61
JCE(Java Cryptographic Ex tension)
  • JCE is an extension to JCA
  • JCE contains the classes in the javax.crypto
    package and its sub-packages
  • It includes classes like Cipher, KeyGenarator,
    Mac etc

62
Encryption example
  • import java.security.
  • import javax.crypto.
  • // Get the key Generator
  • KeyGenerator keyGenerator KeyGenerator.getInstan
    ce(Blowfish)
  • //Generate a key
  • Key key KeyGenerator.generateKey()
  • //Get the Cipher and initialise it with key

63
Encryption Example ctd.
  • Cipher cipher Cipher.getInstance(Blowfish/ECB/P
    KCS5Padding)
  • cipher.init(Cipher.ENCRYPT_MODE, key)
  • // assume data to encrypt is myData
  • Byte cipherText cipher.doFinal(myData)

64
Tour Management System
  • eTour
  • PKI Integration

65
Existing Procedure
  • Manual
  • Time Consuming
  • Management of Information
  • Reports , Locating information

66
eTour Features
  • Web enabled system
  • Workflow based system
  • Digital Signature enabled
  • Ensures integrity, authenticity and non
    repudiation
  • Connects to existing Directory Server for
    authentication
  • Supports Air as well as Train Travel
  • Mail alert at every stage

67
Roles supported
  • Initiating officer
  • HOD
  • HOG
  • DG
  • DDO

68
State Diagram Air Travel
HOD Forwards
HOG Forwards
Request Forwarded
Request Forwarded
  • Request
  • Initiated

DG Approves
DDO Processes
Request Processed
Request Approved
69
State Diagram Train Travel
HOD Forwards
DDO Processes
Request Processed
Request Approved
  • Request
  • Initiated

70
eTour Features
  • Initiating officer may initiate a request.
  • HOD may forward the request
  • HOG may forward the request
  • DG may approve the request
  • DDO may update the request
  • DDO may print the Tour Sheet
  • Multiple DDOs supported

71
Security features
  • Shows last logon date and time
  • Digital Signature
  • Certificate Based Logon Support
  • Automatic CRL download
  • User Certificate Mapping
  • Client side and server side validation
  • Configurable CAs

72
Tour Procedure Air Approval
  • Initiating officer fills up the form and submit
    it to HOD
  • HOD may forward it either to HOG or DG
  • HOD may forward
  • DG may finally approve

73
Tour Procedure Train Approval
  • Initiating officer fills up the form and submit
    it to HOD
  • HOD may approve

74
Login process
Auth with Directory
Application Server
Fetch registered Certificates.
Directory Authentication, Certificates
Submit auth info
Launch Application
Database Roles , Data , work flow
Client
75
Digital Signature Verification
Application Server
Fetch CRL
CA Repository
Submit Signed Form
Database
Client
76
Certificate Based Logon
Application Server
2. Fetch cert list
5. Verify Signature,check CRL log results.
6. Launch app / logout
Database
Directory
3. Send logon String to be signed , certificate
list and scripts
1. Submit login name
4. Sign and send login String
Client
77
Platform Information
Application Server Tomcat , JAVA , JSP on
windows 2000
LDAP,HTTP
CA Repository
Database SQL Server
Client IE , CAPICOM , JScript
78
Thank you!Cyber Security DivisionNIC HQ
Write a Comment
User Comments (0)
About PowerShow.com