Open Source eid Projects



Similar documents
The Belgian e-id: hacker vs developer

Digital Signature Service. e-contract.be BVBA 2 september 2015

Web Application Entity Session Management using the eid Card Frank Cornelis 03/03/2010. Fedict All rights reserved

eid Security Frank Cornelis Architect eid fedict All rights reserved

Programming with cryptography

PAdES signatures in itext and the road ahead. Paulo Soares

Digital Signature Service. version : 4.7-SNAPSHOT

Digital Certificates (Public Key Infrastructure) Reshma Afshar Indiana State University

An introduction to EJBCA and SignServer

<Insert Picture Here> Oracle Security Developer Tools (OSDT) August 2008

Electronic Signature. István Zsolt BERTA Public Key Cryptographic Primi4ves

Server based signature service. Overview

Digital Signature Verification using Historic Data

Exploring ADSS Server Signing Services

Digital Signature Service. version :

White Paper. Digital signatures from the cloud Basics and Applications

Certificate technology on Pulse Secure Access

CALIFORNIA SOFTWARE LABS

Certificate technology on Junos Pulse Secure Access

Submitted to the EC on 03/06/2012. COMPETITIVENESS AND INNOVATION FRAMEWORK PROGRAMME ICT Policy Support Programme (ICT PSP) e-codex

Introducing etoken. What is etoken?

Secure web transactions system

Digital Certificates Demystified

Certificate Path Validation

Overview of CSS SSL. SSL Cryptography Overview CHAPTER

Digital Signatures in a PDF

Enhancing Web Application Security

CS 356 Lecture 28 Internet Authentication. Spring 2013

Technical Description. DigitalSign 3.1. State of the art legally valid electronic signature. The best, most secure and complete software for

associate professor BME Híradástechnikai Tanszék Lab of Cryptography and System Security (CrySyS)

Overview. SSL Cryptography Overview CHAPTER 1

ISA 562 Information System Security

This Working Paper provides an introduction to the web services security standards.

Certification Authority. The X.509 standard, PKI and electronic documents. X.509 certificates. X.509 version 3. Critical extensions.

Configuring Digital Certificates

Brocade Engineering. PKI Tutorial. Jim Kleinsteiber. February 6, Page 1

CERTIFICATION PRACTICE STATEMENT UPDATE

X.509 Certificate Generator User Manual

In accordance with article 11 of the Law on Electronic Signature (Official Gazette of the Republic of Serbia No. 135/04), REGULATION

mod_ssl Cryptographic Techniques

SBClient SSL. Ehab AbuShmais

Advanced Electronic Signature

Enabling SSL and Client Certificates on the SAP J2EE Engine

SSL: Secure Socket Layer

DEPARTMENT OF DEFENSE PUBLIC KEY INFRASTRUCTURE EXTERNAL CERTIFICATION AUTHORITY MASTER TEST PLAN VERSION 1.0

Network Automation 9.22 Features: RIM and PKI Authentication July 31, 2013

ERserver. iseries. Secure Sockets Layer (SSL)

OpenADR 2.0 Security. Jim Zuber, CTO QualityLogic, Inc.

Standardizing PKI in Higher Education Apple PKI and Universal Hi-Ed Spec proposal

Cartão de Cidadão: Autenticação de Papéis do Cidadão

Secure Socket Layer (SSL) and Trnasport Layer Security (TLS)

How to Time Stamp PDF and Microsoft Office 2010/2013 Documents with the Time Stamp Server

JVA-122. Secure Java Web Development

Communication Security for Applications

OASIS Standard Digital Signature Services (DSS) Assures Authenticity of Data for Web Services

SSL Secure Socket Layer

TrustedX - PKI Authentication. Whitepaper

Displaying SSL Certificate and Key Pair Information

Red Hat Identity Management. Certificate System Technical Overview

e-szigno Digital Signature Application

Asymmetric cryptosystems fundamental problem: authentication of public keys

