SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Javascript Object Signing & Encryption
Aaron Zauner
azet@azet.org
lambda.co.at:
Highly-Available, Scalable & Secure Distributed Systems
DevOps/Security and Web Performance Meetup Vienna -
23/03/2015
Javascript Object Signing & Encryption
Examples
JOSE
Working Group
With the increased usage of JSON in protocols in the IETF and
elsewhere, there is now a desire to offer security services, which use
encryption, digital signatures, message authentication codes (MACs)
algorithms, that carry their data in JSON format.
[. . . ]
This Working Group will standardize the mechanism for integrity
protection (signature and MAC) and encryption as well as the
format for keys and algorithm identifiers to support interoperability
of security services for protocols that use JSON.
https://datatracker.ietf.org/wg/jose/charter/
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 1/24
JOSE
Couple of new IETF standards being worked on to provide a
framework for signatures and/or encryption of JSON data:
JSON Web Key “JWK”
JSON Web Signature “JWS”
JSON Web Encryption “JWE”
(Algorithms defined in JSON Web Algorithms “JWA”)
..it is..
End-to-end (E2E)
Not a replacement for TLS!
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 2/24
JWK: JSON Web Key
Datastructures to represent cryptographic keys
Used for JWS and JWE
Keys and Key-Sets
https://tools.ietf.org/html/draft-ietf-jose-json-web-key
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 3/24
JWK: Key
{"kty":"EC",
"crv":"P-256",
"x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
"y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0",
"kid":"Public key used in JWS A.3 example"
}
Key Type: EC (Elliptic Curve, Digital Signature Standard)
Curve: NIST P-256
Curve Points x and y
A Key Identifier kid
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 4/24
JWK: Key
Other parameters that can be assigned include:
use: Public Key Use (sig or enc)
key_ops: allowed operations (sign, verify, enc, dec, et cetera)
alg: Intended Algorithm to be used with this Key
x5u: X.509 URL parameter (certificate resource)
x5c: X.509 Certificate Chain
x5t and x5t#S256: X.509 SHA-1 and SHA-2 Thumbprints
..might sound familiar to X.509 certificate extensions.
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 5/24
JWK: JWK Set (Key Set)
ECC and RSA Public Keys:
{"keys":
[
{"kty":"EC",
"crv":"P-256",
"x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
"y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
"use":"enc",
"kid":"1"},
{"kty":"RSA",
"n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx
4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMs
tn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2
QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbI
SD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqb
w0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
"e":"AQAB",
"alg":"RS256",
"kid":"2011-04-29"}
]
}
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 6/24
JWK: JWK Set (Key Set)
Set of Symmetric Encryption Keys (AES key wrap and HMAC):
{"keys":
[
{"kty":"oct",
"alg":"A128KW",
"k":"GawgguFyGrWKav7AX4VKUg"},
{"kty":"oct",
"k":"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-
1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow",
"kid":"HMAC key used in JWS A.1 example"}
]
}
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 7/24
JWS: JSON Web Signature
Content signed with:
Digital Signature .. or;
Message Authentication Code (MAC)
..thus provides integrity protection.
https://tools.ietf.org/html/draft-ietf-jose-json-web-signature
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 8/24
JWS: JSON Web Signature
JOSE Header (JWS Protected and Unprotected Headers)
JWS Payload
JWS Signature
two serialization formats:
‘compact’: URL-safe (HTTP Auth, URI)
JWS JSON - JSON Objects (values BASE64URL encoded)
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 9/24
JWS: JSON Web Signature
Compact:
BASE64URL(UTF8(JWS Protected Header)) || ‚.‚ ||
BASE64URL(JWS Payload) || ‚.‚ ||
BASE64URL(JWS Signature)
JSON:
{
"payload":"<payload contents>",
"signatures":[
{"protected":"<integrity-protected header 1 contents>",
"header":<non-integrity-protected header 1 contents>,
"signature":"<signature 1 contents>"},
...
{"protected":"<integrity-protected header N contents>",
"header":<non-integrity-protected header N contents>,
"signature":"<signature N contents>"}]
}DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 10/24
JWS: JSON Web Signature
JSON Web Token Example
Header
Object:
{"typ":"JWT",
"alg":"HS256"}
Encoded:
eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 11/24
JWS: JSON Web Signature
JSON Web Token Example
Payload
Object:
{"iss":"joe",
"exp":1300819380,
"http://example.com/is_root":true}
Encoded:
eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQo
gImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 12/24
JWS: JSON Web Signature
JSON Web Token Example
Header
Payload
Signature
..seperated by a dot (.)
Encoded:
eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9
.
eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
cGxlLmNvbS9pc19yb290Ijp0cnVlfQ
.
dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 13/24
JWS: JSON Web Signature
Header Parameters
alg: Algorithm identifier for JWS
jku: JWK Set URL
jkw: JSON Web Key (JWK)
kid: Key ID
x5u: X.509 URL
x5c: X.509 Chain
x5t and x5t#S256: X.509 Cert. Thumbprint
typ: “Type” (MIME)
cty: Content Type
crit: “Critical” specifies fields that MUST be protected
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 14/24
JWE: JSON Web Encryption
Format is very similar to JWS, but used for encryption of data
BASE64URL(UTF8(JWE Protected Header)) || ‚.‚ ||
BASE64URL(JWE Encrypted Key) || ‚.‚ ||
BASE64URL(JWE Initialization Vector) || ‚.‚ ||
BASE64URL(JWE Ciphertext) || ‚.‚ ||
BASE64URL(JWE Authentication Tag)
https://tools.ietf.org/html/draft-ietf-jose-json-web-encryption
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 15/24
JWE: JSON Web Encryption
Header Parameters
alg: Algorithm identifier for JWE
enc: Content Encryption Algorithm
zip: Compression algorithm to be used
jku: JWK Set URL
jkw: JSON Web Key (JWK)
kid: Key ID
x5u: X.509 URL
x5c: X.509 Chain
x5t and x5t#S256: X.509 Cert. Thumbprint
typ: “Type” (MIME)
cty: Content Type
crit: “Critical” specifies fields that MUST be protected
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 16/24
JWE: JSON Web Encryption
Example (flattened JSON representation):
{
"protected":
"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0",
"unprotected":
{"jku":"https://server.example.com/keys.jwks"},
"header":
{"alg":"A128KW","kid":"7"},
"encrypted_key":
"6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ",
"iv":
"AxY8DCtDaGlsbGljb3RoZQ",
"ciphertext":
"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY",
"tag":
"Mz-VPPyU4RlcuYv1IwIvzw"
}
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 17/24
JWA: JSON Web Algorithms
JWA Specifies a list of crypto primitives (algorithms) to be used
in conjunction with JOSE and their parameters
Not going into that in this talk. Some of them you’ve already
seen in previous examples, if you want more details on the
algorithms that can be used look into the draft
DON’T home-brew your own crypto with these. Use existing,
verified, technologies that build on JOSE
https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 18/24
Running Code
Implementations in all popular languages are available on GitHub!
Python
import jose
claims = {
"iss": "http://www.example.com",
"exp": int(time()) + 3600,
"sub": 42,
}
jwk = {"k": "password"}
jws = jose.sign(claims, jwk, alg="HS256")
http://jose.readthedocs.org/en/latest/
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 19/24
Authentication Protocols
OAuth
OpenID / OAuth2.0
..client authentication and authorization can be handeled by JOSE /
Web Tokens entirely.
See:
https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer
https://developers.google.com/accounts/docs/OpenIDConnect
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 20/24
Google Wallet
Google Wallet uses JWT to exchange information between
clients (app) and Server
https://developers.google.com/wallet/instant-buy/about-jwts
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 21/24
ACME / Let’s Encrypt
The protocol that Let’s Encrypt employs (ACME) uses JOSE for
messaging
i.e. claims for certificates / domains and revocation
https://letsencrypt.github.io/acme-spec/
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 22/24
W3C WebCrypto
W3C WebCrypto is a JavaScript API for performing basic
cryptographic operations in web applications
W3C WebCrypto employs JOSE (Key Format, Signatures,
Algorithms)
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 23/24
Thanks for your patience. Are there any questions?
Twitter:
@a_z_e_t
E-Mail:
azet@azet.org
XMPP:
azet@jabber.ccc.de
GitHub:
https://github.com/azet
GPG Fingerprint:
7CB6 197E 385A 02DC 15D8 E223 E4DB 6492 FDB9 B5D5
DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption
Aaron Zauner 24/24

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 LinkMongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 LinkMongoDB
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJohn Anderson
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 -  NGSI-LD Advanced Operations | Train the Trainers ProgramSession 5 -  NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 - NGSI-LD Advanced Operations | Train the Trainers ProgramFIWARE
 
