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

Security 101 @ JAX 2014

Security 101 @ JAX 2014

Our introductory talk on (IT-) security, together with Tobias Hahn (security guru from Fraunhofer SIT)

@gernotstarke, @FraunhoferSIT

Dr. Gernot Starke

May 15, 2014
Tweet

More Decks by Dr. Gernot Starke

Other Decks in Programming

Transcript

  1. Disclaimer !  Topic too large – needed to unduly shorten

    ! Too many dimensions – needed to unduly focus
  2. WEDNTKASOTS* NEVER build it yourself! ...people smarter than you will

    surely find bugs and exploit them! ...What Every Developer Needs To Know About Security On Two Slides!
  3. WEDNTKASOTS* Always assume others are smarter than you! ...What Every

    Developer Needs To Know About Security On Two Slides!
  4. Security... Covers assets, values, risks.. !  ... and their protection

    Assets (data, things, people) !  ...get damaged, are stolen !  ...are illegally modified
  5. (IT-) Security? 1.  Confidentiality (Vertraulichkeit) 2.  Integrity (Unverfälschtheit, Echtheit) 3. 

    Availability (Verfügbarkeit) 4.  Non-Repudiation (Nicht-Abstreitbarkeit)
  6. The road less traveled by ! Attackers can use different

    paths (vectors) ! Each vector has individual risks and costs for attacker and victim
  7. Real-World vs IT Attacks In RW, attacker needs to visit

    target. In IT, attacks happen from everywhere
  8. Authentication !   Process of confirming a given identity !

      „you are who you say you are“ !   Most widely used: username + password !   Different factors can be used: !   Knowledge factors: Password, PIN !   Ownership factors: Security token, SmartCard, CellPhone !   Inherence factors: Biometric identifiers !   Multi-factor authentication: Combination of factors !   E.g. Online-Banking with username + passwort and SMS-Tan
  9. Authorization !   After user has been authenticated !  

    Grants a set of permissions !   Different mechanisms available: !   Access-Control lists, attached to resource objects !   Capabilities: uses unforgeable tokens of authority !   Assignment of permissions should follow the „principle of least privilege“
  10. Encryption! Awgb Dimouszt Hlzbus wly o Szbauss sokpxtmttiwrv, evsinooe, kkfbtltocgla,

    mno icdxnaqr diwvvmpet. Sk kra apshwe wenebqneooc qg ate okjvthwyeyz cw khtbuekf jkblzcp, vffdbkunr g tfzfhxidghzwg vr tsk qfvvlbtd ut "rtzvdiena" rvw "jamaahrbbvz" wtzv kpx Agrttu divounp. Ziiqgn us horvtr jandorvzxk fo mk hym yhfhpx cw khtbuekf jkblzcp gbu ikauftiwrt bufewrwxmgjq. Dfxweo Pvdlo Coi QB, Agrttu nwkrqd quf kpx Navpxbdmga Oook oel Vfbhpx Gtphvx (GNIG) rb Usqtnnzvg Ihdk, Mxwkibu'e czjsszxhwiym qvvmyq. Fzx o kqfl te hgg ymtk af Sah 8, kpx zqceoce zxzboyywstx mar Rkfdig umvlr qigiamnlrmjql. Oq dpbwjmw h zuxhsi wy aqcstwhcxz roc hfvidpzg Rkfdig jupskfj, qgjxuoobx bal yeencu wy ate muasm, tu qlpihiwflohltwtie tmcsobv bahf czazu nbup spzhzvzz roc zvv Mgpsml sotpbuq. Aqzsi bal iac ns ... Alan Mathison Turing was a British mathematician, logician, cryptanalyst, and computer scientist. He was highly influential in the development of computer science, providing a formalisation of the concepts of "algorithm" and "computation" with the Turing machine. Turing is widely considered to be the father of computer science and artificial intelligence. During World War II, Turing worked for the Government Code and Cypher School (GCCS) at Bletchley Park, Britain's codebreaking centre. For a time he was head of Hut 8, the section responsible for German naval cryptanalysis. He devised a number of techniques for breaking German ciphers, including the method of the bombe, an electromechanical machine that could find settings for the Enigma machine. After the war he worked at the...
  11. Symmetric Crypto !  SAME key for encryption and decryption !

     Key needs to be exchanged between sender and receiver! Plaintext: Ich bin keine verschlüsselte Nachricht Sender Ciphertext: z&7we ?kncx quopa eo9tn r$+9s %cupn Empfänger Plaintext: Ich bin keine verschlüsselte Nachricht Verschlüsselung Entschlüsselung
  12. Vigenere-Cipher! Awgb Dimouszt Hlzbus wly o Szbauss sokpxtmttiwrv, evsinooe, kkfbtltocgla,

    mno icdxnaqr diwvvmpet. Sk kra apshwe wenebqneooc qg ate okjvthwyeyz cw khtbuekf jkblzcp, vffdbkunr g tfzfhxidghzwg vr tsk qfvvlbtd ut "rtzvdiena" rvw "jamaahrbbvz" wtzv kpx Agrttu divounp. Ziiqgn us horvtr jandorvzxk fo mk hym yhfhpx cw khtbuekf jkblzcp gbu ikauftiwrt bufewrwxmgjq. Dfxweo Pvdlo Coi QB, Agrttu nwkrqd quf kpx Navpxbdmga Oook oel Vfbhpx Gtphvx (GNIG) ... Alan Mathison Turing was a British mathematician, logician, cryptanalyst, and computer scientist. He was highly influential in the development of computer science, providing a formalisation of the concepts of "algorithm" and "computation" with the Turing machine. Turing is widely considered to be the father of computer science and artificial intelligence. During World War II, Turing worked for the Government Code and Cypher School (GCCS)... +
  13. Breaking Secret Ciphers (2) ! Ciphertext-only attack: know nothing, just

    guess key ! Known-Plaintext attack: know part of plaintext !  Chosen-Plaintext attack Always assume opponents knows the crypto algorithm.
  14. Breaking a Cipher (3a) Choose next decryption key Try to

    decrypt Match result agains dictionary Many hits? done YES No
  15. Breaking a Cipher (3b) Choose next decryption key Try to

    decrypt Match result agains dictionary Many hits? done YES No With specific algorithm
  16. aarkwuv78 plv8yr40l1t ejjfurlolkhu ekcjm9808 3nm Ingenious! Asymmetric Crypto (1)! A

    message that needs to be sent from ALICE to BOB and kept secret Encrypted with Bob‘s public key A message that needs to be sent from ALICE to BOB and kept secret Decypted with Bob‘s private key
  17. aarkwuv78 plv8yr40l1t ejjfurlolkhu ekcjm9808 3nm Ingenious! Asymmetric Crypto (2)! A

    message that needs to be sent from ALICE to BOB and kept secret A message that needs to be sent from ALICE to BOB and kept secret Signed with Alice‘ private key Verify signature with Alice‘ public key
  18. Ingenious! Asymmetric Crypto (7)! Problem: How can you verify that

    the public key from the server is the actual key of the recipient? Solutions: Web of trust (PGP), digital certificates (PKI), verfication of fingerprint over other trusted channels (phone) Want to try encrypted email right now? https://encrypt.to/0x50610A4A (TH) https://encrypt.to/0x8C5CC3AE (GS)
  19. Hybrid Cryptosystems !  Combine public-key and symmetric- key crypto !

    public-key to encrypt symmetric key ! symmetric key to encrypt data ! Used e.g. by PGP and SSL/TLS
  20. Math background (1) !  RSA: Factoring large integers !  Best

    publicly known factorization of general number form: RSA-768 in 2009 (768 Bits, 232 decimal digits) ! Using the NFS-Algorithm ! Equivalent of 2000 years of computing on 2.2GHz single core
  21. Math background (2) !  DH: Finding discrete logarithms in groups

    ! Current record over integers mod p: 530-bit using NFS (2007) ! Current record over EC: 112-bit using Pollard-rho algorithm (2009) !   200 PS3 over 6 months
  22. Random values and entropy !   Keys used in crypto

    MUST be random ! Without sufficient entropy, key could be predictable ! Would reduce effort needed to break the key !   Random vs. Pseudorandom !  „True“ random numbers based on physical phenomenons ! Pseudorandom: Computation of apparently random results, starting from initial value (seed)
  23. The story of Dual_EC_DRBG (1) ! Supposed to be a

    Cryptographically Secure Pseudo Random Number Generator ! Published as Draft in 2004, allegedly influenced by NSA ! Included by RSA as default in the BSAFE crypto lib in 2004 ! Allegedly, NSA paid $10 million to RSA in 2004 for this ! Weakness found in 2007, might have been inserted by the NSA ! Removed from NIST recommendations 2014
  24. The story of Dual_EC_DRBG (2) !   By knowing a

    set of „secret numbers“, the internal state of the PRNG could be calculated !   Requires the attacker to be able to access the output of a single round !   SSL/TLS vulnerable → Cryptographic nonce send in clear text during during connection setup (in SSL Client Hello) !   „To put that in real terms, you only need to monitor one TLS internet encryption connection in order to crack the security of that protocol.” Bruce Schneier
  25. Passwords ! used for authentication for a very long time

    ! Watchwords in the Roman military ! Should be easy to remember, yet hard to guess, and should not be reused for different accounts !  Easy, right? !  Top three passwords 2013: „123456“ „password“ „12345678“ ! Entered by user, sent to and verified by server
  26. Passwords and hashing !   Passwords should never be stored

    in clear text on the server !   Solution: Server stores the password hash. Login verified by hashing password entered by user and comparing to database
  27. Attacks on password-based systems !   Online: using website authentication

    field !   Made harder by lockout / slow connections !   Offline: using previously stolen/leaked password database !   Made harder by using slow hashes and salts ! Brute force ! Dictionaries !   Hash tables, rainbow tables
  28. Hash functions !   Hashfunctions map input of arbitrary length

    to output of fixed length !   „Easy“ to compute, infeasible to revert, resistant to collision- and preimage attacks !   Collision: two inputs with the same hash value !   Preimage attack: find a message with a certain hash value !   Countermeasures to the attacks mentioned earlier: !   Salt: random nonce, appended to password hash !   Slow hash functions (e.g. bcrypt)
  29. Perfect Forward Secrecy !   Property of key exchange algorithms

    ! Compromise of long term keys in the future will not allow access to session keys from the past ! Without PFS, if an attacker stores encrypted communications, and manages to somehow get access to the server key, he will be able to decrypt all stored communications ! Compromise of server keys can occurr in many different situations (hackers, judicial authorities) ! Provided by DHE or ECDHE, not provided by RSA
  30. The Heartbleed bug !   Bug in the OpenSSL implementation

    of the TLS HeartBeat mechanism, resulting from simple coding error !   An attacker can request that a running TLS server hand over a relatively large slice (up to 64KB per request) of its private memory space !   Attack leaves no traces on the vulnerable system !   Code committed in Dec 2011, released in Mar 2012, Bug made public and fixed in April 2014 !   CloudFlare Challenge: private key leaked after 100k requests
  31. Trust No One - Principle Or at least be careful

    about whom you trust Confidentiality not automatically provided by „military-grade-encryption“