Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cryptography for Programmers
Search
Micah Hausler
February 27, 2014
Programming
0
180
Cryptography for Programmers
Chattanooga Developer Lunch 2/27/14
Micah Hausler
February 27, 2014
Tweet
Share
More Decks by Micah Hausler
See All by Micah Hausler
Prometheus & Time-Series monitoring
micahhausler
0
150
Introduction to Mesos
micahhausler
0
120
Chadevs Docker Talk - Part 1
micahhausler
0
87
Vagrant Lunchtalk
micahhausler
1
70
Intro to Salt - LPG Lunchtalks
micahhausler
1
100
Django Syncing Static and Media to S3
micahhausler
2
230
Other Decks in Programming
See All in Programming
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
最新TCAキャッチアップ
0si43
0
200
Better Code Design in PHP
afilina
PRO
0
130
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
CSC509 Lecture 12
javiergs
PRO
0
160
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
みんなでプロポーザルを書いてみた
yuriko1211
0
280
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
700
受け取る人から提供する人になるということ
little_rubyist
0
250
Featured
See All Featured
Happy Clients
brianwarren
98
6.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
The Language of Interfaces
destraynor
154
24k
Making Projects Easy
brettharned
115
5.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Side Projects
sachag
452
42k
Scaling GitHub
holman
458
140k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
GitHub's CSS Performance
jonrohan
1030
460k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Transcript
Cryptography for Programmers by Micah Hausler -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJTD2UAAAoJEAqqvvuLCfqLBhAIAMLNrUlo5wYLv4142ra1Jrpy
TZfQJ5mULkoywnEWEIP5DGoWgCnvQ7XAhwhnctjHMUeoh8xZrpl6FEbTYMHqBzyz znuCT5FJ1npJch5euFUsgocCNWnmekD8uIj5fFpApnIMH7tPHLHPSTCRYTt062bh 1Tmvu9Xh/JeO+dCdnoMvqRf+aIkIWDURircoktuu3LkQHReEDaU9CQir8fcdenSX IiL92zEIpPTscU0YdnE9j6MxlmwVNVBz14Y9lHhwQ3KpQ2liv2jyl6e8FgWFeO3b DMweMfTF6Hvv7NoJFZiyvmaj46htJqrVQKh8PwElp+8LhQCbtM67WuLuBCDhJ50= =0pfu -----END PGP SIGNATURE-----
Key Concepts
Symmetric Key
One to One My super secret message to Adam. My
super secret message to Adam. Pb vxshu vhfuhw phvvdjh wr Dgdp. symmetric key symmetric key
HASHING
MANY TO ONE Source: wikipedia
PUBLIC KEY CRYPTOGRAPHY
Private Key -----BEGIN PGP PRIVATE KEY BLOCK----- Version: GnuPG/MacGPG2 v2.0.22
(Darwin) Comment: GPGTools - https://gpgtools.org ! lQH+BFMPXIMBBADTwlZb56AJc8rRBBKEO8MS89Uxir0aMvDSRWbZDDJdxi+ju4ms 3zR4BQtAS9sKdDJwqTBE7aMEMBFkYBAar24PyTBBsMtqss22Xjf0FjNyc/RPOUJF gThSpDTQuxy7nVfviCo6iPdzus+9oPmDzwsRGjy94zazp0y2yEAYlwQTkwARAQAB /gMDAk9pMXvdJE6Yzg4ckKf7Hy98UAw9HnLaM5Dd801DsGGud9aVRkepObaeQT0w 2iI1jEOXMqUPxznyeBWYatI2my1GAkfOsC9wY5MiLu7vA96fW1Qi+9biAWOgvwh/ krn4tn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3kdTHBjN7L /xak4YjlOlBzj7raA83iTvAsBrO0Do4iM/ytzL0OR0L8/Um/tN53vSTpGZfS5S0W HKIxN8nuNBXLfRdlus/9Cd+J8JoM/Vt6qtRjff9L9uDwtSYffIqPqPgA3txZgjhf ewPEL5FF94qCqd3KQKUrfNi1xVg14HJOMCGaTk8pPuhvBTnY5jGvpGO/Xj2z9/KI oD/fA0BfvYTqeWy9zEN8gGuNWB2GL7cVuGJXpjV+AY6Ags4cfcsBGr9Ey83mZqQM EoifBBgBCgAJBQJTD1yDAhsMAAoJEGXGeVieQZdKLgIEAI5CxJNOCtsMgwiFPn+I jnSQZY4smTYGfE+ZsdZ7uKrWg+qcHE4yvcf6C9+DXAPX5yEgytKuZrGZ+tth0PtN OVHD7ZrHXQ/NZ4PgOHnrWYykxwUwRWERstDHvdGzRM59kw73hhh5nLH0leMEYJMT XzoVJfCuqW1Erq2+5zvwsxgu =BUOt -----END PGP PRIVATE KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org ! mI0EUw9cgwEEANPCVlvnoAlzytEEEoQ7wxLz1TGKvRoy8NJFZtkMMl3GL6O7iazf NHgFC0BL2wp0MnCpMETtowQwEWRgEBqvbg/JMEGwy2qyzbZeN/QWM3Jz9E85QkWB OFKkNNC7HLudV++IKjqI93O6z72g+YPPCxEaPL3jNrOnTLbIQBiXBBOTABEBAAG0 JUx1bmNodGFsayA8bHVuY2h0YWxrQHRyeWFtYml0aW9uLmNvbT6ItwQTAQoAIQUC Uw9cgwIbAwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBlxnlYnkGXSqPyA/45 QYpF/EqP4tl8QNoS4UaIaUHosgQJ3xH+w2PGhKjgAFNuy2QZV1MOs+C5gY93/fAI yytozUOWyzqRBAce3rynRJe7Q1FsblbzsnQpnYqtXuWxULZ/fxoZHUsJvM8WSbUL Ky+NN01qHvDrOW6mDQLgYLIPwTRxIFeMTkodqvAyiriNBFMPXIMBBADbBjrz82Jw hCOa5SyCq3jg1g6tUdKZoszVWHx/kDG3uRAbNve21H+QGt8dedSUp58tLb1q+oje UuRHdESJBOk5x5f57Z8mn3+arAHjCxUj3TvWFc2SDTU8u19Ro00Z7UH0u3Ik5Xik wgG+a4ysI7DygvYfpNG/GOWXcsipmycB4QARAQABiJ8EGAEKAAkFAlMPXIMCGwwA CgkQZcZ5WJ5Bl0ouAgQAjkLEk04K2wyDCIU+f4iOdJBljiyZNgZ8T5mx1nu4qtaD 6pwcTjK9x/oL34NcA9fnISDK0q5msZn622HQ+005UcPtmsddD81ng+A4eetZjKTH BTBFYRGy0Me90bNEzn2TDveGGHmcsfSV4wRgkxNfOhUl8K6pbUSurb7nO/CzGC4= =h1AD -----END PGP PUBLIC KEY BLOCK----- Public Key
Keeps Secrets Secret
Hey Micah, It Adam Haney. We’re changing our company name.
Don’t tell anyone. Thanks, Adam -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org ! mI0EUw9cgwEEANPCVlvnoAlzytEEEoQ7wxLz1TGKvRoy8NJFZtkMMl3GL6O7iazf NHgFC0BL2wp0MnCpMETtowQwEWRgEBqvbg/JMEGwy2qyzbZeN/QWM3Jz9E85QkWB OFKkNNC7HLudV++IKjqI93O6z72g+YPPCxEaPL3jNrOnTLbIQBiXBBOTABEBAAG0 JUx1bmNodGFsayA8bHVuY2h0YWxrQHRyeWFtYml0aW9uLmNvbT6ItwQTAQoAIQUC Uw9cgwIbAwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBlxnlYnkGXSqPyA/45 QYpF/EqP4tl8QNoS4UaIaUHosgQJ3xH+w2PGhKjgAFNuy2QZV1MOs+C5gY93/fAI yytozUOWyzqRBAce3rynRJe7Q1FsblbzsnQpnYqtXuWxULZ/fxoZHUsJvM8WSbUL Ky+NN01qHvDrOW6mDQLgYLIPwTRxIFeMTkodqvAyiriNBFMPXIMBBADbBjrz82Jw hCOa5SyCq3jg1g6tUdKZoszVWHx/kDG3uRAbNve21H+QGt8dedSUp58tLb1q+oje UuRHdESJBOk5x5f57Z8mn3+arAHjCxUj3TvWFc2SDTU8u19Ro00Z7UH0u3Ik5Xik wgG+a4ysI7DygvYfpNG/GOWXcsipmycB4QARAQABiJ8EGAEKAAkFAlMPXIMCGwwA CgkQZcZ5WJ5Bl0ouAgQAjkLEk04K2wyDCIU+f4iOdJBljiyZNgZ8T5mx1nu4qtaD 6pwcTjK9x/oL34NcA9fnISDK0q5msZn622HQ+005UcPtmsddD81ng+A4eetZjKTH BTBFYRGy0Me90bNEzn2TDveGGHmcsfSV4wRgkxNfOhUl8K6pbUSurb7nO/CzGC4= =h1AD -----END PGP PUBLIC KEY BLOCK----- ()My Public Key message: = -----BEGIN PGP MESSAGE----- Comment: GPGTools - https://gpgtools.org ! hIwDrc0SmI9gm6cBA/48CFd4qfUY4RmTKdmSD3R8pcefWGkiRPsNmSrAhX8tZBxQ EwlbMZMEMBfwEvxkg8lANe+Rvf8oZefe9+8cbdURYlh/Bmw0UehJcPAa9moPym7O p9g4+b87dsUX3b658a8ETWSLZE/fBnnEOipBH8Ka4qww0DKRuneNlzEsr6c6etKW AYey1T/Axlj94pSQpcvZ9mh+LGeKNyhUeOIyo/1V8S7IgQ78sd9oUTSg+HR3B0kB YpSQAluSN2C82dSvxgc2tRwQYdgMf1av6oFQVhjWPd9s2CbIZi8Y5sse99awSddY C+HBb2w5Bg8fJHuiKgOcxUusuayW1D/zqdvCFV0tV3EfssZPeDeN6gFNuB8xdciR UF65CeOj =VXJ7 -----END PGP MESSAGE----- Encryption!
PROOF of Identity
Hey Adam, It’s cool. I won’t tell anyone. Thanks, Micah
-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org ! mI0EUw9cgwEEANPCVlvnoAlzytEEEoQ7wxLz1TGKvRoy8NJFZtkMMl3GL6O7iazf NHgFC0BL2wp0MnCpMETtowQwEWRgEBqvbg/JMEGwy2qyzbZeN/QWM3Jz9E85QkWB OFKkNNC7HLudV++IKjqI93O6z72g+YPPCxEaPL3jNrOnTLbIQBiXBBOTABEBAAG0 JUx1bmNodGFsayA8bHVuY2h0YWxrQHRyeWFtYml0aW9uLmNvbT6ItwQTAQoAIQUC Uw9cgwIbAwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBlxnlYnkGXSqPyA/45 QYpF/EqP4tl8QNoS4UaIaUHosgQJ3xH+w2PGhKjgAFNuy2QZV1MOs+C5gY93/fAI yytozUOWyzqRBAce3rynRJe7Q1FsblbzsnQpnYqtXuWxULZ/fxoZHUsJvM8WSbUL Ky+NN01qHvDrOW6mDQLgYLIPwTRxIFeMTkodqvAyiriNBFMPXIMBBADbBjrz82Jw hCOa5SyCq3jg1g6tUdKZoszVWHx/kDG3uRAbNve21H+QGt8dedSUp58tLb1q+oje UuRHdESJBOk5x5f57Z8mn3+arAHjCxUj3TvWFc2SDTU8u19Ro00Z7UH0u3Ik5Xik wgG+a4ysI7DygvYfpNG/GOWXcsipmycB4QARAQABiJ8EGAEKAAkFAlMPXIMCGwwA CgkQZcZ5WJ5Bl0ouAgQAjkLEk04K2wyDCIU+f4iOdJBljiyZNgZ8T5mx1nu4qtaD 6pwcTjK9x/oL34NcA9fnISDK0q5msZn622HQ+005UcPtmsddD81ng+A4eetZjKTH BTBFYRGy0Me90bNEzn2TDveGGHmcsfSV4wRgkxNfOhUl8K6pbUSurb7nO/CzGC4= =h1AD -----END PGP PUBLIC KEY BLOCK----- ()My Private Key message: = -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ! Hey Adam, It’s cool. I won’t tell anyone. Thanks, Micah -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org ! iJwEAQEKAAYFAlMPY/8ACgkQZcZ5WJ5Bl0pyLAP/c+6YQOclUadeyNTxQJCGxaxm KzZ+WVLCBpA6e36pBkfEKRImd55HlRLw8d0yasTwuX8dy5qv+o9nwfzUB7z5lR5R YJfAk4SkUr/oGhXE2cr1iIhMMzzZ+6yi8Wb7Of3OMIdiu4viJe4A8CzGCHop2jEV uL2lIZHyN8Xmb36T5As= =nEf1 -----END PGP SIGNATURE----- Signature!
RSA
Ron Rivest Adi Shamir Leonard Adleman
P and Q prime numbers N = PQ ø(n) =
1 mod (P-1)(Q-1) select e such that gcd(ø(n), e) =1 calculate d where d•e = 1 mod ø(n) ! Public Key (kU) = {e,n} Private Key (kP) = {d,n}
1977
None
Just For Fun
Prime Numbers ! ! !
None
The first 46,656 non-negative integers
Resources www.numberspiral.com gpgtools.org en.wikipedia.org/wiki/RSA_(algorithm)