Cinderella: Turning Shabby X.509 Certificates into Elegant Credentials with the Magic of Verifiable Computation

Antoine Delignat-Lavaud Cédric Fournet, Markulf Kohlweiss, X.509 Bryan Parno V.C. The X.509 Public Key Infrastructure (1988)

Chain

Endpoint certificate Intermediate certificate Root Certification Authority certificate certificates + X.509 Authentication Certificate private keys Authority

authorized certificate root validation certificates program (data)

(1-3KB / certificate)

OCSP, , Perspectives… certificates + X.509 Problem: Application Heterogeneity private keys

Basic Validation authorized certificate root Correct ASN.1 encoding (injective validation TLS validation certificates parsing) program (data) notBefore < now() < notAfter ? Correct signatures from one S/MIME validation certificate to the nextDomain == Subject CN? Domain in notBefore < email date < notAfter ? Subject Alternative Names? Matches Valid basic constraintsa wildcard name? Domain Subject emailAddress or Alternative compatible with Name Constraints? Valid key usagesNames include sender email?(1-3KB / certificate) • TLS Endpoint EKU includes TLS client / Endpoint EKU includes S/MIME ? • Acceptable algorithms and key sizesserver? Chain allows TLS EKU? S/MIME Chain allows S/MIME EKU? • 802.1X (Wi-Fi) Not revoked now OCSP, Certificate Not revoked when mail was sent • Code signing Transparency, • Document signing Perspectives… • … The SHAppening Crypto failures Recent PKI Failures HashClash rogue CA maleware 512 bit Korean Debian OpenSSL entropy bug (MD5 collision) NSA/GCHQ attack School CAs Bleichenbacher’s Stevens et al. against Windows CA DROWN e=3 attack on BERSerk PKCS#1 signatures KeyUsage

Basic constraints not properly enforced (recurring & catastrophic bug)

Name constraints failures OpenSSL GnuTLS X509v1 null prefix OpenSSL CVE- Formatting & semantics EKU-unrestricted 2015-1793 VeriSign certificates

VeriSign Superfish NetDiscovery Comodo hack Trustwave ANSSI India NIC StartCom hack VeriSign hack DigiNotar hack TÜRKTRUST China NNIC CA failures

2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 certificates + X.509 Problem: Privacy private keys

authorized Network certificate root Observer validation certificates program (data)

(1-3KB / certificate) Monitor Requests Network Learns all Observer certificate OCSP, Certificate contents Transparency, Perspectives… Cinderella: Main Idea

certificate authorized validation root policy certificates (C code) (data) certificates + private keys Other evidence (OCSP, CT) Geppetto verification key compiler evaluation key

Proof Proof (288 B) (288 B) Computation Outsourcing with Pinocchio

Complex programs C program F(priv, pub) compile to very large public verifier inputs arithmetic circuits private prover inputs Verification Evaluation Key Vk D X Key Ek C + X Setup Phase Arithmetic Circuit

Runtime Phase Ek Query(pub) F(priv, pub) Check(Proof, Vk) Succinct Proof

Proof

[GGP, CRYPTO’10]; [GGPR, EUROCRYPT’13]; [PGHR; S&P’13]; [CFHKKNBZ; S&P’15] Cinderella: Contributions

• A compiler from high-level validation policy templates to Pinocchio-optimized certificate validators • Pinocchio-optimized libraries for hashing and RSA-PKCS#1 signature validation • Several TLS validation policies based on concrete templates and additional evidence (OCSP), tested on real certificates • An e-Voting validation policy based on Helios with Estonian ID card Benefits and Caveats

• Compatible with existing PKI and • Computationally expensive certificates (practicality) • Initial agreement on the • Ensures uniform application of the validation policy validation policy but, allows • Reliance on security of verified flexible issuance policies computation system (new exotic • Complete control over disclosure of crypto assumption, new trusted certificate contents (anonymity) key generation) • Less exposure of long-term private • Does not solve key management key through weak algorithms (one more layer to manage) Cinderella: Soundness certificate authorized validation root certificates + Other evidence policy certificates private keys (OCSP, CT) (C code) (data)

Public inputs Geppetto compiler certificate validation verification key policy Public inputs (C code)

Proof (288 B) Compiling Certificate Templates