Certificates and network security

ETSI TS V1.1.2 ( ) Technical Specification

ETSI TS V1.1.1 ( ) Technical Specification

Secure Socket Layer. Carlo U. Nicola, SGI FHNW With extracts from publications of : William Stallings.

Making Digital Signatures Work across National Borders

Certificate Management. PAN-OS Administrator s Guide. Version 7.0

Angel Dichev RIG, SAP Labs

LinShare project version 0.8 File sharing and vault application

OFFICE OF THE CONTROLLER OF CERTIFICATION AUTHORITIES TECHNICAL REQUIREMENTS FOR AUDIT OF CERTIFICATION AUTHORITIES

ETSI TS V1.1.1 ( ) Technical Specification

Outline. Transport Layer Security (TLS) Security Protocols (bmevihim132)

CSCE 465 Computer & Network Security

WIRELESS LAN SECURITY FUNDAMENTALS

Chapter 4. Authentication Applications. COSC 490 Network Security Annie Lu 1

UNDERSTANDING PKI: CONCEPTS, STANDARDS, AND DEPLOYMENT CONSIDERATIONS, 2ND EDITION

Security Engineering Part III Network Security. Security Protocols (I): SSL/TLS

SSL Protect your users, start with yourself

Best prac*ces in Cer*fying and Signing PDFs

Global eid Developments. Detlef Eckert Chief Security Advisor Microsoft Europe, Middle East, and Africa

Lecture 13. Public Key Distribution (certification) PK-based Needham-Schroeder TTP. 3. [N a, A] PKb 6. [N a, N b ] PKa. 7.

Introduction to Cryptography

TechNote 0006: Digital Signatures in PDF/A-1

PUBLIC Secure Login for SAP Single Sign-On Implementation Guide

Understanding digital certificates

Using etoken for SSL Web Authentication. SSL V3.0 Overview

Apple Inc. Certification Authority Certification Practice Statement Worldwide Developer Relations Version 1.14 Effective Date: September 9, 2015

Certificate Policy for. SSL Client & S/MIME Certificates

Introduction...3 Terms in this Document...3 Conditions for Secure Operation...3 Requirements...3 Key Generation Requirements...

User Guide Supplement. S/MIME Support Package for BlackBerry Smartphones BlackBerry Pearl 8100 Series

Specifying the content and formal specifications of document formats for QES

Web Services Security: What s Required To Secure A Service-Oriented Architecture. An Oracle White Paper January 2008

Public-Key Infrastructure

Web Security Considerations

SAFE Digital Signatures in PDF

7 Key Management and PKIs

Certificates. Noah Zani, Tim Strasser, Andrés Baumeler