Understanding JWT Exploitation
Understanding JWT ExploitationUnderstanding JWT Exploitation
Understanding JWT ExploitationAkshaeyBhosale
 
Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015Derrick Isaacson
 
Autenticação com Json Web Token (JWT)
Autenticação com Json Web Token (JWT)Autenticação com Json Web Token (JWT)
Autenticação com Json Web Token (JWT)Ivan Rosolen
 
MongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDB
MongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDBMongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDB
MongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDBMongoDB
 
Distributed Identities with OpenID
Distributed Identities with OpenIDDistributed Identities with OpenID
Distributed Identities with OpenIDBastian Hofmann
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJohn Anderson
 
Breaking vaults: Stealing Lastpass protected secrets
Breaking vaults: Stealing Lastpass protected secretsBreaking vaults: Stealing Lastpass protected secrets
Breaking vaults: Stealing Lastpass protected secretsMartin Vigo
 
Blockchain Technologies for Data Science
Blockchain Technologies for Data ScienceBlockchain Technologies for Data Science
Blockchain Technologies for Data ScienceBruno Gonçalves
 
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramFIWARE
 
A XSSmas carol
A XSSmas carolA XSSmas carol
A XSSmas carolcgvwzq
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 
Cryptography 101 for Java Developers - Devoxx 2019
Cryptography 101 for Java Developers - Devoxx 2019Cryptography 101 for Java Developers - Devoxx 2019
Cryptography 101 for Java Developers - Devoxx 2019Michel Schudel
 
