PV204 Security technologies LABS

Slides:



Advertisements
Similar presentations
1 Security in Wireless Protocols Bluetooth, , ZigBee.
Advertisements

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.
Topic 7: Using cryptography in mobile computing. Cryptography basics: symmetric, public-key, hash function and digital signature Cryptography, describing.
CMSC 414 Computer and Network Security Lecture 17 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 16 Jonathan Katz.
SSH Secure Login Connections over the Internet
Masaryk U., Monet White-box attack resistant cryptography – mobility tickets Petr Švenda Masaryk University,
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Mar 18, 2003Mårten Trolin1 Agenda Parts that need to be secured Card authentication Key management.
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 21 – Network Security.
Cryptography and Network Security Chapter 14 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
SSL: Secure Socket Layer By: Mike Weissert. Overview Definition History & Background SSL Assurances SSL Session Problems Attacks & Defenses.
Security Handshake Pitfalls. Client Server Hello (K)
PV204 Security technologies Labs: Secure authentication and authorization Petr Švenda Faculty of Informatics, Masaryk.
Network Security Confidentiality Using Symmetric Encryption Chapter 7.
PV204 Security technologies
chownIoT Secure Handling of Smart Home IoT Devices Ownership Change
PV204 Security technologies
Hardware-rooted Trust for Secure Key Management & Transient Trust
Cryptography CS 555 Topic 34: SSL/TLS.
Symmetric Cryptography
PV204 Security technologies
PV204 Security technologies
Cryptography and Network Security
PV204 Security technologies LABS
Previous lecture – smart-cards
IT443 – Network Security Administration Instructor: Bo Sheng
Secure Sockets Layer (SSL)
Cryptographic Hash Function
e-Health Platform End 2 End encryption
A Wireless LAN Security Protocol
PV204 Security technologies
Encryption
Cryptography.
Presented by: Dr. Munam Ali Shah
CSE 4095 Transport Layer Security TLS, Part II
Cryptography and Network Security
Cryptography Lecture 12.
Cryptography Basics and Symmetric Cryptography
CS 465 TLS Last Updated: Oct 31, 2017.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
9.2 SECURE CHANNELS Medisetty Swathy.
Cryptography Lecture 10.
Asymmetric Cryptography
Security through Encryption
SSH: SECURE LOGIN CONNECTIONS OVER THE INTERNET
Assignment #4 – Solutions
Identity-based secure collaboration in wireless ad hoc networks
Security Of Wireless Sensor Networks
Lecture 4 - Cryptography
CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9
Agenda retrospective - B. Aboba Lunch
Workshop on algorithms and parameters for Electronic Signatures draft ETSI TS V ( ) November 25, Brussels.
Mobile Phone Technology
CDK: Chapter 7 TvS: Chapter 9
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Security of Wireless Sensor Networks
Cryptography Lecture 9.
Security in SDR & cognitive radio
Cryptography Lecture 9.
Cryptography Lecture 11.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Security Attacks, Mechanisms, and Services
Cryptography and Network Security
One-way Hash Function Network Security.
Chapter 8 roadmap 8.1 What is network security?
Symmetric Key Distribution
Key Exchange, Man-in-the-Middle Attack
Message Authentication
Presentation transcript:

PV204 Security technologies LABS Introduction to smart cards Petr Švenda svenda@fi.muni.cz Faculty of Informatics, Masaryk University

The masterplan for this lab Secure channel and smartcard communication Building Secure Channel protocol (together) simple protocol  design attack  fix it  iterate Communicate with smart card (GPPro tool) ATR, basic info, CPLC Communicate with card programmatically Java java.smartcardio.* or C/C++ PC/SC API CPLC data Obtain list of supported instructions from unknown card | PV204: Introduction to smart cards

1. Building Secure Channel protocol Scenario: we like to transfer extrasupersensitive data between PC and smartcard Simple protocol  design attack  fix it  iterate Participate in discussion (Steps and solution will be published after the labs in IS) | PV204: Introduction to smart cards

