Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

2013/11/13

Devoxx 2013 - Cryptographic operations in the browser

Nick Van den Bleeken
why
  • easy and secure authentication
  • sign/verify messages & docs
  • encrypt docs
existing crypto frameworks (Dojo, CryptoJS, etc.)
  • completely implemented in JavaScript
  • hard to protect against timing attacks (optimizations in JS engine change)
  • Math.random() is not secure
  • hard to get correct
  • performance issues (e.g. number is 64bit float)
alternatives:
  • java plugins
    • disabled in many browsers (recommendation US DHS)
    • not on mobile
  • native extensions
    • separate install
    • browser specific (some browsers drop support for extension!)
    • not on mobile
solution: Web Cryptography API
  • W3C standard: http://www.w3.org/TR/WebCryptoAPI/ (under construction...)
  • JS API for web developers
  • still requires TLS to prevent sniffing communication
  • still relatively complex (requires correct usage of encryption algorithms)
low level API
  • Basic building block: window.crypto.subtle
    • .generateKey(algorithmKeyGen ...)
      • callback when key is generated
    • importKey: add existing keys (e.g. public key of bank)
    • verify() signature
    • decrypt() message
    • sign() message
    • ...
  • use and combine it for more complex operation
high level API:
  • what framework to choose NaCl, KeyCzar, SJCL or ...
  • hard to define
  • existing APIs should address this: JQuery, Dojo, Prototype etc.
  • -> Not for now...
implemented by
  • MS IE11 (old version of spec)
  • chromium (flags)
  • mozilla (under development)
  • missing: Safari...
  • polycrypt (old version of spec)
  • Netflix: webcrypto key discovery
 future need: smartcard support (but: not a focus for US-based companies...)

2012/11/30

OWASP BeNeLux 2012: Sandboxing Javascript - Lieven Desmet

'Standard' webpage composition patterns:
  • script tag: full 3rd party integration
  • iframe tag: more robust (+ sandboxed keyword)
Solutions for security:
  • use a secure subset of Javascript (e.g. ADSafe, Facebook JS, etc.)
  • browser sandboxing (e.g. WebJail)
  • Serverside Tranformation of scripts (Google Caja, BrowserShield, etc.)
Risk examples of 3rd party integrations: (research)
  • stale domain names -> re-register & abuse
  • typo squatting: e.g. googlesyndicatio.com (without the 'n') triggered a lot of hits
JSand presentation:
  • prototype
  • aims
    • complete JS mediation
    • backwards compatibility
    • reasonable performance
  • components:
    • policies for 3rd party scripts
    • isolate JS through Google Secure EcmaScript library ("use strict" directive)
    • Proxy wrapper for domain access
    • AST transformations through Uglify lib
    • CORS / UMP headers
    • Serversside JS Proxy
  • nice demo, very early preview.