Honing headers for highly hardened highspeed hypertext
Honing headers for highly hardened highspeed hypertextHoning headers for highly hardened highspeed hypertext
Honing headers for highly hardened highspeed hypertextFastly
 
Cryptography in PHP: use cases
Cryptography in PHP: use casesCryptography in PHP: use cases
Cryptography in PHP: use casesEnrico Zimuel
 
Cryptography 101 for Java Developers - JavaZone2019
Cryptography 101 for Java Developers - JavaZone2019Cryptography 101 for Java Developers - JavaZone2019
Cryptography 101 for Java Developers - JavaZone2019Michel Schudel
 
MongoDB + Java + Spring Data
MongoDB + Java + Spring DataMongoDB + Java + Spring Data
MongoDB + Java + Spring DataAnton Sulzhenko
 

Was ist angesagt? (20)

MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 LinkMongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 -  NGSI-LD Advanced Operations | Train the Trainers ProgramSession 5 -  NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
 
Understanding JWT Exploitation
Understanding JWT ExploitationUnderstanding JWT Exploitation
Understanding JWT Exploitation
 
Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015
 
Autenticação com Json Web Token (JWT)
Autenticação com Json Web Token (JWT)Autenticação com Json Web Token (JWT)
Autenticação com Json Web Token (JWT)
 
MongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDB
MongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDBMongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDB
MongoDB .local Munich 2019: Tips and Tricks++ for Querying and Indexing MongoDB
 
Distributed Identities with OpenID
Distributed Identities with OpenIDDistributed Identities with OpenID
Distributed Identities with OpenID
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 
Data Modeling with NGSI, NGSI-LD
Data Modeling with NGSI, NGSI-LDData Modeling with NGSI, NGSI-LD
Data Modeling with NGSI, NGSI-LD
 
