Crypto 102 for developers

From DevSummit
Jump to: navigation, search

Crypto 102 for Developers: Tuesday Afternoon Session 1

  • What is threat modeling:
    • What info are you protecting, and from who?
    • Who is your real adversary and how to protect against them?
  • For example, at a public wifi access point like a coffeeshop, unencrypted data (like accessing insecure sites) is exposed to anyone else on the network; this data can be captured using commonly available tools and scripts. There are automated tools to change content on the fly within a network, like Header cap, or redirect to other IP addresses. Routers can easily be manipulated. Using a virtual private network (VPN) allows one layer (aka one hop) of protection. Using TOR allows for multiple hops (nodes) between you and the server that you’re accessing; the nodes have limited conversation between each other.
  • Many threats can be mitigated or eliminated with HTTPS, using TOR, or both.
  • SSL certificates are what authenticates that a particular crypto key belongs to a particular organization, allowing users to trust that the site is secure.
  • Where to get an SSL Certificate?
    • StarSSL provides certificates for free, although not wildcards (e.g. is covered, but not and
    • The EFF is launching Let’s Encrypt, a free certificate service, in 2015.
    • also provides certificates.
    • Who to avoid? Godaddy. They’re the worst.
  • Note: On some certificate authorities, registering “www.” covers with and without www. Registering without the www does not cover the www.
  • Also note: SSL certificates must be renewed, otherwise visitors will get a scary warning sign.
  • Certificate Authorities.
    • They issue SSL certificates.
    • They get hacked sometimes. Many of them have generic localhost certificates, which makes it easy for hackers to issue fraudulent certificates if they authority gets hacked.
  • Certificate Authorities ask for various forms of identification to tell that you are who you say you are. EV (extended verification), commonly used on bankings sites and expensive, denotes that the CA has undergone more
  • Certificate pinning:
    • Relating a certificate authority to a certificate, which makes it harder for other authorities to spoof your certificate. Contact browser developers (like Google) to implement pinning.
  • Perfect forward secrecy.
    • Uses a temporary key every single time. If the key is compromised, it doesn’t reveal previous information. Your Certificate Authority would set that up in the server certification.
  • So, should all sites be encrypted/use HTTPS? There are positives to this, but negatives include slower sites, or not being able to load the site in areas where it is blocked. It can also cause issues with a site if all content isn’t secure, displaying broken pages and/or security warnings.

Models for Trusting Certificates:

  • PKI (Public key infrastructure). Connecta to trusted bodies that are reconfirmed yearly. Trusted certificates can assign trust to intermediate CAs.
  • TOFU (Trust on first use). Trusts connection the first time, then alerts you if key changes.
  • Convergence/prospectus: older technology that checks to see whether remote locations are receiving the same certificate for a site, to detect man in the middle attacks. Does not protect against new certificates placed after site is hacked.
  • Certificate Transparency: Can detect when new certificate is issued; if you are not expecting a new certificate, that’s a red flag.
  • Other Crypto Terms:
  • Fingerprint: A hashed form of a public key. If the public key changes even a little, the fingerprint will change completely, making them a quick way to verify the public key.
  • OTR: Off the Record. Uses Zero Knowledge Proof of Equivalency. Compares the secrets between two parties with SMP (Socialist Millionaires Protocol) using a shared secret. Various applications use this, like TextSecure and Red Phone.
  • What if you want to send a stranger an encrypted email with PGP?
    • 1. Find other ways to communicate to verify key, like the phone.
    • 2. Look to see who signed their key, and are they trusted? Who signed the signers’ keys? Are they trusted?