[SMO-SFO-ICO-PE-046-GU-

Transcription:

Open Source eid Projects RMLL Frank Cornelis 10/07/2013

Agenda Overview eid Cryptography in Java via JCA RSA, PKI, jtrust, eid Trust Service Integration levels for eid eid Applet Commons eid eid Identity Provider eid Digital Signature Service

eid Functionality Identification Who are you? Authentication Can you prove who you are? Digital signatures Proof of statement made in time

The Belgian eid Card Physical Structure Logical Structure eid Card Crypto (RSA) CPU ROM (operating system) EEPROM (file system) RAM (memory) APDU Belgian eid Card JavaCard Applet JavaCard Virtual Machine Basic Operating System Infineon Chip (SLE66CX322P)

eid Card Content PKI Authentication RSA key + Cert Non-repudiation RSA key + Cert Root CA Certificate Citizen CA Certificate Citizen Identity Data Photo Identity File Address File Identity File NRN Signature Address File NRN Signature NRN Certificate PKCS#15 file structure

Cryptography Encryption/decryption Symmetric: AES Asymmetric: RSA Digital signatures RSA Hash functions SHA256 MAC Threshold crypto...

Symmetric encryption K Hello world E #%f8kdi%d D Hello world KeyGenerator keygenerator = KeyGenerator.getInstance("AES"); keygenerator.init(128); SecretKey secretkey = keygenerator.generatekey(); byte[] message = "hello world".getbytes(); Cipher cipher = Cipher.getInstance("AES"); cipher.init(cipher.encrypt_mode, secretkey); byte[] encryptedmessage = cipher.dofinal(message); cipher.init(cipher.decrypt_mode, secretkey); byte[] result = cipher.dofinal(encryptedmessage);

Asymmetric encryption G K K Hello world E #%f8kdi%d D Hello world KeyPairGenerator keypairgenerator = KeyPairGenerator.getInstance("RSA"); keypairgenerator.initialize(1024); KeyPair keypair = keypairgenerator.genkeypair(); byte[] message = "hello world".getbytes(); Cipher cipher = Cipher.getInstance("RSA"); cipher.init(cipher.encrypt_mode, keypair.getpublic()); byte[] encryptedmessage = cipher.dofinal(message); cipher.init(cipher.decrypt_mode, keypair.getprivate()); byte[] result = cipher.dofinal(encryptedmessage);

Hash Functions Hello world H #%f8kdi%d Another message H byte[] message = "hello world".getbytes(); MessageDigest messagedigest = MessageDigest.getInstance("SHA256"); messagedigest.update(message); byte[] result = messagedigest.digest();

Digital Signatures G K K Hello world S #%f8kdi%d V true/false KeyPairGenerator keypairgenerator = KeyPairGenerator.getInstance("RSA"); keypairgenerator.initialize(1024); KeyPair keypair = keypairgenerator.genkeypair(); byte[] message = "hello world".getbytes(); Signature signature = Signature.getInstance("SHA1withRSA"); signature.initsign(keypair.getprivate()); signature.update(message); byte[] signaturevalue = signature.sign(); signature.initverify(keypair.getpublic()); signature.update(message); boolean result = signature.verify(signaturevalue);

RSA group G, : a G :a G =e G a t G +1 =a n= p q (Miller-Rabin) Z n ={a Z n :a n}is a group Z n =ϕ(n)=( p 1)(q 1) e ϕ(n) d : ed 1(mod ϕ(n)) public key : K + = e,n private key : K = d,n a Z n :c a e (mod n) c d (a e ) d a t ϕ(n)+1 a(mod n) with cipher text c

PKCS#1 Textbook RSA has some problems: Common modulus Blinding Low public exponent PKCS#1 introduces padding,... 00 01 ff ff ff... ff ff ff 00 DigestInfo(OID, #) RSAPublicKey publickey = (RSAPublicKey) certificate.getpublickey(); BigInteger signaturevaluebiginteger = new BigInteger(signatureValue); BigInteger messagebiginteger = signaturevaluebiginteger.modpow( publickey.getpublicexponent(), publickey.getmodulus()); c e (mod n)

ASN.1 & DER Abstract Syntax Notation One FullName ::= SEQUENCE { Name IA5String GivenName IA5String } Distinguished Encoding Rules 30 0a 16 3 f o o 16 3 b a r Implementation: BouncyCastle

PKI K K? K K CA K signs X509 certificate K begin, end key purpose... K

Certificate Life Cycle Key generation CSR? K Certificate Suspended Valid Revoked Expired

Certificate Status CRL: Certificate Revocation List Contains serial numbers of revoked certs Signed by the CA Issued periodically Online Certificate Status Protocol Online query for certificate status Signed by the CA OCSP Responder

eid PKI Infrastructure GlobalSign CA Cert Root CA Cert same key Root CA Cert CRL Citizen CA Cert Gov CA Cert OCSP Responder CRL CRL eid Cert SSL Cert

X509 Validation: jtrust Alternative to Java Cert Path API Java library with flexible architecture Readable code Certificate[] authncertificatechain =... Security.addProvider(new BouncyCastleProvider()); TrustValidator trustvalidator = BelgianTrustValidatorFactory.createTrustValidator(); trustvalidator.istrusted(authncertificatechain);

jtrust Architecture Root CA CRL Set of Trust Points Public Key Trust Linker Certificate Repository CRL Trust Linker CRL Repo Trust Validator List of Trust Linkers OCSP Trust Linker OCSP Repo List of Cert Constraints Fallback Trust Linker eid Trust Service CRL Cache Trust Linker OCSP Responder

X509 Validation: jtrust

X509 Validation: Trust Service jtrust extension: CRL cache (Java EE) XKMS2 web service interface Java SDK List<X509Certificate> authncertificatechain =... XKMS2Client client = new XKMS2Client( "https://www.e-contract.be/eid-trust-service-ws/xkms2"); client.validate("be-auth", authncertificatechain);

eid Trust Service Architecture SOAP XKMS Web Portal Relying Party Applications Trust Service Model Belgian Citizen CRL Cache DBMS Admin Portal jtrust eid TSL Tool PKI Trust Service Admin OCSP CA CRL TSL Service Directive EC

X509 Validation: Trust Service

Bootstrapping Trust Trusted Lists & List of Trusted Lists (LoTL) Dynamic updating of the EU trust realm Bootstrapping reduced to a single key EC LoTL LoTL Signing Key BE TL NL TL TL Root CA Root CA2...

Trusted List Belgium

eid Web Integration authentication identification signatures SSL IdP DSS Middleware Applet PC/SC CCID USB Smart card reader eid

eid Desktop Integration authentication identification signatures PKCS#11 Commons eid Middleware PC/SC CCID USB Smart card reader eid

PC/SC TerminalFactory terminalfactory = TerminalFactory.getDefault(); CardTerminals cardterminals = terminalfactory.terminals(); CardTerminal cardterminal = cardterminals.list().get(0); Card card = cardterminal.connect("t=0"); CardChannel cardchannel = card.getbasicchannel(); // select file cardchannel.transmit(new CommandAPDU(0x00, 0xA4, 0x08, 0x0C, new byte[] { 0x3F, 0x00, (byte) 0xDF, 0x01, 0x40, 0x35 })); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int offset = 0; ResponseAPDU responseapdu; do { // read binary responseapdu = cardchannel.transmit(new CommandAPDU(0x00, 0xB0, offset >> 8, offset & 0xFF, 0xff)); baos.write(responseapdu.getdata()); offset += responseapdu.getdata().length; } while (responseapdu.getdata().length == 0xff); BufferedImage photo = ImageIO.read(new ByteArrayInputStream(baos.toByteArray())); JOptionPane.showMessageDialog(null, new ImageIcon(photo));

eid Applet Web Browser Web Container Web Page 1 eid Applet 2 eid Applet Service 3 SPI 5 4 3 Target Page HTTP Session Service Implementation 6 jtrust eid Applet Service targets Java EE servlet container only

eid Applet Example identify-the-user.html <script src="https://www.java.com/js/deployjava.js"></script> <script> var attributes = { code :'be.fedict.eid.applet.applet.class', archive :'eid-applet-package-1.1.0.beta4.jar', width :600, height :300 }; var parameters = { TargetPage :'identification-result-page.jsp', AppletService :'applet-service', }; var version = '1.6'; deployjava.runapplet(attributes, parameters, version); identification-result-page.jsp </script> <%@page import="be.fedict.eid.applet.service.identity"%> <html> <body> <%=((Identity) session.getattribute("eid.identity")).name%> </body> </html> web.xml <servlet> <servlet-name>appletserviceservlet</servlet-name> <servlet-class>be.fedict.eid.applet.service.appletserviceservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>appletserviceservlet</servlet-name> <url-pattern>/applet-service</url-pattern> </servlet-mapping>

eid Applet

eid Applet

Commons eid eid MW 3.5 eid MW 4.0 eid Applet eid Viewer Commons eid eid Viewer 2.0 eid Applet 2.0 JCA

Commons eid Components commons-eid-client commons-eid-dialogs commons-eid-jca commons-eid-consumer Desktop: commons-eid-jca, or lower-level Client-Server: Client: commons-eid-client, dialogs Server: commons-eid-consumer

BeID JCA Security Provider KeyStore Load key material Signature Targeting eid key material SecureRandom eid based hardware secure random X509KeyManager eid based mutual SSL Security.addProvider(new BeIDProvider());

JCA KeyStore Security.addProvider(new BeIDProvider()); KeyStore keystore = KeyStore.getInstance("BeID"); keystore.load(null); PrivateKeyEntry privatekeyentry = (PrivateKeyEntry) keystore.getentry("authentication", null); PrivateKey privatekey = privatekeyentry.getprivatekey(); X509Certificate certificate = (X509Certificate) privatekeyentry.getcertificate(); PublicKey publickey = certificate.getpublickey();

JCA Signatures Supported algorithms: SHA 1/224/256/384/512 NONE RIPEMD 128/160/256 Delegate init: SupportedKeyClasses Signature signature = Signature.getInstance("SHA256withRSA"); signature.initsign(privatekey); asserttrue(signature.getprovider() instanceof BeIDProvider); final byte[] tobesigned = "hello world".getbytes(); signature.update(tobesigned); final byte[] signaturevalue = signature.sign();

Mutual SSL Alice HelloClient(ciphers,Ra) HelloServer(cipher,Rb) Certificate(cert chain) CertificateRequest,ServerHelloDone Certificate(cert chain) ClientKeyExchange {pre_master_secret}kb+ Bob Ra: random by A Rb: random by B Kb+: public key of B pre_master_secret: random by A Ka-: private key of A PRF: pseudo-random function CertificateVerify sign_ka-(handshake_msgs) ChangeCipherSpec ClientFinish (encrypted) PRF(master_secret,handshake_msgs) ChangeCipherSpec ServerFinish (encrypted) PRF(master_secret,handshake_msgs)

Commons eid: SSL Security.addProvider(new BeIDProvider()); KeyManagerFactory keymanagerfactory = KeyManagerFactory.getInstance("BeID"); BeIDManagerFactoryParameters spec = new BeIDManagerFactoryParameters(); spec.setautorecovery(true); spec.setcardreaderstickiness(true); keymanagerfactory.init(spec); SecureRandom securerandom = new SecureRandom(); sslcontext.init( keymanagerfactory.getkeymanagers(), null, securerandom); SSLSocketFactory sslsocketfactory = sslcontext.getsocketfactory();

Commons eid Identification Via lower-level API: Synchronous Asynchronous: event driven BeIDCards beidcards = new BeIDCards(); BeIDCard beidcard = beidcards.getonebeidcard(); byte[] photodata = beidcard.readfile(filetype.photo); BufferedImage photo = ImageIO.read( new ByteArrayInputStream(photoData)); JOptionPane.showMessageDialog(null, new ImageIcon(photo));

Commons eid: events BeIDCardManager beidcardmanager = new BeIDCardManager(); final JLabel label = new JLabel(); beidcardmanager.addbeidcardeventlistener(new BeIDCardEventsListener() { @Override public void eidcardremoved(cardterminal cardterminal, BeIDCard card) { label.settext("insert card..."); } @Override public void eidcardinserted(cardterminal cardterminal, BeIDCard card) { try { Address address = TlvParser.parse( card.readfile(filetype.address), Address.class); label.settext(address.municipality); } catch (Exception e) { label.settext("error"); } } @Override public void eidcardeventsinitialized() { } }); beidcardmanager.start(); JOptionPane.showMessageDialog(null, label);

eid Identity Provider Supports different OPEN authentication protocols: OpenID 2.0: PHP, Drupal,... SAML2 Browser POST: Java EE,... WS-Federation: ASP.NET,... Offers 3 eid based flows: Identification Authentication Identification combined with authentication Configurable Relying Parties via admin console Comes in JBoss AS 6.1 distributions: MySQL, PostgreSQL, Oracle

Authentication Protocols Client Browser Relying Party eid IdP visit site Association request Authentication request (Browser POST/Redirect) Authenticate/Identify User via eid Authentication response (Browser POST/Redirect) Hello Alice Artifact Binding

eid Identity Provider

eid Identity Provider

WebScarab Plugins

Identity and Access Management eid Trust Service GSM IdP Federal Token IdP eid Applet eid IdP Token Binder IdP Attribute IdP LDAP Roles IdP SSO IdP Service Provider

eid DSS Relying Party Web Application Citizen Sign a document Verify signatures on a document Sign a document Verify signatures on a document eid Digital Signature Service eid Digital Signature Service Portal eid DSS Admin Portal Administrator

eid DSS Work flow Upload Document Add Signature... View Document View Document Signatures Download Document Sign Document eid DSS Intuitive handling of multiple co-signatures

eid DSS Protocol Flow Client Browser Relying Party eid DSS Visit site Signature Request Sign document using eid Signature Response Verify Signature Verification: OASIS DSS SOAP Web Service Creation: proprietary protocol for the moment Work in progress on OASIS DSS-X Local Signature Computation DSS Profile

eid DSS Architecture Relying Party Applications eid DSS Portal Belgian Citizen eid DSS Webapp OASIS DSS Validation Web Service eid Applet eid DSS Admin Portal eid DSS Core eid Applet Service Signer eid DSS Admin eid Trust Service XKMS2 Web Service TSP Service

Signature Types: EU Directive 1999/93/EC Electronic Signature Advanced Electronic Signatures Digital Signatures Qualified Electronic Signatures QC Qualified Electronic Signatures with SSCD eid Did Alice sign document D at time t???

eid Signatures Signature Verifier Verification Time Authentication Signature verifier = signature requestor Instantly Non-repudiation Signature verifier most likely not the signature requestor/creator. Most likely long after signature creation, certificate might already be revoked/expired. Legal aspects None required Court might assign an expert to analyze the signature. Advanced Electronic Signatures thus require an open and self-contained signature format. Availability of independent implementations.

Signature Formats PKCS#1 W3C XML Signatures CMS RFC 3852 PDF ISO 32000-1 XAdES ETSI TS 101 903 V1.4.2 CAdES ETSI TS 101 733 V2.1.1 PAdES LTV ETSI TS 102 778-4 V1.1.2 XAdES Baseline Profile ETSI TS 103 171 V2.1.1 CAdES Baseline Profile ETSI TS 103 173 V2.1.1 PAdES Baseline Profile ETSI TS 103 172 V2.1.1 OASIS DSS-X DSS Extension for Local Signature Computation OASIS DSS

eid DSS Document Formats ODF documents Native ODF signatures: XAdES-X-L v1.4.2 Valid signatures in OpenOffice 3.2 OOXML documents Native OOXML signatures: XAdES-X-L v1.4.2 Valid signatures in MS Office 2007/2010 XML documents Co-signatures: XAdES-X-L v1.4.2 ZIP container

Signature Format versus Document Format XAdES CAdES PAdES XML Native Container Container ODF Native Container Container OOXML Native Container Container Binary Container Native Container PDF Container Container Native Native: document format has native support for the signature format. Container: the document format has no support for the signature format. Thus we need to construct a document container suited for the given signature format. Only XAdES is versatile towards doc formats.

eid DSS: XML document format Business Domain Specific Language in XML Example: a financial transaction

eid DSS: XML document format The application uses eid DSS to sign the XML

Q&A https://www.e-contract.be https://code.google.com/p/eid-applet/ https://code.google.com/p/eid-idp/ https://code.google.com/p/eid-dss/ https://code.google.com/p/eid-trust-service/ https://code.google.com/p/commons-eid/ https://code.google.com/p/eid-mw/