GNUK TOKEN AND GNUPG GNUK TOKEN AND GNUPG SCDAEMON SCDAEMON - - PowerPoint PPT Presentation

gnuk token and gnupg gnuk token and gnupg scdaemon
SMART_READER_LITE
LIVE PREVIEW

GNUK TOKEN AND GNUPG GNUK TOKEN AND GNUPG SCDAEMON SCDAEMON - - PowerPoint PPT Presentation

GNUK TOKEN AND GNUPG GNUK TOKEN AND GNUPG SCDAEMON SCDAEMON minimizing the attack surface NIIBE Yutaka <gniibe@fsij.org> FOSDEM 2018 This is a talk of my experience to have better control (by its user) of computing for privacy


slide-1
SLIDE 1

GNUK TOKEN AND GNUPG GNUK TOKEN AND GNUPG SCDAEMON SCDAEMON

“minimizing the attack surface”

NIIBE Yutaka <gniibe@fsij.org> FOSDEM 2018

slide-2
SLIDE 2

This is a talk of my experience to have better control (by its user)

  • f computing for privacy

with dedicate device

  • f mimimized features
slide-3
SLIDE 3

WHAT'S GNUK? WHAT'S GNUK?

Free Soware Project under FSIJ Implementation of Cryptographic Token Supports OpenPGP card Protocol (v2 & v3) Runs on STM32103 MCU (Cortex-M3) Supports RSA-2048 and ECC

slide-4
SLIDE 4
slide-5
SLIDE 5

Gnuk as GNU + K (K for _Key_) Gnuk as G + NUK

slide-6
SLIDE 6

GNUK TOKEN GNUK TOKEN

Gnuk is soware implementation We call a device “Gnuk Token” when it runs Gnuk

slide-7
SLIDE 7

GNUK TOKEN AND SCDAEMON GNUK TOKEN AND SCDAEMON

By connected processes and a device Reason: to minimize the attack surface

slide-8
SLIDE 8

TYPICAL USE CASE TYPICAL USE CASE

At work Home On the Go

slide-9
SLIDE 9

THOUGHTS THOUGHTS

No more copy of private keys Separate dedicated device which is removable Supply power only on use Physically small surface

slide-10
SLIDE 10

WHAT ARE LEARNED? WHAT ARE LEARNED?

Controlling my own computing: getting harder Random number sequence: No control by anyone Not only soware toolchain, but also: Tools like KiCAD, OpenOCD, sigrok Firmware in JTAG device Computer used in factory How to deliver the product

slide-11
SLIDE 11

HARDWARE TARGET HISTORY HARDWARE TARGET HISTORY

Project started 2010 with Olimex STM32 part of STM8S Discovery Kit More boards support Reference hardware design in 2011 Manufactured 1000pcs in 2012 Update the design in 2016 Manufactured 300pcs in 2017

slide-12
SLIDE 12

SOON AFTER ITS START SOON AFTER ITS START

Realized host side support is important CCID driver was typically for proprietary devices undocumented features, bad abstraction, no-good standardization (E.g.: pinpad support) Requirement for hardware deployment Joined GnuPG development in 2011 to improve scdaemon

slide-13
SLIDE 13

SCDAEMON SCDAEMON

Access smartcard through CCID reader Difficult soware, because of: Support for proprietary devices Proprietary readers Proprietary card Support for different OSes GNU, *BSD, Windows, macOS, ...

slide-14
SLIDE 14

SCDAEMON HAS BEEN IMPROVED SCDAEMON HAS BEEN IMPROVED

Stable interaction between gpg-agent Robust access to device OpenPGP card v3 support No more PC/SC wrapper Direct access by libusb Simultaneous use of multiple tokens

slide-15
SLIDE 15

FST-01, FST-01G FST-01, FST-01G FREE HARDWARE DESIGN FREE HARDWARE DESIGN

For reproducible hardware implementation Simpler, no many features Use free tool: KiCAD

slide-16
SLIDE 16
slide-17
SLIDE 17