Breaking vaults: Stealing Lastpass protected secrets
Breaking vaults: Stealing Lastpass protected secretsBreaking vaults: Stealing Lastpass protected secrets
Breaking vaults: Stealing Lastpass protected secrets
 
Blockchain Technologies for Data Science
Blockchain Technologies for Data ScienceBlockchain Technologies for Data Science
Blockchain Technologies for Data Science
 
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
 
A XSSmas carol
A XSSmas carolA XSSmas carol
A XSSmas carol
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
Cryptography 101 for Java Developers - Devoxx 2019
Cryptography 101 for Java Developers - Devoxx 2019Cryptography 101 for Java Developers - Devoxx 2019
Cryptography 101 for Java Developers - Devoxx 2019
 
Honing headers for highly hardened highspeed hypertext
Honing headers for highly hardened highspeed hypertextHoning headers for highly hardened highspeed hypertext
Honing headers for highly hardened highspeed hypertext
 
Cryptography in PHP: use cases
Cryptography in PHP: use casesCryptography in PHP: use cases
Cryptography in PHP: use cases
 
Cryptography 101 for Java Developers - JavaZone2019
Cryptography 101 for Java Developers - JavaZone2019Cryptography 101 for Java Developers - JavaZone2019
Cryptography 101 for Java Developers - JavaZone2019
 
MongoDB + Java + Spring Data
MongoDB + Java + Spring DataMongoDB + Java + Spring Data
MongoDB + Java + Spring Data
 

Ähnlich wie Javascript Object Signing & Encryption

Securing TodoMVC Using the Web Cryptography API
Securing TodoMVC Using the Web Cryptography APISecuring TodoMVC Using the Web Cryptography API
Securing TodoMVC Using the Web Cryptography APIKevin Hakanson
 
Java script and web cryptography (cf.objective)
Java script and web cryptography (cf.objective)Java script and web cryptography (cf.objective)
Java script and web cryptography (cf.objective)ColdFusionConference
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....Patrick Lauke
 
[Poland] It's only about frontend
[Poland] It's only about frontend[Poland] It's only about frontend
[Poland] It's only about frontendOWASP EEE
 
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...iMasters
 
iMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within MicroservicesiMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within MicroservicesErick Belluci Tedeschi
 
sf bay area dfir meetup (2016-04-30) - OsxCollector
sf bay area dfir meetup (2016-04-30) - OsxCollector   sf bay area dfir meetup (2016-04-30) - OsxCollector
sf bay area dfir meetup (2016-04-30) - OsxCollector Rishi Bhargava
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesBrad Hill
 
Best Practices of IoT in the Cloud
Best Practices of IoT in the CloudBest Practices of IoT in the Cloud
Best Practices of IoT in the CloudAmazon Web Services
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebPeter Lubbers
 
Best Practices for IoT Security in the Cloud
Best Practices for IoT Security in the CloudBest Practices for IoT Security in the Cloud
Best Practices for IoT Security in the CloudAmazon Web Services
 
Nk API - examples
Nk API - examplesNk API - examples
Nk API - examplesnasza-klasa
 
Browser security
Browser securityBrowser security
Browser securityUday Anand
 
RoadSec 2017 - Trilha AppSec - APIs Authorization
RoadSec 2017 - Trilha AppSec - APIs AuthorizationRoadSec 2017 - Trilha AppSec - APIs Authorization
RoadSec 2017 - Trilha AppSec - APIs AuthorizationErick Belluci Tedeschi
 
OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)Wade Minter
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
 
FIWARE Training: IoT and Legacy
FIWARE Training: IoT and LegacyFIWARE Training: IoT and Legacy
FIWARE Training: IoT and LegacyFIWARE
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 

Ähnlich wie Javascript Object Signing & Encryption (20)

