SlideShare a Scribd company logo
CurveZMQ, ZMTP and other
Dubious Characters
Secure Messaging for the Internet
by
Pieter Hintjens, CEO, iMatix
Berlin Buzzwords 2013, 4 June, 2013
What's the Problem?
● ZeroMQ (ØMQ) defined a new product
category
● Message queuing & routing stacks
● JeroMQ, NullMQ, Nano, netty-zmtp, ezmtp
● All have the same problem: clear-text
● Not safe to use on public infrastructure
What do People Do?
● Many apps just use clear text
● Clearly not acceptable for sensitive data
● Salt Stack has its own security system
● Already cracked (chicken-salt)
● IPython uses SSH + HMAC digests
● Has several plausible vulnerabilities
Works in Progress
● TLS encryption above libzmq (Barber)
● TLS transports for libzmq (Young, Naudé)
● DTLS transport for libzmq (Cocagne)
● May deliver, but...
● What about interoperability?
The Right Solution
● Security at the protocol level (ZMTP)
● Extensible security (like SASL)
● Several example mechanisms
● Easy to plug new ones into libzmq
● Perhaps exposed as e.g. dtls://
What's SASL?
● IETF's solution for extensible security
● We used this when designing AMQP
● Client and server negotiate a "mechanism"
● Mechanism does the actual security
● IETF as usual makes it... complex
● We can do it somewhat simpler
The Security Handshake
● Client: HELLO
● Server: WELCOME (mechanism M)
● Client: INITIATE (mechanism M)
● Server: READY
● Client: MESSAGE | Server: MESSAGE
What is "Secure" in 2013?
● Data cannot be tapped (encrypted)
● or created fraudulently (authentic)
● or altered
● or replayed
● Keys cannot be stolen
Basic State of the Art
● Mechanisms must be open ended
● Allows evolution of security over time
● Processing HELLO command must be cheap
● Prevents denial-of-CPU attacks
● HELLO must be larger than WELCOME
● Prevents amplification attacks
● Send no metadata until INITIATE/READY
● Prevents leak of knowledge about peer
Advanced State of the Art
● Perfect forward security
● Data cannot be decrypted even with private keys
● Resists man-in-the-middle manipulation of keys
● Clients cannot be identified
● Client public keys are sent encrypted
● Resists traffic-analysis attacks
● Randomize message sizes & frequencies
Meet CurveCP (Bernstein)
● "Usable Security for the Internet"
● From author of NaCl (=> libsodium)
● Encryption and authentication over UDP
● Also does recovery from packet loss
● Also does a bunch of other stuff
● http://curvecp.org
Some CurveCP Internals
● Elliptic curve encryption, very fast
● Creates short-term keys for each connection
● Unique nonces for each command
● Achieves "advanced state of the art"
● Except defeating traffic analysis
● Which we can add ourselves
Why NaCl is Wonderful
● Perfectly simple API
● Fast and robust
● Preselected key sizes & algorithms
● Packaged as libsodium
● Easy to install, learn, and use
Why CurveCP won't happen
● Tries to do too much, too soon
● The software is complex to use
● Does not "play nice" with existing standards
● Utterly incompatible with SASL, TCP
● Remixed into more plausible MinimalT
Apart from that, Very Nice!
● I took CurveCP's security handshake
● Simplified it and cleaned it up
● Made it transport neutral
● Wrote down as a single protocol document
● http://rfc.zeromq.org/spec:26/CURVEZMQ
Meet CurveZMQ
● An Abstract Security Mechanism
● Specified as a client-server protocol
● Any transport (even avian carrier)
● TCP if we build this into ZMTP
● Or ZeroMQ tcp://, at application level
● http://curvezmq.org
Meet ZMTP
● The ZeroMQ Message Transport Protocol
● Wire protocol for ZeroMQ over TCP
● Fifth RFC now in drafting stage
● In ZeroMQ, JeroMQ, NetMQ, netty-zmtp, ...
● Version 3.0 is quite a big deal
● http://rfc.zeromq.org/spec:23/ZMTP
What's New in ZMTP 3.0?
● Extensible security mechanisms
● Extensible connection metadata
● Endpoint resources (for port sharing)
● Better backwards version detection
● Explicit socket type semantics
ZMTP's security mechanisms
● NULL is just that, empty
● PLAIN does clear-text authentication
● Test clients vs. production systems
● CURVE does CurveZMQ security
● Fully encrypted and authenticated
● <Insert your own here>
libzmq already runs ZMTP 3.0
● Git master does NULL and PLAIN
● Full backwards compatibility
● Supports extensible mechanisms
● We're now working on CURVE
● Next: DTLS, ...?
Meet ZAP
● The ZeroMQ Authentication Protocol
● Extensible authentication services
● Using ZeroMQ request-reply protocol
● PAM, LDAP, Kerberos, passwd, etc.
● libzmq implements ZAP 1.0
● http://rfc.zeromq.org/spec:27/ZAP
Get involved
● Read the RFCs on http://rfc.zeromq.org
● Come to Brussels on 21 & 22 June 2013
● For ZeroMQ Developers' Meetup
● http://zero.mq/bxl
● Talk to us on the zeromq-dev list
Who are we?
● ZeroMQ community including iMatix
● iMatix makes messaging products
● Distributed systems since 1991
● Original designers of AMQP (2004-07)
● Backers of ZeroMQ community (2007-)
● Authors of most ZeroMQ RFCs
Thanks!
● Buy the O'Reilly ZeroMQ book
● Email me: ph@imatix.com
● Twitter: @hintjens
● Blog: hintjens.com

