Notes - MCS
Secure Execution Environments
Notes - MCS
Secure Execution Environments
  • Secure Execution Environments
  • Introduction
    • Trusted Computing Base (TCB)
    • TEE (Trusted Execution Environment)
    • Can you trust the operating system?
  • Security in Operating Systems
    • Operating system
    • Virtual machines and hypervisors
    • Computational model
    • Access control
    • Protection with capabilities
    • Unix file protection ACLs
    • Windows NTFS file protection
    • Unix file protection ACLs
    • Privilege elevation
    • Privilege reduction
    • Linux login
  • Virtualization on Intel Processors
    • Modes of Operation
    • Virtual memory
    • How to put assembly instructions inside C code
    • A more elaborate example
    • Useful assembly instructions
  • Intel Software Guard Extensions
    • What is SGX (Software Guard eXtensions)?
    • SGX Enclave Memory
    • Guidelines for designing applications using SGX
    • Performance Overhead
    • SDK compilation modes
    • Writing Enclave Functions
  • ARM TrustZone
    • SoC and IP
    • ARM TrustZone
    • Worlds
    • Architecture
    • TrustZone bootstrap
  • Linux Kernel Namespaces
    • Namespaces
    • Advantages
    • Process Namespace
    • Network namespace
    • Mount namespace
    • UTS namespace
    • User namespace
  • LXC Linux Containers
    • Container
    • LXC containers
  • AppArmor
    • Purpose
    • Enforcement
    • Benefits
    • Attack prevention
    • Enforcement policies
    • Enforcement modes
    • Logging and auditing
    • Profiles
  • TPM (Trusted Platform Module)
    • Trusted Platform Module (TPM)
    • History
    • Cryptographic Concepts
    • Use cases
    • TPM Software Stack (TSS)
    • TPM concepts
    • Entities
    • Key management
    • Restrict signatures
    • Sessions
    • Authorization roles
  • Bootstrap security
    • AEGIS
    • Trusted computing
    • Root of Trust Measurements
    • Trusted Computing Platform Alliance (TCPA)
    • TPM-based attestation
    • Trusted Platform identity credentials
    • UEFI (Unified Extensible Firmware Interface)
    • NSA Boot Security
    • UEFI secure boot & TPM measurements
    • Intel Trusted Execution Technology (TXT)
    • Smartcards
      • Java Cards
      • OpenCard Framework (OCF)
      • Cryptographic services
Powered by GitBook
On this page
  • Definition
  • Interface
  • Components
  • CPU
  • ROM
  • EEPROM
  • RAM
  • Mechanical contacts
  • Physical security
  • Smartcard applications: Communication protocol stack
  • T=0 and T=1
  • APDU (ISO 7816-4)
  • Encoding objects in smartcards
  • TLV and ASN.1 BER
  • File system
  • File system types
  • Access control
  1. Bootstrap security

Smartcards

Last updated 10 months ago

Definition

Card with computing processing capabilities.

  • CPU

  • ROM

  • EEPROM

  • RAM

Interface

  • With contact

  • Contactless

Components

CPU

  • 8/16 bit

  • Crypto-coprocessor (opt.)

ROM

  • Operating system

  • Communication

  • Cryptographic algorithms

EEPROM

  • File system

    • Programs/applications

    • Keys/passwords

RAM

  • Transient data

    • Erased on power off

Mechanical contacts

  • ISO 7816-2

    • Power

    • Soft reset

    • Clock

    • Half duplex I/O

Physical security

  • Tamperproof case

  • Resistance to side-channel attacks

Smartcard applications: Communication protocol stack

T=0 and T=1

T=0

  • Each byte is transmitted separately

  • Slower

T=1

  • Blocks of bytes transmitted

  • Faster

ATR (ISO 7816-3)

  • Response of the card to a reset operation

  • Reports the protocol expected by the card

APDU (ISO 7816-4)

Command APDU (first block)

  • CLA (1 byte)

    • Class of the instruction

  • INS (1 byte)

    • Command

  • P1 and P2 (2 bytes)

    • Command-specific parameters

  • Lc

    • Length of the optional command data

  • Le

    • Length of data expected in subsequent Response APDU

    • Zero (0) means all data available

Response APDU (second block)

  • SW1 and SW2 (2 bytes)

    • Status bytes

    • 0x9000 means SUCCESS

Encoding objects in smartcards

TLV and ASN.1 BER

Tag-Length-Value (TLV)

  • Object description with a tag value, the length of its contents and the contents

  • Each element of TLV is encoded according to ASN.1 BER

Values can contain other TLV objects

  • The structure can be recursive

File system

File identification.

  • Name or number

File types

  • Master File (MF)

    • File system root, ID 0x3F00

  • Dedicated File (DF)

    • Like a directory

    • Can obtain other EFs or DF

  • Elementary File (EF)

    • Ordinary data file

    • File size fixed and determined when created

File system types

Transparent

  • Data blocks identified by offset + length

Fixed records

  • Indexed records

Variable records

  • Indexed records

Cyclic

  • Read pointer, write pointer

  • Cyclic increments

Access control

No restrictions

Protected

  • The file access APDU must contain a MAC computed with a key shared between the card an the off-card application

External authentication

  • The file access APDU is only allowed if the card already checked the existence of a common shared key with the off-card application

  • Previous login