Discovering OpenPGP Card



Similar documents
Ubuntu Open PGP IMPLEMENTATION. Dr. ENİS KARAARSLAN 2014

WiMAX Public Key Infrastructure (PKI) Users Overview

CLIENT DATABASE SECURITY

LiteCommerce Advanced Security Module. Version 2.8

Encrypting with KMail, Mozilla Thunderbird, and Evolution LOCK AND KEY BY FRAUKE OSTER

GPG installation and configuration

The KGpg Handbook. Jean-Baptiste Mardelle Rolf Eike Beer

E-CERT C ONTROL M ANAGER

GPG Tutorial. 1 Introduction. 2 Creating a signing and encryption keys. 3 Generating a revocation certicate. Andreas Hirt July 12, 2009

TrustKey Tool User Manual

File and encryption with GPG4win & Enigmail

PROXKey Tool User Manual

Tutorial: Encrypted with Thunderbird and Enigmail. Author: Shashank Areguli. Published: Ed (August 9, 2014)

Using Your PGP Tool to Update Your Address Settings for Encrypted Messaging

GoldKey Software. User s Manual. Revision WideBand Corporation Copyright WideBand Corporation. All Rights Reserved.

Encrypting and signing

Digital Signatures on iqmis User Access Request Form

1.2 Using the GPG Gen key Command

Shakambaree Technologies Pvt. Ltd.

INTRODUCTION TO CRYPTOGRAPHY

GPG - GNU Privacy Guard

How To Encrypt A Traveltrax Report On Gpg On A Pc Or Mac Or Mac (For A Free Download) On A Thumbdrive Or Ipad Or Ipa (For Free) On Pc Or Ipo (For An Ipo)

Smart Card Setup Guide

USB 2.0 Flash Drive User Manual

Introducing etoken. What is etoken?

Overview Keys. Overview

Two-factor authentication Free portable encryption for USB drive Hardware disk encryption Face recognition logon

Token User Guide. Version 1.0/ July 2013

Signing and Encryption with GnuPG

How to Encrypt your Windows 7 SDS Machine with Bitlocker

IBM Security Access Manager for Enterprise Single Sign-On Version User Guide IBM SC