More Related Content

PDF
Switch or broker
pieterh
 
ODP
Fosdem 2009
pieterh
 
ODP
RestMS Introduction
pieterh
 
PDF
NullMQ @ PDX
Jeff Lindsay
 
KEY
ZeroMQ
Stoyan Zhekov
 
PDF
ZeroMQ with NodeJS
Fernando Sanabria
 
PPTX
zeromq
Rajan Bhatt
 
PDF
Think beyond http
Ankit Rastogi
 
Switch or broker
pieterh
 
Fosdem 2009
pieterh
 
RestMS Introduction
pieterh
 
NullMQ @ PDX
Jeff Lindsay
 
ZeroMQ with NodeJS
Fernando Sanabria
 
zeromq
Rajan Bhatt
 
Think beyond http
Ankit Rastogi
 

What's hot (20)

KEY
Europycon2011: Implementing distributed application using ZeroMQ
fcrippa
 
ODP
Scala.io 2013 - Scala and ZeroMQ: Events beyond the JVM
RUDDER
 
PDF
Zmq in context of openstack
Yatin Kumbhare
 
KEY
Distributed app development with nodejs and zeromq
Ruben Tan
 
PDF
Scala and ZeroMQ: Events beyond the JVM
RUDDER
 
PPT
Leveraging zeromq for node.js
Ruben Tan
 
PDF
What we've learned from running thousands of production RabbitMQ clusters - L...
RabbitMQ Summit
 
PPTX
What is RabbitMQ ?
AIMDek Technologies
 
PPTX
The RabbitMQ Message Broker
Martin Toshev
 
PDF
Messaging for the cloud
dejanb
 
ODP
Rabbit mq, amqp and php
rodeob
 
ODP
Rust Primer
Knoldus Inc.
 
PPT
Amqp Basic
Rahul Agrawal
 
PPTX
Rabbit MQ
Tran Thanh Thi
 
PDF
An update from the RabbitMQ team - Michael Klishin
RabbitMQ Summit
 
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
All Things Open
 
PDF
Scaling out eclipse hono
dejanb
 
PDF
AMQP with RabbitMQ
Spyros Papageorgiou
 
PPTX
Message Broker System and RabbitMQ
University of Alabama at Birmingham
 
ODP
Introduction To RabbitMQ
Knoldus Inc.
 