Private inputs seq {seq { # Validity Period # Version seq { tag<0>: const<2L>; var; # Serial Number var; Untrusted Native Parser var; }; Variables Parse certificate # Signature Algorithm Generate Prover Inputs seq { # Subject const; seq { const; }; varlist: C/QAP verifier set { Variable lists Concatenate compile-time # Issuer seq { Template constants and run-time vars seq { set { seq { var; Compute running hash const; var; Verifier const; }; compiler };};set { seq { const; }; const; }; }; Template }; Constants […] Produced Verifier (Fragment)

Variable list if(in_subject.v[0] > 2) { Constants Append(byte) append(&buffer, in_subjectval[2].tag); Add given byte to the hashing buffer append(&buffer, 0 + LEN(in_subjectval[2])); for(i=0; i<31; i++) Reduce() if(i

Compression Hashing buffer = 2 * hash function block size if(buffer.cur >= 85) reduce(&buffer, &hash); Output = hash of ASN.1 C verifier program formatted certificate contents Verifying PKCS#1 RSA Signatures

S ^ e mod N = 1ffffffffff[…]ffffffkkkkk[…]kkkkkkXXXXXXXXXXXXXXXXXXXXX S ^ e = S (((S ^ 2) ^ 2) … Hash (computed before) Assume fixed e = 65537 = 2 ^ 16 + 1

S 120 bits 120 bits 120 bits …

S^2 240+ bits 240+ bits 240+ bits 240+ bits 240+ bits …

Private inputs Q and R -> S² = Q*N + R Verify the prover hints are valid

Q*N 240+ bits 240+ bits 240+ bits 240+ bits 240+ bits …

R 120 bits 120 bits 120 bits …

S <- R Application: TLS Client (with Offline Signing)

Geppetto Client Pseudo compiler Cert Ek Pseudo Ek Ck, fields F(fields) Proof

evaluation key verification key Offline Pseudo Ek Proof Proof

Key Exchange signed with Ek

No change to TLS! Single Template Evaluation (With Signature)

1000 Seconds

100

10

1

0.1

0.01

0.001 Estonian EID S/MIME TLS server OCSP TLS Pseudonym Keygen time Proof time Verify time Application evaluation

1000 Seconds

100

10

1

0.1

0.01

0.001 TLS (2 intermediates + TLS (1 intermediate + TLS (no intermediate, Helios (OCSP) OCSP) OCSP) OCSP) Keygen time Proof time Verify time Conclusions

• One of the first practical application of verifiable computing

• We enhance the privacy and integrity of X.509 authentication

• No change to the PKI or to application protocols

• Working prototype for TLS and Helios

The Internet PKI

With M. Abadi, A. Birrell, I. Mironov, T. Wobber and Y. Xie (NDSS’14) Core Pinocchio protocol

������(��, �, �) � Generate the commitment: ������(�) �� , �� � � = ∑ � � � + � � � � � ∈ , , similarly for and Generate the MultiQAP for � , , , � = (� , � , � , � , � , � ). Pick random � () � � = ∏� and similarly for � and � Compute �� = {��}, {� }

� , � , � �� = �����(��, �, �) � �, , �, , �, ∈ Find ℎ(�) s.t. ℎ � ∗ � � = � � ∗ � � − �(�) () Compute �� = (� = �∏ ) Compute � = ∏ � Proof is (� , � , � �())

������(��, �) ������(��, �, �) {Yes, No} , � � , � = �(� , , �) , �(,) is a pairing: =? �(� , �()) and similarly for � and � , � ��, �� = �(�, �)�� Workaround: Tunneling

Compound I see all authentication certificate fields Server Certificate DH Key Exchange

Client Authentication

Server authenticated channel

Performance • TLS Renegotiation overhead of • TLS 1.3 Handshake Encryption tunneling • Server still sees all contents • Not always possible (S/MIME, code and document signing) Usability and Privacy of PKI Authentication

• User Unfriendly • Complex Current Privacy Approach • Key Compromise Impersonation attacks

CB = sign(tls-unique, cliSk(channel)) Anonymous Client Certificate Server Certificate DH Key Exchange

Channel-bound Client Authentication

Server authenticated channel Server authenticated channel

Authentication binding e.g. Channel ID or Renego Extension The Internet PKI Matches Issuer Signed by Public Key Issuer Subject Public Key Algorithm + Signature Parameters value Issuer Subject

Algorithm + Signature Public Key Parameters value Subject

Algorithm + Signature Parameters value Deployment: X.509 Signature Scheme

Root CA Peggy’s cert C Ek CA Public Key Intermediate CA Intermediate CA Public Key Pseudonym Certificate Algorithm + Signature Parameters value CN=Peggy, Age=29 Public Key OCSP certificate of Algorithm + Signature Parameters value Non-revocation Extension: Vk

Proof Pseudonym creation ASN.1

Binary encoding standard

Ancient (1984)

Distinguished rules (DER): unique serialization Checking RSA Signatures

Assume fixed e = 65537 = 2 ^ 16 + 1