How To Run A Password Manager On A 32 Bit Computer (For 64 Bit) On A 64 Bit Computer With A Password Logger (For 32 Bit) (For Linux) ( For 64 Bit (Foramd64) (Amd64 (For Pc

RFG Secure FTP. Web Interface

How to enable Disk Encryption on a laptop

SecureDoc Disk Encryption Cryptographic Engine

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

Signing and Encryption with GnuPG

How To Use 1Bay 1Bay From Awn.Net On A Pc Or Mac Or Ipad (For Pc Or Ipa) With A Network Box (For Mac) With An Ipad Or Ipod (For Ipad) With The

Open-Xchange Guard Major Release v Feature Overview V1.4

SEZ SEZ Online Manual Digital Signature Certficate [DSC] V Version 1.2

Trend Micro Incorporated reserves the right to make changes to this document and to the products described herein without notice.

1. Scope of Service. 1.1 About Boxcryptor Classic

GPG4win / Kleopatra Documentation. Secure file and encryption by using GnuPG for Windows

NetIQ Advanced Authentication Framework - Client. User's Guide. Version 5.1.0

How to use PGP Encryption with iscribe

Enterprise Erase LAN

Gnuk A Free Software USB Token Implementation Niibe Yutaka <gniibe@fsij.org>

Step by step guide how to password protect your USB flash drive

USER GUIDE WWPass Security for Windows Logon

MyUSBOnly User Guide Menu

Imation LOCK User Manual

SafeNet Authentication Client (Windows)

Outlook Web Access 2003 Remote User Guide

COMP 3704 Computer Security

SL-8800 HDCP 2.2 and HDCP 1.x Protocol Analyzer for HDMI User Guide

General tips for increasing the security of using First Investment Bank's internet banking

SafeNet Authentication Client (Mac)

The FlexiSchools Online Order Management System Installation Guide

Authentication. Computer Security. Authentication of People. High Quality Key. process of reliably verifying identity verification techniques

HP ProtectTools Embedded Security Guide

Encrypting your Communications using PGP

The Handbook V 1.8 Adaptations by Ludwig Hügelschäfer Based on Version 1 by Daniele Raffo with Patrick Brunschwig and Robert J. Hansen.

VMware Horizon Workspace Security Features WHITE PAPER

VMware Horizon FLEX User Guide

USER MANUAL. v Windows Client January

Contents. Identity Assurance (Scott Rea Dartmouth College) IdM Workshop, Brisbane Australia, August 19, 2008

DIGIPASS CertiID. Getting Started 3.1.0

HW/Lab 1: Security with PGP, and Crypto CS 336/536: Computer Network Security DUE 09/28/2015 (11am)

Guide how to protect your private data with Rohos Disk Encryption

USER GUIDE WWPass Security for (Outlook) For WWPass Security Pack 2.4

Encrypting with BitLocker for disk volumes under Windows 7

FAQ for USB Flash Drive

Secure Web Access Solution

VMware Horizon FLEX User Guide

BCTextEncoder Help File

ScoMIS Encryption Service

Yale Software Library

TPM. (Trusted Platform Module) Installation Guide V2.1

Yale Software Library

Yubico PIV Management Tools

Networks & Security Course. Web of Trust and Network Forensics

Secure Data Exchange Solution

Legal Notes. Regarding Trademarks. Models supported by the KX printer driver KYOCERA MITA Corporation

Here is a guide on how to encrypt a part of your USB flash drive and access it on any computer:

Sharp Remote Device Manager (SRDM) Server Software Setup Guide

Security in Android apps

Samsung Drive Manager FAQ

The GNU Privacy Handbook

After installation of Rohos Disk Encryption, insert your USB pen drive to the computer and run the Rohos Disk Encryption application.

PGP from: Cryptography and Network Security

Assessing the Security of Hardware-Based vs. Software-Based Encryption on USB Flash Drives

USER MANUAL DataLocker Enterprise

Imation Clip USB 2.0 Flash Drive. Imation Drive Manager Software. User s Manual

VPN Web Portal Usage Guide

What s New in Propalms VPN 3.5?

Reborn Card NET. User s Manual

How to Create and Maintain an Anonymous Identity Online

TPM. (Trusted Platform Module) Installation Guide V for Windows Vista

XCOM File Transfer. Specification

Transcription:

Discovering OpenPGP Card Dany Nativel (dany AT nativel DOT net) GPG Key fingerprint BFD5 345A 5DA1 F3AF DD85 D91F 956E 5AD2 E089 B922

How does GnuPG signature/decryption work? Clear Text/ Encrypted Text GnuPG Passphrase Private Key (encrypted) Signature/ Decrypted Data May 8, 2006 Discovering OpenPGP Card page 2

Where are the weak spots? Private Key : Malicious software (Trojans, worms) can copy and send your private key over the network Swap memory (disk) can leak private key material Backup media may contains your private key Passphrase : Keylogger Easy to forge : Just a file copy. You won't probably notice that your private key has been copied. Over-the-shoulder key grabbing Social engineering May 8, 2006 Discovering OpenPGP Card page 3

What happens if your secret key becomes public? Private key is encrypted, passphrase is required and could be obtained : Brute Force / Dictionary attack Keylogger Social engineering Hello Sir, this is GnuPG corp. we need your passphrase for verification purposes ;) With private key+passphrase, an attacker can : - Decrypt all messages (past and future)* - Sign keys and messages on your behalf* *Expiration date on keys can limit future operations May 8, 2006 Discovering OpenPGP Card page 4

How to protect your private key? Protect the key itself Prefer removable media (USB Flash key, floppy) Restrict access permissions on your keyring Keep backup in a safe (place) Protect the passphrase Use a good quality passphrase = LONG with mixed types (upper/lower/numbers..) Webmail, IM or other everyday's passwords Don't write it down..ever! No more post-it sticked on the back of your keyboard 4eR ^p@lap^3&_+/py7 May 8, 2006 Discovering OpenPGP Card page 5

Adapt security to your concerns Identity theft, quality of web of trust : Need to increase security for signing operations Protect your privacy, keep your secrets...secrets! Have your private key material stored in a Smart Card May 8, 2006 Discovering OpenPGP Card page 6

Strengthen security for signing Have different policies for signing keys/messages and decryption Dedicated computer running Linux (e.g. Live-CD) and no network connection May 8, 2006 Discovering OpenPGP Card page 7

OpenPGP card increases security Keeps your private key...private : Private key material never leaves the card Key can be generated on-card for ultimate security No memory swap leak Immunity to spywares and trojans Tamper evidence : Much more difficult to copy or forge a Smart Card You'll notice if someone tries as you no longer have the card in your hands Protection against brute force attack : Card locks down after three unsuccessful attempts Can be reset with Admin PIN Signature usage monitoring A signature counter provides provides valuable feedback May 8, 2006 Discovering OpenPGP Card page 8

OpenPGP Card Advantages Simplified GnuPG keyring management Can now be backup without any security concern Allows use of less trusted machines (a.k.a MS Win) On-card key generation possible for ultimate security Shorter password to remember Passphrase is now called PIN Provides additional services : SSH Login, PAM authentication Signature and PIN attempts counter Admin PIN Based on public OpenPGP Card specification Implemented by GnuPG's author himself (Werner Koch) May 8, 2006 Discovering OpenPGP Card page 9

OpenPGP Card Disadvantages Need a card and compatible Smart Card reader Export regulations limits diffusion of cryptographic hardware to several countries Not cheap (reader + card), limited portability Learning curve If you ever lose your card, you lose your private key Backup solutions exist Closed-source implementation of the card Bugs? Backdoor? Based on (closed-source) Basic Card OS Backdoor? May 8, 2006 Discovering OpenPGP Card page 10

OpenPGP Card features 3 independent 1024 bit RSA keys Signing, encryption,authentication Key generation on card or import of existing keys FIPS 140-1 Hardware Random Generator Signature counter Data objects for : Storing an URL to access the full OpenPGP public key Card holder name etc. Login specific data. Length of PIN between 6 and 254 characters Not restricted to numbers T=1 protocol; compatible with most readers. Specification freely available and usable without any constraints. Reasonably priced. May 8, 2006 Discovering OpenPGP Card page 11

Smart Card Reader Support CCID readers directly supported by GnuPG (e.g. USB SCM SCR335) Works out of the box. Requires libusb (http://prdownloads.sourceforge.net/libusb) CCID readers supported by pcsclite package Supports mosts CCID readers on the market http://pcsclite.alioth.debian.org/ccid.html Requires libusb (http://prdownloads.sourceforge.net/libusb) Requires libpcsclite (https://alioth.debian.org/projects/pcsclite/) Other Smart Card Readers (CTAPI Driver) Various drivers available (examples): libgempc410 PC/SC driver for the GemPC 410, 412, 413 and 415 smart libtowitoko2 : Towitoko smartcard reader PCSC and CT-API driver... May 8, 2006 Discovering OpenPGP Card page 12

Software Integration Most frontend applications will ask for the passphrase and pass it to the card as PIN. Linux/*BSD : gpg-agent may be required with some frontends Enigmail plugins for Mozilla Thunderbird: Windows : Features Smart Card Management Interface Provides PIN cache functionality WinPT : Features Smart Card Management Interface Enigmail plugins for Mozilla Thunderbird May 8, 2006 Discovering OpenPGP Card page 13

Linux Live-CD Lots of Live-CD don't include GnuPG or offer an outdated version of it. Can be easily compiled Knoppix / kanotix / Kaella Works out of the box! Another good candidate is PuppyLinux (64MB) GnuPG not part of the base system but can be installed as an add-on. Download http://dotpups.de/jr/gnupg.pup To install, click on the file using Rox-Filer GnuPG can be launched using : /usr/local/gnupg/bin/gpg Can fit on a USB Flash drive May 8, 2006 Discovering OpenPGP Card page 14

Private Key Backup Strategies May 8, 2006 Discovering OpenPGP Card page 15

Private Key Backup Strategies A Smart Card can be easily be damaged or lost Need for a backup policy Backup Options: Dual-key policy On-card key generation and off-card backup of the sensitive material only Off-card key generation with full off-card copy backup of the entire key Sign/Decrypt without a card May 8, 2006 Discovering OpenPGP Card page 16

Dual-Key Policy (using subkeys) As recommended on FSFE website http://www.fsfe.org/en/card/howto/subkey_howto Basically you always encrypt using two keys so in case you lose your card you can use a backup key stored on a removable media Problem: Not an easy setup May 8, 2006 Discovering OpenPGP Card page 17

On-card key generation and off-card backup of the sensitive material only Procedure: $ gpg --card-edit command> admin command> generate During the key generation a backup will be saved in a file. Store this file in a safe place and safely wipe the original from your hard-drive If the card is lost, the backup can be transferred back to a new card using : $ gpg --edit-key user@domain.com command> toggle command> bkuptocard Problem: Backup is not a full GnuPG key... a new Smart Card is required to use it!! May 8, 2006 Discovering OpenPGP Card page 18

Off-card key generation with full offcard copy Idea: Generate a private key on a trusted machine (Live-CD, no network or HDD) Backup this private key on a floppy/flash drive Use the keytocard command to transfer the private key material to the card Backup the new sanitized private key to another floppy/flash drive Advantage: If you lose your card and are unable to get a new one, you'll still be able to sign/decrypt. May 8, 2006 Discovering OpenPGP Card page 19

Off-card key generation with full offcard copy Before F0 32 A0 15 4E Full Private Key F0 32 A0 15 4E Secret Keyring secring.pgp Backup stored in a safe After 01 02 03 04 05 F0 32 A0 15 4E Token Secret Keyring secring.pgp OpenPGP Smart Card May 8, 2006 Discovering OpenPGP Card page 20

Getting Started with OpenPGP card May 8, 2006 Discovering OpenPGP Card page 21

Getting started with OpenPGP card 1) Get an OpenPGP card 2) Get a supported Smart Card reader 3) Install required libraries 4) Optional - pcsclite installation/configuration 5) Optional - CTAPI installation/configuration 6) Get first card response May 8, 2006 Discovering OpenPGP Card page 22

1- Get an OpenPGP card Kernel Concepts http://www.kernelconcepts.de/products/security-en About 16 piece Fellowship of Free Software Foundation Europe http://www.fsfe.org/en Free when becoming a member (donation required) Personalized with your name printed on the card EUROPE ONLY!!! May 8, 2006 Discovering OpenPGP Card page 23

2- Get a supported Smart Card reader Kernel Concepts http://www.kernelconcepts.de/products/security-en.shtml USB Chipcard reader SCM SCR-335 for 29 Other places Just look for compatibility and driver support American Express in the US has been offering free Smart Card reader to their Blue Card customers (maybe available on ebay). They are re-packaged Gemplus GCR415 readers. May 8, 2006 Discovering OpenPGP Card page 24

3- Required Libraries See Smart Card Reader support On some Debian systems you need to create the following symbolic link : su ln -s /usr/lib/libpcsclite.so.1 /usr/lib/libpcsclite.so May 8, 2006 Discovering OpenPGP Card page 25

4-5- PCSCLite or CTAPI installation Smart Card reader dependent Should be a question of apt-get install xxx See my post for installing PCSCLite and CTAPI on Linux Live-CD http://lists.gnupg.org/pipermail/gnupg-users/2005-february/024683.html May 8, 2006 Discovering OpenPGP Card page 26

6 First Card response Connect the reader Insert the card Open a terminal window: gpg --card-status You may want to bypass built-in CCID driver by adding --disable-ccid On Kanotix, you need to be root to issue the command (su) May 8, 2006 Discovering OpenPGP Card page 27

gpg --card-status $ gpg --card-status gpg: detected reader `SCM SCR 331 (80000A10) 00 00' Application ID...: D2760001240101000001000000F40000 Version...: 1.0 Manufacturer...: PPC Card Systems Serial number...: 000000F4 Name of cardholder: [not set] Language prefs...: en Sex...: unspecified URL of public key : [not set] Login data...: [not set] Signature PIN...: not forced Max. PIN lengths.: 254 254 254 PIN retry counter : 3 3 3 Signature counter : 1 S/N of the card Optional Information PIN monitoring Signature key...: 50A5 2121 473E 008A CF10 609D 3843 9B24 F8E2 EFDD Encryption key...: EE8B 3ABB 01B5 9C0A 4F8B CCA9 5EAA EB58 80F9 DFFF Authentication key: CCFE 5FC2 AA06 A0FD 2361 F1FD 3279 55E1 7CE1 443A General key info..: [none] Fingerprint of the stored key May 8, 2006 Discovering OpenPGP Card page 28

OpenPGP card personalization Off-card Key Generation Backup Strategy May 8, 2006 Discovering OpenPGP Card page 29

Prerequisites Linux Live-CD (Knoppix/Kanotix/Puppy Linux) Only Live-CD, no installed systems Everything described in the Getting Started Section Smart Card Reader, Smart Card, Libraries Two USB Flash keys/floppies : One for private key backup One for sanitized private key No network..please unplug the cable Sounds like a bit paranoid but you don't need it here anyway No hard-drives... Disconnect all hard drives in the host PC Swap space may be used and therefore leaking private key I don't recommend performing off-card key generation and backup on anything but Linux Live-CD. MS Win is banned here! May 8, 2006 Discovering OpenPGP Card page 30

Off-card key generation backup strategy 1) Change PIN 2) Personalize the card (name, gender...) 3) Generate the private key 4) Backup the private key to removable media 1 5) Move the private key to card 6) Copy the new private key to removable media 2 May 8, 2006 Discovering OpenPGP Card page 31

1- Managing PINs $ gpg --change-pin gpg: detected reader `SCM SCR 331 (80000A10) 00 00' gpg: OpenPGP card no. D2760001240101000001000000F40000 detected 1 - change PIN 2 - unblock PIN 3 - change Admin PIN Q - quit Your selection? Default PIN codes are : PIN : 123456 Admin PIN : 12345678 Use 1) and 3) to change both User PIN and Admin PIN After entering three wrong (user) PIN, the cards locks PIN can be reset using Admin PIN After entering three wrong Admin PIN, the card destroys itself! No way to recover from this stage May 8, 2006 Discovering OpenPGP Card page 32

2- OpenPGP Card Personalization Discover the --card-edit menu $ gpg --card-edit gpg: detected reader `SCM SCR 331 (80000A10) 00 00' Application ID...: D2760001240101000001000000F40000 Version...: 1.0 Manufacturer...: PPC Card Systems...... Authentication key: CCFE 5FC2 AA06 A0FD 2361 F1FD 3279 55E1 7CE1 443A General key info..: [none] Command>? quit admin help list fetch passwd verify quit this menu show admin commands show this help list all available data fetch the key specified in the card URL menu to change or unblock the PIN verify the PIN and list all data Command> May 8, 2006 Discovering OpenPGP Card page 33

2- OpenPGP Card Personalization Discover the admin section of the --card-edit menu Admin commands are allowed Command>? quit admin help list name url fetch login lang sex cafpr forcesig generate passwd verify quit this menu show admin commands show this help list all available data change card holder's name change URL to retrieve key fetch the key specified in the card URL change the login name change the language preferences change card holder's sex change a CA fingerprint toggle the signature force PIN flag generate new keys menu to change or unblock the PIN verify the PIN and list all data Command> May 8, 2006 Discovering OpenPGP Card page 34

3- Generate the private key Create a Key Pair as usual but with the following key sizes/types : Signing Key : 1024-bit RSA Encryption sub-key : 1024-bit RSA May 8, 2006 Discovering OpenPGP Card page 35

3- Generate the private key details (1) $ gpg --gen-key gpg (GnuPG) 1.4.3; Copyright (C) 2006 Free Software Foundation, Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the file COPYING for details. Please select what kind of key you want: (1) DSA and Elgamal (default) (2) DSA (sign only) (5) RSA (sign only) Your selection? 5 RSA Only! RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) 1024 Requested keysize is 1024 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/n) y 1024-bit only! May 8, 2006 Discovering OpenPGP Card page 36

3- Generate the private key details (2) You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: Pink Panther Email address: pink.panther@mail.zoo Comment: You selected this USER-ID: "Pink Panther <pink.panther@mail.zoo>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy...+++++...+++++ gpg: /home/test/.gnupg/trustdb.gpg: trustdb created gpg: key 8E05B0C6 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 1024R/8E05B0C6 2006-05-05 Key fingerprint = C1B8 F2FE 69F7 EAF0 36BD 0FB3 922B E145 8E05 B0C6 uid Pink Panther <pink.panther@mail.zoo> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. May 8, 2006 Discovering OpenPGP Card page 37

3- Generate the private key details (3) $ gpg --edit-key 0x8E05B0C6 gpg (GnuPG) 1.4.3; Copyright (C) 2006 Free Software Foundation, Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the file COPYING for details. Secret key is available. pub 1024R/8E05B0C6 created: 2006-05-05 expires: never trust: ultimate validity: ultimate [ultimate] (1). Pink Panther <pink.panther@mail.zoo> usage: SC Command> addkey Key is protected. You need a passphrase to unlock the secret key for user: "Pink Panther <pink.panther@mail.zoo>" 1024-bit RSA key, ID 8E05B0C6, created 2006-05-05 Please select what kind of key you want: (2) DSA (sign only) (4) Elgamal (encrypt only) (5) RSA (sign only) (6) RSA (encrypt only) Your selection? 6 RSA Only! May 8, 2006 Discovering OpenPGP Card page 38

3- Generate the private key details (4) RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) 1024 Requested keysize is 1024 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/n) y Really create? (y/n) y We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy..+++++.+++++ 1024-bit only! pub 1024R/8E05B0C6 created: 2006-05-05 expires: never trust: ultimate validity: ultimate sub 1024R/E295B471 created: 2006-05-05 expires: never [ultimate] (1). Pink Panther <pink.panther@mail.zoo> usage: SC usage: E Command> q Save changes? (y/n) y Don't forget to Quit and Save! May 8, 2006 Discovering OpenPGP Card page 39

4- Backup the private key Mount your removable media (Floppy/USB Flash drive) using CLI or icon on the desktop (e.g. /media/sda1) and enable Read/Write Copy Public and Private keyring : cp /home/knoppix/.gnupg/pubring.gpg /mnt/sda1/. cp /home/knoppix/.gnupg/secring.gpg /mnt/sda1/. Unmount and disconnect the removable media (CLI or icon) Put this invaluable item in a safe or remote secret location It's also a good idea to generate a revoke certificate at this time. May 8, 2006 Discovering OpenPGP Card page 40

5- Move the private key to card BEFORE $ gpg --edit-key 0x8E05B0C6 pub 1024R/8E05B0C6 created: 2006-05-05 expires: never trust: ultimate validity: ultimate sub 1024R/E295B471 created: 2006-05-05 expires: never [ultimate] (1). Pink Panther <pink.panther@mail.zoo> usage: SC usage: E Command> toggle sec 1024R/8E05B0C6 created: 2006-05-05 expires: never ssb 1024R/E295B471 created: 2006-05-05 expires: never (1) Pink Panther <pink.panther@mail.zoo> AFTER $ gpg --edit-key 0x8E05B0C6 pub 1024R/8E05B0C6 created: 2006-05-05 expires: never trust: ultimate validity: ultimate sub 1024R/E295B471 created: 2006-05-05 expires: never [ultimate] (1). Pink Panther <pink.panther@mail.zoo> usage: SC usage: E Command> toggle sec 1024R/8E05B0C6 created: 2006-05-05 expires: never card-no: 0001 000000F4 ssb 1024R/E295B471 created: 2006-05-05 expires: never card-no: 0001 000000F4 (1) Pink Panther <pink.panther@mail.zoo> S/N of the card May 8, 2006 Discovering OpenPGP Card page 41

5- Move the private key to card details (1) $ gpg --edit-key 0x8E05B0C6 gpg (GnuPG) 1.4.3; Copyright (C) 2006 Free Software Foundation, Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the file COPYING for details. Secret key is available. pub 1024R/8E05B0C6 created: 2006-05-05 expires: never trust: ultimate validity: ultimate sub 1024R/E295B471 created: 2006-05-05 expires: never [ultimate] (1). Pink Panther <pink.panther@mail.zoo> usage: SC usage: E Command> toggle sec 1024R/8E05B0C6 created: 2006-05-05 expires: never ssb 1024R/E295B471 created: 2006-05-05 expires: never (1) Pink Panther <pink.panther@mail.zoo> Command> keytocard Really move the primary key? (y/n) y gpg: detected reader `SCM SCR 331 (80000A10) 00 00' Signature key...: 50A5 2121 473E 008A CF10 609D 3843 9B24 F8E2 EFDD Encryption key...: EE8B 3ABB 01B5 9C0A 4F8B CCA9 5EAA EB58 80F9 DFFF Authentication key: CCFE 5FC2 AA06 A0FD 2361 F1FD 3279 55E1 7CE1 443A Please select where to store the key: (1) Signature key (3) Authentication key Your selection? 1 Select Signature May 8, 2006 Discovering OpenPGP Card page 42

5- Move the private key to card details (2) gpg: WARNING: such a key has already been stored on the card! Replace existing key? (y/n) y You need a passphrase to unlock the secret key for user: "Pink Panther <pink.panther@mail.zoo>" 1024-bit RSA key, ID 8E05B0C6, created 2006-05-05 gpg: existing key will be replaced gpg: 3 Admin PIN attempts remaining before card is permanently locked Admin PIN sec 1024R/8E05B0C6 created: 2006-05-05 expires: never card-no: 0001 000000F4 ssb 1024R/E295B471 created: 2006-05-05 expires: never (1) Pink Panther <pink.panther@mail.zoo> Command> key 1 Select the encryption sub-key sec 1024R/8E05B0C6 created: 2006-05-05 expires: never card-no: 0001 000000F4 ssb* 1024R/E295B471 created: 2006-05-05 expires: never (1) Pink Panther <pink.panther@mail.zoo> Command> keytocard Signature key...: 50A5 2121 473E 008A CF10 609D 3843 9B24 F8E2 EFDD Encryption key...: EE8B 3ABB 01B5 9C0A 4F8B CCA9 5EAA EB58 80F9 DFFF Authentication key: CCFE 5FC2 AA06 A0FD 2361 F1FD 3279 55E1 7CE1 443A May 8, 2006 Discovering OpenPGP Card page 43

5- Move the private key to card details (3) Please select where to store the key: (2) Encryption key Your selection? 2 gpg: WARNING: such a key has already been stored on the card! Replace existing key? (y/n) y You need a passphrase to unlock the secret key for user: "Pink Panther <pink.panther@mail.zoo>" 1024-bit RSA key, ID E295B471, created 2006-05-05 gpg: existing key will be replaced sec 1024R/8E05B0C6 created: 2006-05-05 expires: never card-no: 0001 000000F4 ssb* 1024R/E295B471 created: 2006-05-05 expires: never card-no: 0001 000000F4 (1) Pink Panther <pink.panther@mail.zoo> Command> q Save changes? (y/n) y Don't forget to Quit and Save! May 8, 2006 Discovering OpenPGP Card page 44

6- Backup the sanitized private key Mount your removable media (Floppy/USB Flash drive) using CLI or icon on the desktop (e.g. /media/sda1) and enable Read/Write Copy Public and Private keyring : cp /home/knoppix/.gnupg/pubring.gpg /mnt/sda1/. cp /home/knoppix/.gnupg/secring.gpg /mnt/sda1/. Unmount and disconnect the removable media (CLI or icon) You can now safely shutdown your machine, reconnect hard drives and network and restart your favorite OS Just copy back the sanitized version of your pub/sec ring to the usual location May 8, 2006 Discovering OpenPGP Card page 45

OpenPGP Card Usage May 8, 2006 Discovering OpenPGP Card page 46

Use GnuPG with your OpenPGP Card Use GnuPG as before except it will ask you for your PIN instead of passphrase. Some front-end program don't support GnuPG Smart Card out of the box (Kgpg). In some cases you will have to install gpg-agent Enigmail plug-in for Thunderbird and WinPT provide a nice interface for entering and caching the PIN When asking for the PIN, GnuPG also displays the Serial Number of the concerned Smart Card so you know which one to pick May 8, 2006 Discovering OpenPGP Card page 47

Use GnuPG with your OpenPGP Card - details $ touch test.txt $ echo CLEAR TEXT >> test.txt $ more test.txt CLEAR TEXT $ gpg -r pink.panther@mail.zoo -ea test.txt $ more test.txt.asc -----BEGIN PGP MESSAGE----- hiwd5gbyqukvthebbac9xklyzi5cdiorqkm8sg1c+ilbmfwlcj7oytabsnxlqfj0 JQzcSk5LIz6k61Dd5+9jP9nlYP38ri1zKc2T7uPQ8gXaUZeK63TFUgtv/EYKFCBi Ro9c1kdn1KekbD6H8iZgd9+VMyiJ6RQ9DFUAL4Ml4laKimNfDCgCSyMYswJJj9JS AU+2El1PLx1koV888IlZLQEADemuOImXcwm9NQSGyZW62lZdHa1brh+Qd3AWIICk 5FbVa5B0QFWiXi5NdAx8BIoA9rbm6U8Nmr8mZ3zSkzoxVg== =PiAn -----END PGP MESSAGE----- $ rm test.txt $ gpg -d test.txt.asc > testout.txt gpg: detected reader `SCM SCR 331 (80000A10) 00 00' PIN gpg: encrypted with 1024-bit RSA key, ID E295B471, created 2006-05-05 "Pink Panther <pink.panther@mail.zoo>" $ more test.txt CLEAR TEXT May 8, 2006 Discovering OpenPGP Card page 48

Now it's time for a Keysigning party! May 8, 2006 Discovering OpenPGP Card page 49

References How to use OpenPGP card with Live-CD including pcsclite and CTAPI driver installation http://lists.gnupg.org/pipermail/gnupg-users/2005-february/024683.html How to use the Fellowship Smartcard http://www.gnupg.org/(fr)/howtos/card-howto/en/smartcard-howto.html The GnuPG Smartcard HOWTO (by Werner Koch) http://www.kernelconcepts.de/products/smartcard-howto.txt g10 OpenPGP page http://www.g10code.de/p-card.html OpenPGP Card specification : http://www.g10code.de/docs/openpgp-card-1.1.pdf May 8, 2006 Discovering OpenPGP Card page 50