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

Cryptography for Rails Developers

Cryptography for Rails Developers

Given at Rails Israel 2014

Christopher Rigor

November 04, 2014
Tweet

More Decks by Christopher Rigor

Other Decks in Programming

Transcript

  1. RSA

  2. end

  3. -----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAwJ5g2RhxbKWq3PeS5EUIwemy1sYffQwn reUzryNwoB9/hqt0 NPAtq2vQftuko39VKw1hrpnk08bXWPqsN38HR9421q +nd0dgY1sG8EljSeG3dGvP 4rZ1EgUbac4WDAKvA+fhiebg4QS2bAaB9IEL +3rjQRhNsvaYgI2K3AHePbFVq0ut

    6Ey0WwN4m/yf8JYerJWPlHLyU8W4xtyHExuX/IK4g6Uf8Z9Av +WiK8mfHaw7Kge/ EO1UAGWOrd7RLx3A2WjOU7d0KtrshU1r64Xl4m1/ JbHQYBGkzYS0Mm7hhI5mnN/t 8h1hW2TksiVHrZ8rjOoYOrlkZOpVUwf7s2LYVQIDAQABAoIBA
  4. c ** d % n c = ciphertext d =

    private key n = modulus
  5. 42

  6. 1. Server sends the public key (RSA) 2. Browser encrypts

    shared key (RSA) 3. Browser encrypts data (AES-GCM)
  7. 1. Server sends the public key (RSA) 2. Browser encrypts

    shared key (RSA ECDHE) 3. Browser encrypts data (AES-GCM)