2. Communicate with smart card (GPPro) Contact PC/SC readers + cards GlobalPlatformPro tool https://github.com/martinpaljak/GlobalPlatformPro/releases Basic smart card commands, sending APDUs Management of GlobalPlatform cards (JavaCard) Type gp --help for all functionality We will use basic functionality now, rest next week | PV204: Introduction to smart cards

gp --info Obtain information about smart card Obtain ATR (Answer To Reset) Parse using https://smartcard-atr.appspot.com/parse?ATR=xxx Who is probable manufacturer of card? What is probable OS environment for this card? Is it JavaCard? What is card’s circuit serial number? When was card produced? | PV204: Introduction to smart cards

gp --apdu APDU_in_hexa --debug Send APDU command from command line Try gp --info --debug Can you spot APDU command to obtain CPLC info? Send get CPLC APDU separately gp --apdu 80CA9F7F --debug Can you relate card’s response data and gp --info? What is response status word? | PV204: Introduction to smart cards

3. Communicate with card programmatically SimpleAPDU project (IS, NetBeans) Uses Java’s javax.smartcardio.* API CardMngr.java – utility functions for card communication Obtain list of available readers List readers = TerminalFactory.getDefault().terminals().list(); Connect to card CardTerminal.isCardPresent(), CardTerminal.connect(“*”); Obtain ATR: Card.getATR().getBytes() Send APDU: ResponseAPDU resp = CardChannel.transmit(apdu) | PV204: Introduction to smart cards

3. Communicate with card programmatically Try to send get CPLC command Pre-prepared in GetCPLCData() method Necessary to set proper APDU Parse response buffer Can you relate card’s response data and gp --info? What is value of response status word? | PV204: Introduction to smart cards

Supported commands Card responds to some APDU commands Generic ones (e.g., get CPLC data) Custom ones (what card’s owner wants) Usually CLA/INS/P1 only (P2 sometimes) How to get list of commands supported by a card? Look into documentation / standard (e.g., SIM commands) Try to probe card (limited number of possible commands) Be careful – many failed attempts may block your card! | PV204: Introduction to smart cards

Obtain list of supported commands Write code that will try all combination if CLA/INS Observe response codes Make list of CLA/INS which returns interesting code Analyse with curiosity! | PV204: Introduction to smart cards

Solutions – kind of  | PV204: Introduction to smart cards

Building SCP – steps in solution Scenario: we like to transfer extrasupersensitive data between PC and smartcard Simple exchange in plaintext Encrypted by static symmetric key Integrity protection using plain hash Integrity protection using MAC (CBC-MAC,HMAC) Counter/Hash chain for message freshness and semantic security Authentication based on static key Challenge response for fresh authentication Session keys derived from master key(s) Forward secrecy based on RSA/DH | PV204: Introduction to smart cards

Building SCP – steps in solution Simple exchange in plaintext Many problems, attacker can eavesdrop sensitive data Encrypted by static symmetric key Attacker can modify sensitive data (no integrity) Integrity protection using plain hash Hash is not enough, attacker can modify then recompute hash Integrity protection using MAC (CBC-MAC,HMAC) Attacker can replay older message (no freshness) | PV204: Introduction to smart cards

Building SCP – steps in solution Counter/Hash chain for message freshness and semantic security No explicit authentication of parties Authentication based on static key Authentication message can be replayed from previous legit run Challenge response for fresh authentication Single static key can cause problems Interchange of encrypted message and valid MAC Large amount of data encrypted under same key (cryptoanalysis) | PV204: Introduction to smart cards

Building SCP – steps in solution Session keys derived from master key(s) If master keys are compromised, older captured communication can be decrypted Forward secrecy based on RSA/DH Secure? Key management with multiple parties? Proof of message origin? Deniability? … gather your requirements! | PV204: Introduction to smart cards

gp --info Who is probable manufacturer of card? Gemplus/Gemalto What is probable OS environment for this card? MPCOS Is it JavaCard? No What is card’s circuit serial number? ICSerialNumber: 02006FC1 (Note: your card will be different) Good to consider also other ICxxx values for uniqueness When was card produced? ICFabricationDate: 1105 Probably 15th May 2011 (105th day of year ending with 1) | PV204: Introduction to smart cards