FST-01 DESIGNED IN 2011 FST-01 DESIGNED IN 2011

slide-18
SLIDE 18

FST-01G DESIGNED IN 2016 FST-01G DESIGNED IN 2016

slide-19
SLIDE 19

MANY OTHER THINGS MANY OTHER THINGS FLASHING MCU FLASHING MCU

Reverse engineering for tool: ST-Link/V2

slide-20
SLIDE 20
slide-21
SLIDE 21

RANDOM NUMBER GENERATOR RANDOM NUMBER GENERATOR

NeuG started in 2011 Entropy Source: 1/2-bit of each ADC sample No one should control (or can guess) instance of random number sequence

slide-22
SLIDE 22

FIRMWARE UPDATE FIRMWARE UPDATE

This can be valid attack vector. Implemented in Gnuk and NeuG

slide-23
SLIDE 23

USB VENDER ID USB VENDER ID

FSIJ got it in 2011 for Gnuk Project

slide-24
SLIDE 24

MANUFACTURING MANUFACTURING

Free Hardware / Free Soware friendly company Seeed Technology in ShenZhen They can distribute the product, too

slide-25
SLIDE 25

RT OS RT OS

Chopstx started in 2013

slide-26
SLIDE 26

GPL COMPLIANCE (1) GPL COMPLIANCE (1)

I tried with a serial ROM on FST-01 to deliver source code on the device But, it takes time in production FAIL: manufacuring cost matters

slide-27
SLIDE 27

GPL COMPLIANCE (2) GPL COMPLIANCE (2)

Fraucheky started in 2013 Deliver GPL text on the device

slide-28
SLIDE 28

DISTRIBUTION CHANNEL DISTRIBUTION CHANNEL

Seeed Studio (2012-2017) - w/ Gnuk 1.0.1 Free Soware Foundation (2015-) - w/ NeuG 1.0.x + SDcard of repo copy In person, at conferences Debconf14, 15, 17 OpenPGP.conf in 2015

slide-29
SLIDE 29

MANUFACTURING PROCESS MANUFACTURING PROCESS IMPROVEMENT IMPROVEMENT

Computer in factory matters BBG-SWD in 2016 SWD flashing tool by single board computer to minimize the attack surface in factory

slide-30
SLIDE 30

SOURCE CODE ACCESS SOURCE CODE ACCESS

By selling copy of repo of gniibe.org gitorious.org alioth.debian.org salsa.debian.org

slide-31
SLIDE 31

USB EMULATION (SINCE 2017) USB EMULATION (SINCE 2017)

Support testing with no real hardware

slide-32
SLIDE 32

ECO SYSTEM ECO SYSTEM

FSF: distribution of product GnuPG: gnuk-users mailing list Debian: source code repo FSIJ: USB Vendor ID (and travel cost)

slide-33
SLIDE 33

HARDWARE SUGGESTIONS HARDWARE SUGGESTIONS

STM32 Nucleo F103 Blue Pill ST-Link/V2 clone FSF Shop https://www.fsij.org/gnuk/neug-

  • n-stm32-nucleo-f103.html

http://wiki.stm32duino.com/index.php? title=Blue_Pill https://shop.fsf.org/storage-devices/neug- usb-true-random-number-generator

slide-34
SLIDE 34

SUMMARY (1) SUMMARY (1)

Those things matter: Free Soware on Host Free firmware on Device Free development environment Documented standard/protocol/interface Free tool Emulation for testing with no real hardware Distribution of product

slide-35
SLIDE 35

SUMMARY (2) SUMMARY (2)

Some dirty works/steps are required reverse engineering access by proprietary OS/tool/etc. business practice like USB VID bootstrap from proprietary env.

slide-36
SLIDE 36

REFERENCES REFERENCES

News: Info: Repo: https://www.fsij.org/gnuk/ https://www.gniibe.org/category/fst-01.html https://salsa.debian.org/gnuk-team/

slide-37
SLIDE 37

HAPPY HACKING! HAPPY HACKING!

“I want to free our people. If you want to be free, join us.” — Freysa to K