Europycon2011: Implementing distributed application using ZeroMQ
fcrippa
 
Scala.io 2013 - Scala and ZeroMQ: Events beyond the JVM
RUDDER
 
Zmq in context of openstack
Yatin Kumbhare
 
Distributed app development with nodejs and zeromq
Ruben Tan
 
Scala and ZeroMQ: Events beyond the JVM
RUDDER
 
Leveraging zeromq for node.js
Ruben Tan
 
What we've learned from running thousands of production RabbitMQ clusters - L...
RabbitMQ Summit
 
What is RabbitMQ ?
AIMDek Technologies
 
The RabbitMQ Message Broker
Martin Toshev
 
Messaging for the cloud
dejanb
 
Rabbit mq, amqp and php
rodeob
 
Rust Primer
Knoldus Inc.
 
Amqp Basic
Rahul Agrawal
 
Rabbit MQ
Tran Thanh Thi
 
An update from the RabbitMQ team - Michael Klishin
RabbitMQ Summit
 
Messaging Standards and Systems - AMQP & RabbitMQ
All Things Open
 
Scaling out eclipse hono
dejanb
 
AMQP with RabbitMQ
Spyros Papageorgiou
 
Message Broker System and RabbitMQ
University of Alabama at Birmingham
 
Introduction To RabbitMQ
Knoldus Inc.
 
Ad

Viewers also liked (16)

PDF
ZeroMQ Is The Answer
Ian Barber
 
PPTX
ZeroMQ: Super Sockets - by J2 Labs
James Dennis
 
PPTX
Build reliable, traceable, distributed systems with ZeroMQ
Robin Xiao
 
PDF
Bridging the gap: Adding missing client (security) features using OpenLDAP pr...
LDAPCon
 
PPTX
Saltconf 2016: Salt stack transport and concurrency
Thomas Jackson
 
ODP
Software Architecture using ZeroMQ - techmesh 2012
pieterh
 
ODP
Git Without Branches - Simple, Smooth, Scalable
pieterh
 
ODP
Revolutionary Open Source
pieterh
 
ODP
Social architecture-101
pieterh
 
PDF
Software Architecture over ZeroMQ
pieterh
 
ODP
FOSDEM 2011 - 0MQ
pieterh
 
DOC
Solar Charge Controller
Bharat Biyani
 
PDF
Securing Kafka
confluent
 
PDF
3 apache-avro
zafargilani
 
ODP
Overview of ZeroMQ
pieterh
 
ZeroMQ Is The Answer
Ian Barber
 
ZeroMQ: Super Sockets - by J2 Labs
James Dennis
 
Build reliable, traceable, distributed systems with ZeroMQ
Robin Xiao
 
Bridging the gap: Adding missing client (security) features using OpenLDAP pr...
LDAPCon
 
Saltconf 2016: Salt stack transport and concurrency
Thomas Jackson
 
Software Architecture using ZeroMQ - techmesh 2012
pieterh
 
Git Without Branches - Simple, Smooth, Scalable
pieterh
 
Revolutionary Open Source
pieterh
 
Social architecture-101
pieterh
 
Software Architecture over ZeroMQ
pieterh
 
FOSDEM 2011 - 0MQ
pieterh
 
Solar Charge Controller
Bharat Biyani
 
Securing Kafka
confluent
 
3 apache-avro
zafargilani
 
Overview of ZeroMQ
pieterh
 
Ad

Similar to CurveZMQ, ZMTP and other Dubious Characters (20)

PDF
Network-Connected Development with ZeroMQ
ICS
 
ODP
Wireless security beyond password cracking by Mohit Ranjan
OWASP Delhi
 
PPTX
Shall we play a game?
Maciej Lasyk
 
PDF
OpeVPN on Mikrotik
GLC Networks
 
PPTX
Shall we play a game
jackpot201
 
PDF
Shall we play a game?
IngridRivera36
 
PDF
Securing Millions of Devices
Kai Hudalla
 