Securing TodoMVC Using the Web Cryptography API
Securing TodoMVC Using the Web Cryptography APISecuring TodoMVC Using the Web Cryptography API
Securing TodoMVC Using the Web Cryptography API
 
Java script and web cryptography (cf.objective)
Java script and web cryptography (cf.objective)Java script and web cryptography (cf.objective)
Java script and web cryptography (cf.objective)
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
[Poland] It's only about frontend
[Poland] It's only about frontend[Poland] It's only about frontend
[Poland] It's only about frontend
 
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
 
iMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within MicroservicesiMasters Intercon 2016 - Identity within Microservices
iMasters Intercon 2016 - Identity within Microservices
 
sf bay area dfir meetup (2016-04-30) - OsxCollector
sf bay area dfir meetup (2016-04-30) - OsxCollector   sf bay area dfir meetup (2016-04-30) - OsxCollector
sf bay area dfir meetup (2016-04-30) - OsxCollector
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Best Practices of IoT in the Cloud
Best Practices of IoT in the CloudBest Practices of IoT in the Cloud
Best Practices of IoT in the Cloud
 
HTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the WebHTML5 WebSocket: The New Network Stack for the Web
HTML5 WebSocket: The New Network Stack for the Web
 
Best Practices for IoT Security in the Cloud
Best Practices for IoT Security in the CloudBest Practices for IoT Security in the Cloud
Best Practices for IoT Security in the Cloud
 
Nk API - examples
Nk API - examplesNk API - examples
Nk API - examples
 
Browser security
Browser securityBrowser security
Browser security
 
RoadSec 2017 - Trilha AppSec - APIs Authorization
RoadSec 2017 - Trilha AppSec - APIs AuthorizationRoadSec 2017 - Trilha AppSec - APIs Authorization
RoadSec 2017 - Trilha AppSec - APIs Authorization
 
OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)OpenStack APIs: Present and Future (Beta Talk)
OpenStack APIs: Present and Future (Beta Talk)
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
FIWARE Training: IoT and Legacy
FIWARE Training: IoT and LegacyFIWARE Training: IoT and Legacy
FIWARE Training: IoT and Legacy
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Life on Clouds: a forensics overview
Life on Clouds: a forensics overviewLife on Clouds: a forensics overview
Life on Clouds: a forensics overview
 

Mehr von Aaron Zauner

Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...
Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...
Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...Aaron Zauner
 
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...Aaron Zauner
 
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...Aaron Zauner
 
