Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The secrets of cryptography

The secrets of cryptography

Alice and Bob have secrets they want to talk about without Eve being able to listen in. Worse yet, the mischievous Mallory delights in changing messages sent between parties. In such a hostile environment how can Alice talk to Bob without their messages being overheard and how can she be sure that it was Bob that sent the message in the first place?

This talk will take a brief look at historic codes and ciphers before taking a look at modern day Cryptography. If you want to be able to know the difference between a block cipher and a stream cipher or get a glimpse into the mathematics behind public key Cryptography this talk is for you.

Cipher challenge here: http://tiny.cc/0qq6by

carnage

June 11, 2016
Tweet

More Decks by carnage

Other Decks in Programming

Transcript

  1. Modern cryptography • Confidentiality • Key exchange • Identity •

    Authentication • Random number generation 20
  2. Stream cipher weaknesses • Keys must not be reused •

    Easy for an attacker to modify a message 24
  3. Stream cipher weaknesses • Keys must not be reused •

    Easy for an attacker to modify a message • Hard to partially decrypt messages 25
  4. AES

  5. AES: 1 round • Substitute Bytes • Shift Rows •

    Mix Columns • Add Round Key 26
  6. ECB

  7. CBC

  8. CTR

  9. GCM

  10. RSA

  11. RSA • (me)d ≡ m (mod n) • c ≡

    me (mod n) • cd ≡ (me)d ≡ m (mod n) 38
  12. RSA: Message signatures • (md)e ≡ m (mod n) •

    s ≡ md (mod n) • se ≡ (md)e ≡ m (mod n) 39
  13. Implementing Cryptography in PHP • Halite + libsodium • https://github.com/paragonie/halite

    • Defuse PHP encryption • https://github.com/defuse/php-encryption 44
  14. Further reading • Simon Singh - The code book •

    http://simonsingh.net/The_Black_Chamber 45
  15. Further reading • Simon Singh - The code book •

    http://simonsingh.net/The_Black_Chamber • Bruce Schneier • https://www.schneier.com 46
  16. Further reading • Simon Singh - The code book •

    http://simonsingh.net/The_Black_Chamber • Bruce Schneier • https://www.schneier.com • https://github.com/gilfether/phpcrypt 47
  17. Cipher Challenge • The cipher challenge is now closed, but

    if you want to have a go anyway, the main text is now here • http://tiny.cc/0qq6by • @phpyorkshire 49