PDF
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon
 
PPTX
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
oholiab
 
PDF
SPDY and What to Consider for HTTP/2.0
Mike Belshe
 
PDF
Building the Internet of Things with Eclipse IoT - IoTBE meetup
Benjamin Cabé
 
PDF
Proactive monitoring tools or services - Open Source
B.A.
 
PDF
We shall play a game....
Sadia Textile
 
PDF
FreeBSD and Hardening Web Server
Muhammad Moinur Rahman
 
ODP
VSCP & Friends Presentation Eindhoven
Ake Hedman
 
PDF
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Julien Vermillard
 
PDF
Introduction to ZeroMQ - eSpace TechTalk
Mahmoud Said
 
PDF
Building a Small Datacenter
ssuser4b98f0
 
PDF
Securing IoT Applications
WSO2
 
Network-Connected Development with ZeroMQ
ICS
 
Wireless security beyond password cracking by Mohit Ranjan
OWASP Delhi
 
Shall we play a game?
Maciej Lasyk
 
OpeVPN on Mikrotik
GLC Networks
 
Shall we play a game
jackpot201
 
Shall we play a game?
IngridRivera36
 
Securing Millions of Devices
Kai Hudalla
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon
 
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
oholiab
 
SPDY and What to Consider for HTTP/2.0
Mike Belshe
 
Building the Internet of Things with Eclipse IoT - IoTBE meetup
Benjamin Cabé
 
Proactive monitoring tools or services - Open Source
B.A.
 
We shall play a game....
Sadia Textile
 
FreeBSD and Hardening Web Server
Muhammad Moinur Rahman
 
VSCP & Friends Presentation Eindhoven
Ake Hedman
 
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Julien Vermillard
 
Introduction to ZeroMQ - eSpace TechTalk
Mahmoud Said
 
Building a Small Datacenter
ssuser4b98f0
 
Securing IoT Applications
WSO2
 

Recently uploaded (20)

PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Doc9.....................................
SofiaCollazos
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 