State of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at LargeState of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at LargeAaron Zauner
 
Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Aaron Zauner
 
Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Aaron Zauner
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS SecurityAaron Zauner
 
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014Aaron Zauner
 
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 [Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 Aaron Zauner
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS SecurityAaron Zauner
 
BetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto HardeningBetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto HardeningAaron Zauner
 
How to save the environment
How to save the environmentHow to save the environment
How to save the environmentAaron Zauner
 
Sc12 workshop-writeup
Sc12 workshop-writeupSc12 workshop-writeup
Sc12 workshop-writeupAaron Zauner
 

Mehr von Aaron Zauner (13)

Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...
Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...
Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating...
 
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
 
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
 
State of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at LargeState of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at Large
 
Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)
 
Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS Security
 
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
 
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 [Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS Security
 
BetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto HardeningBetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto Hardening
 
How to save the environment
How to save the environmentHow to save the environment
How to save the environment
 
Sc12 workshop-writeup
Sc12 workshop-writeupSc12 workshop-writeup
Sc12 workshop-writeup
 

Kürzlich hochgeladen

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 

Kürzlich hochgeladen (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Javascript Object Signing & Encryption

  • 1. Javascript Object Signing & Encryption Aaron Zauner azet@azet.org lambda.co.at: Highly-Available, Scalable & Secure Distributed Systems DevOps/Security and Web Performance Meetup Vienna - 23/03/2015
  • 2. Javascript Object Signing & Encryption Examples
  • 3. JOSE Working Group With the increased usage of JSON in protocols in the IETF and elsewhere, there is now a desire to offer security services, which use encryption, digital signatures, message authentication codes (MACs) algorithms, that carry their data in JSON format. [. . . ] This Working Group will standardize the mechanism for integrity protection (signature and MAC) and encryption as well as the format for keys and algorithm identifiers to support interoperability of security services for protocols that use JSON. https://datatracker.ietf.org/wg/jose/charter/ DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 1/24
  • 4. JOSE Couple of new IETF standards being worked on to provide a framework for signatures and/or encryption of JSON data: JSON Web Key “JWK” JSON Web Signature “JWS” JSON Web Encryption “JWE” (Algorithms defined in JSON Web Algorithms “JWA”) ..it is.. End-to-end (E2E) Not a replacement for TLS! DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 2/24
  • 5. JWK: JSON Web Key Datastructures to represent cryptographic keys Used for JWS and JWE Keys and Key-Sets https://tools.ietf.org/html/draft-ietf-jose-json-web-key DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 3/24
  • 6. JWK: Key {"kty":"EC", "crv":"P-256", "x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU", "y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0", "kid":"Public key used in JWS A.3 example" } Key Type: EC (Elliptic Curve, Digital Signature Standard) Curve: NIST P-256 Curve Points x and y A Key Identifier kid DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 4/24
  • 7. JWK: Key Other parameters that can be assigned include: use: Public Key Use (sig or enc) key_ops: allowed operations (sign, verify, enc, dec, et cetera) alg: Intended Algorithm to be used with this Key x5u: X.509 URL parameter (certificate resource) x5c: X.509 Certificate Chain x5t and x5t#S256: X.509 SHA-1 and SHA-2 Thumbprints ..might sound familiar to X.509 certificate extensions. DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 5/24
  • 8. JWK: JWK Set (Key Set) ECC and RSA Public Keys: {"keys": [ {"kty":"EC", "crv":"P-256", "x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4", "y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM", "use":"enc", "kid":"1"}, {"kty":"RSA", "n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx 4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMs tn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2 QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbI SD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqb w0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", "e":"AQAB", "alg":"RS256", "kid":"2011-04-29"} ] } DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 6/24
  • 9. JWK: JWK Set (Key Set) Set of Symmetric Encryption Keys (AES key wrap and HMAC): {"keys": [ {"kty":"oct", "alg":"A128KW", "k":"GawgguFyGrWKav7AX4VKUg"}, {"kty":"oct", "k":"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T- 1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow", "kid":"HMAC key used in JWS A.1 example"} ] } DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 7/24
  • 10. JWS: JSON Web Signature Content signed with: Digital Signature .. or; Message Authentication Code (MAC) ..thus provides integrity protection. https://tools.ietf.org/html/draft-ietf-jose-json-web-signature DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 8/24
  • 11. JWS: JSON Web Signature JOSE Header (JWS Protected and Unprotected Headers) JWS Payload JWS Signature two serialization formats: ‘compact’: URL-safe (HTTP Auth, URI) JWS JSON - JSON Objects (values BASE64URL encoded) DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 9/24
  • 12. JWS: JSON Web Signature Compact: BASE64URL(UTF8(JWS Protected Header)) || ‚.‚ || BASE64URL(JWS Payload) || ‚.‚ || BASE64URL(JWS Signature) JSON: { "payload":"<payload contents>", "signatures":[ {"protected":"<integrity-protected header 1 contents>", "header":<non-integrity-protected header 1 contents>, "signature":"<signature 1 contents>"}, ... {"protected":"<integrity-protected header N contents>", "header":<non-integrity-protected header N contents>, "signature":"<signature N contents>"}] }DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 10/24
  • 13. JWS: JSON Web Signature JSON Web Token Example Header Object: {"typ":"JWT", "alg":"HS256"} Encoded: eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 11/24
  • 14. JWS: JSON Web Signature JSON Web Token Example Payload Object: {"iss":"joe", "exp":1300819380, "http://example.com/is_root":true} Encoded: eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQo gImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 12/24
  • 15. JWS: JSON Web Signature JSON Web Token Example Header Payload Signature ..seperated by a dot (.) Encoded: eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 . eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt cGxlLmNvbS9pc19yb290Ijp0cnVlfQ . dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 13/24
  • 16. JWS: JSON Web Signature Header Parameters alg: Algorithm identifier for JWS jku: JWK Set URL jkw: JSON Web Key (JWK) kid: Key ID x5u: X.509 URL x5c: X.509 Chain x5t and x5t#S256: X.509 Cert. Thumbprint typ: “Type” (MIME) cty: Content Type crit: “Critical” specifies fields that MUST be protected DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 14/24
  • 17. JWE: JSON Web Encryption Format is very similar to JWS, but used for encryption of data BASE64URL(UTF8(JWE Protected Header)) || ‚.‚ || BASE64URL(JWE Encrypted Key) || ‚.‚ || BASE64URL(JWE Initialization Vector) || ‚.‚ || BASE64URL(JWE Ciphertext) || ‚.‚ || BASE64URL(JWE Authentication Tag) https://tools.ietf.org/html/draft-ietf-jose-json-web-encryption DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 15/24
  • 18. JWE: JSON Web Encryption Header Parameters alg: Algorithm identifier for JWE enc: Content Encryption Algorithm zip: Compression algorithm to be used jku: JWK Set URL jkw: JSON Web Key (JWK) kid: Key ID x5u: X.509 URL x5c: X.509 Chain x5t and x5t#S256: X.509 Cert. Thumbprint typ: “Type” (MIME) cty: Content Type crit: “Critical” specifies fields that MUST be protected DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 16/24
  • 19. JWE: JSON Web Encryption Example (flattened JSON representation): { "protected": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0", "unprotected": {"jku":"https://server.example.com/keys.jwks"}, "header": {"alg":"A128KW","kid":"7"}, "encrypted_key": "6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ", "iv": "AxY8DCtDaGlsbGljb3RoZQ", "ciphertext": "KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY", "tag": "Mz-VPPyU4RlcuYv1IwIvzw" } DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 17/24
  • 20. JWA: JSON Web Algorithms JWA Specifies a list of crypto primitives (algorithms) to be used in conjunction with JOSE and their parameters Not going into that in this talk. Some of them you’ve already seen in previous examples, if you want more details on the algorithms that can be used look into the draft DON’T home-brew your own crypto with these. Use existing, verified, technologies that build on JOSE https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 18/24
  • 21. Running Code Implementations in all popular languages are available on GitHub! Python import jose claims = { "iss": "http://www.example.com", "exp": int(time()) + 3600, "sub": 42, } jwk = {"k": "password"} jws = jose.sign(claims, jwk, alg="HS256") http://jose.readthedocs.org/en/latest/ DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 19/24
  • 22. Authentication Protocols OAuth OpenID / OAuth2.0 ..client authentication and authorization can be handeled by JOSE / Web Tokens entirely. See: https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer https://developers.google.com/accounts/docs/OpenIDConnect DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 20/24
  • 23. Google Wallet Google Wallet uses JWT to exchange information between clients (app) and Server https://developers.google.com/wallet/instant-buy/about-jwts DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 21/24
  • 24. ACME / Let’s Encrypt The protocol that Let’s Encrypt employs (ACME) uses JOSE for messaging i.e. claims for certificates / domains and revocation https://letsencrypt.github.io/acme-spec/ DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 22/24
  • 25. W3C WebCrypto W3C WebCrypto is a JavaScript API for performing basic cryptographic operations in web applications W3C WebCrypto employs JOSE (Key Format, Signatures, Algorithms) DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 23/24
  • 26. Thanks for your patience. Are there any questions? Twitter: @a_z_e_t E-Mail: azet@azet.org XMPP: azet@jabber.ccc.de GitHub: https://github.com/azet GPG Fingerprint: 7CB6 197E 385A 02DC 15D8 E223 E4DB 6492 FDB9 B5D5 DevOps/Security and Web Performance Meetup Vienna - 23/03/2015 Javascript Object Signing & Encryption Aaron Zauner 24/24