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

Cryptography for Rails Developers - RubyConfIndia

Cryptography for Rails Developers - RubyConfIndia

Slides for my talk at RubyConfIndia. April 4, 2015.
http://rubyconfindia.org/schedule.html

Christopher Rigor

April 04, 2015
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. modulus: 00:c0:9e:60:d9:18:71:6c:a5:aa:dc:f7:92:e4:45: 08:c1:e9:b2:d6:c6:1f:7d:0c:27:ad:e5:33:af:23: 70:a0:1f:7f:86:ab:74:34:f0:2d:ab:6b:d0:7e:db: a4:a3:7f:55:2b:0d:61:ae:99:e4:d3:c6:d7:58:fa: ac:37:7f:07:47:de:36:d6:af:a7:77:47:60:63:5b: 06:f0:49:63:49:e1:b7:74:6b:cf:e2:b6:75:12:05: 1b:69:ce:16:0c:02:af:03:e7:e1:89:e6:e0:e1:04: b6:6c:06:81:f4:81:0b:fb:7a:e3:41:18:4d:b2:f6: 98:80:8d:8a:dc:01:de:3d:b1:55:ab:4b:ad:e8:4c:

    b4:5b:03:78:9b:fc:9f:f0:96:1e:ac:95:8f:94:72: f2:53:c5:b8:c6:dc:87:13:1b:97:fc:82:b8:83:a5: 1f:f1:9f:40:bf:e5:a2:2b:c9:9f:1d:ac:3b:2a:07: bf:10:ed:54:00:65:8e:ad:de:d1:2f:1d:c0:d9:68: ce:53:b7:74:2a:da:ec:85:4d:6b:eb:85:e5:e2:6d: 7f:25:b1:d0:60:11:a4:cd:84:b4:32:6e:e1:84:8e: 66:9c:df:ed:f2:1d:61:5b:64:e4:b2:25:47:ad:9f: 2b:8c:ea:18:3a:b9:64:64:ea:55:53:07:fb:b3:62: d8:55
  5. privateExponent: 33:ed:7e:a6:88:54:6b:b9:ed:ea:4c:44:29:8e:02: e2:64:22:76:8c:4b:08:e7:31:fb:4b:83:37:80:12: 68:d8:95:04:b5:4c:4a:c9:45:46:a5:76:3b:fc:f2: d1:b1:0e:40:e1:06:a8:8f:8c:85:1b:62:0a:f6:e9: 5e:bc:bc:35:bf:ce:80:ea:31:f7:92:22:86:26:90: 24:4f:64:99:12:64:e6:d9:f9:dd:60:db:06:d4:a1: a3:50:8f:d9:05:10:31:b9:5d:b0:53:b1:e4:77:e4: c6:12:ab:0e:43:8b:fb:6c:11:c0:06:d1:4b:a1:f7: 53:10:d5:92:a2:5e:4b:ba:fe:e0:90:a6:17:44:8b:

    d3:1d:8e:f7:e6:64:a6:85:34:0e:87:b0:3b:bd:d0: 90:2a:b4:62:08:f3:fd:42:d8:73:e2:2d:54:10:8a: 5c:9c:6f:16:7f:d2:1f:8e:51:c5:14:12:91:bf:cc: 7e:34:14:e0:db:79:ee:05:45:22:de:3b:99:52:36: b1:ac:c0:e8:f6:df:02:44:b6:37:4b:f5:73:9d:41: c6:35:ba:b5:47:39:fb:d3:a2:90:80:ac:4c:0d:97: 4d:c8:8d:36:7f:ae:8e:1f:1e:e5:33:0b:51:8d:41: 35:e7:69:2a:f1:62:52:0c:fa:d4:f5:b9:7f:8d:03: 01
  6. 42

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

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

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