CurveZMQ, ZMTP and other Dubious Characters

  • 1. CurveZMQ, ZMTP and other Dubious Characters Secure Messaging for the Internet by Pieter Hintjens, CEO, iMatix Berlin Buzzwords 2013, 4 June, 2013
  • 2. What's the Problem? ● ZeroMQ (ØMQ) defined a new product category ● Message queuing & routing stacks ● JeroMQ, NullMQ, Nano, netty-zmtp, ezmtp ● All have the same problem: clear-text ● Not safe to use on public infrastructure
  • 3. What do People Do? ● Many apps just use clear text ● Clearly not acceptable for sensitive data ● Salt Stack has its own security system ● Already cracked (chicken-salt) ● IPython uses SSH + HMAC digests ● Has several plausible vulnerabilities
  • 4. Works in Progress ● TLS encryption above libzmq (Barber) ● TLS transports for libzmq (Young, Naudé) ● DTLS transport for libzmq (Cocagne) ● May deliver, but... ● What about interoperability?
  • 5. The Right Solution ● Security at the protocol level (ZMTP) ● Extensible security (like SASL) ● Several example mechanisms ● Easy to plug new ones into libzmq ● Perhaps exposed as e.g. dtls://
  • 6. What's SASL? ● IETF's solution for extensible security ● We used this when designing AMQP ● Client and server negotiate a "mechanism" ● Mechanism does the actual security ● IETF as usual makes it... complex ● We can do it somewhat simpler
  • 7. The Security Handshake ● Client: HELLO ● Server: WELCOME (mechanism M) ● Client: INITIATE (mechanism M) ● Server: READY ● Client: MESSAGE | Server: MESSAGE
  • 8. What is "Secure" in 2013? ● Data cannot be tapped (encrypted) ● or created fraudulently (authentic) ● or altered ● or replayed ● Keys cannot be stolen
  • 9. Basic State of the Art ● Mechanisms must be open ended ● Allows evolution of security over time ● Processing HELLO command must be cheap ● Prevents denial-of-CPU attacks ● HELLO must be larger than WELCOME ● Prevents amplification attacks ● Send no metadata until INITIATE/READY ● Prevents leak of knowledge about peer
  • 10. Advanced State of the Art ● Perfect forward security ● Data cannot be decrypted even with private keys ● Resists man-in-the-middle manipulation of keys ● Clients cannot be identified ● Client public keys are sent encrypted ● Resists traffic-analysis attacks ● Randomize message sizes & frequencies
  • 11. Meet CurveCP (Bernstein) ● "Usable Security for the Internet" ● From author of NaCl (=> libsodium) ● Encryption and authentication over UDP ● Also does recovery from packet loss ● Also does a bunch of other stuff ● http://curvecp.org
  • 12. Some CurveCP Internals ● Elliptic curve encryption, very fast ● Creates short-term keys for each connection ● Unique nonces for each command ● Achieves "advanced state of the art" ● Except defeating traffic analysis ● Which we can add ourselves
  • 13. Why NaCl is Wonderful ● Perfectly simple API ● Fast and robust ● Preselected key sizes & algorithms ● Packaged as libsodium ● Easy to install, learn, and use
  • 14. Why CurveCP won't happen ● Tries to do too much, too soon ● The software is complex to use ● Does not "play nice" with existing standards ● Utterly incompatible with SASL, TCP ● Remixed into more plausible MinimalT
  • 15. Apart from that, Very Nice! ● I took CurveCP's security handshake ● Simplified it and cleaned it up ● Made it transport neutral ● Wrote down as a single protocol document ● http://rfc.zeromq.org/spec:26/CURVEZMQ
  • 16. Meet CurveZMQ ● An Abstract Security Mechanism ● Specified as a client-server protocol ● Any transport (even avian carrier) ● TCP if we build this into ZMTP ● Or ZeroMQ tcp://, at application level ● http://curvezmq.org
  • 17. Meet ZMTP ● The ZeroMQ Message Transport Protocol ● Wire protocol for ZeroMQ over TCP ● Fifth RFC now in drafting stage ● In ZeroMQ, JeroMQ, NetMQ, netty-zmtp, ... ● Version 3.0 is quite a big deal ● http://rfc.zeromq.org/spec:23/ZMTP
  • 18. What's New in ZMTP 3.0? ● Extensible security mechanisms ● Extensible connection metadata ● Endpoint resources (for port sharing) ● Better backwards version detection ● Explicit socket type semantics
  • 19. ZMTP's security mechanisms ● NULL is just that, empty ● PLAIN does clear-text authentication ● Test clients vs. production systems ● CURVE does CurveZMQ security ● Fully encrypted and authenticated ● <Insert your own here>
  • 20. libzmq already runs ZMTP 3.0 ● Git master does NULL and PLAIN ● Full backwards compatibility ● Supports extensible mechanisms ● We're now working on CURVE ● Next: DTLS, ...?
  • 21. Meet ZAP ● The ZeroMQ Authentication Protocol ● Extensible authentication services ● Using ZeroMQ request-reply protocol ● PAM, LDAP, Kerberos, passwd, etc. ● libzmq implements ZAP 1.0 ● http://rfc.zeromq.org/spec:27/ZAP
  • 22. Get involved ● Read the RFCs on http://rfc.zeromq.org ● Come to Brussels on 21 & 22 June 2013 ● For ZeroMQ Developers' Meetup ● http://zero.mq/bxl ● Talk to us on the zeromq-dev list
  • 23. Who are we? ● ZeroMQ community including iMatix ● iMatix makes messaging products ● Distributed systems since 1991 ● Original designers of AMQP (2004-07) ● Backers of ZeroMQ community (2007-) ● Authors of most ZeroMQ RFCs
  • 24. Thanks! ● Buy the O'Reilly ZeroMQ book ● Email me: [email protected] ● Twitter: @hintjens ● Blog: hintjens.com