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

More Secrets of Cryptography

carnage
March 08, 2018

More Secrets of Cryptography

carnage

March 08, 2018
Tweet

More Decks by carnage

Other Decks in Technology

Transcript

  1. More Secrets of Cryptography
    Chris Riley
    ConFoo 2018
    1

    View Slide

  2. Introduction

    View Slide

  3. Why do we need cryptography?
    1

    View Slide

  4. Modern cryptography
    • Confidentiality
    2

    View Slide

  5. Modern cryptography
    • Confidentiality
    • Key exchange
    2

    View Slide

  6. Modern cryptography
    • Confidentiality
    • Key exchange
    • Identity
    2

    View Slide

  7. Modern cryptography
    • Confidentiality
    • Key exchange
    • Identity
    • Authentication
    2

    View Slide

  8. Symetric vs Asymetric Cryptography

    View Slide

  9. Eliptic Curve Cryptography

    View Slide

  10. Eliptic Curve Equation
    • y2 = x3 + ax2 + b
    3

    View Slide

  11. Eliptic Curve Equation
    • y2 = x3 + ax2 + b
    • y2 = x3 + 486662x2 + x
    3

    View Slide

  12. An Eliptic Curve
    4

    View Slide

  13. Eliptic curve dot function
    5

    View Slide

  14. Eliptic curve multiplication function
    6

    View Slide

  15. Eliptic curve for Cryptography
    7

    View Slide

  16. Eliptic Curve Key Exchange
    • Agree a curve, modulus and generator point (G)
    8

    View Slide

  17. Eliptic Curve Key Exchange
    • Agree a curve, modulus and generator point (G)
    • Select random integer d and compute P = dG
    8

    View Slide

  18. Eliptic Curve Key Exchange
    • Agree a curve, modulus and generator point (G)
    • Select random integer d and compute P = dG
    • Exchange public keys (PA and PB)
    8

    View Slide

  19. Eliptic Curve Key Exchange
    • Agree a curve, modulus and generator point (G)
    • Select random integer d and compute P = dG
    • Exchange public keys (PA and PB)
    • Compute a shared secret dBPA and dAPB
    8

    View Slide

  20. Eliptic Curve Key Exchange
    • Agree a curve, modulus and generator point (G)
    • Select random integer d and compute P = dG
    • Exchange public keys (PA and PB)
    • Compute a shared secret dBPA and dAPB
    • Both parties have now computed dAdBG
    8

    View Slide

  21. Key Exchange protocol
    9

    View Slide

  22. Man in the middle
    10

    View Slide

  23. The Web of Trust

    View Slide

  24. Trent, the trusted third party
    11

    View Slide

  25. Can you trust a web of trust?
    11

    View Slide

  26. Cryptographic Hash functions

    View Slide

  27. Ideal hash function properties
    • It should be quick and easy to compute a hash for any given
    data.
    12

    View Slide

  28. Ideal hash function properties
    • It should be quick and easy to compute a hash for any given
    data.
    • It should be difficult to compute data that has a given hash.
    12

    View Slide

  29. Ideal hash function properties
    • It should be quick and easy to compute a hash for any given
    data.
    • It should be difficult to compute data that has a given hash.
    • It should be unlikely that two different messages will have the
    same hash.
    12

    View Slide

  30. SHA-2

    View Slide

  31. Setup phase
    • Append a single ’1’ bit to the data
    • Pad the data with ’0’ so that the data + 64 bits is a multiple
    of 512
    • Append the data length as a 64 bit integer
    13

    View Slide

  32. Expansion phase
    • Split message into 512 bit blocks
    • Expand each block to 2048 bits
    • Expansion is done using shifts and rotates of the original block
    xor’d together
    14

    View Slide

  33. Compression phase
    1By User:kockmeyer (Own work) CC-BY-SA-3.0, via Wikimedia Commons
    15

    View Slide

  34. Merkel Trees

    View Slide

  35. A Merkel Tree
    16

    View Slide

  36. A Merkel Tree
    17

    View Slide

  37. Bitcoin

    View Slide

  38. What is a blockchain?
    • A Merkle tree
    18

    View Slide

  39. What is a blockchain?
    • A Merkle tree
    • No central authority
    18

    View Slide

  40. What is a blockchain?
    • A Merkle tree
    • No central authority
    • Multiple ’forks’ may exist
    18

    View Slide

  41. What is a blockchain?
    • A Merkle tree
    • No central authority
    • Multiple ’forks’ may exist
    • There exists a consensus algorithm to determine the correct
    fork
    18

    View Slide

  42. What is a blockchain?
    • A Merkle tree
    • No central authority
    • Multiple ’forks’ may exist
    • There exists a consensus algorithm to determine the correct
    fork
    • The consensus algorithm only requires data contained on the
    blockchain to run
    18

    View Slide

  43. Mining a bitcoin
    19

    View Slide

  44. Why do bitcoins have value?
    19

    View Slide

  45. Should I use a block chain for ... ?
    19

    View Slide

  46. Thanks
    • @giveupalready
    • https://github.com/carnage
    • https://carnage.github.io
    20

    View Slide