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
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
140
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
170
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
400
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
110
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
970
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
290
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
840
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
ドメインイベント増えすぎ問題
h0r15h0
2
550
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
6
1.4k
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
290
Featured
See All Featured
Code Review Best Practice
trishagee
65
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Designing for humans not robots
tammielis
250
25k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
560
Documentation Writing (for coders)
carmenintech
67
4.5k
The Language of Interfaces
destraynor
155
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
4 Signs Your Business is Dying
shpigford
182
21k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
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 /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uehVjYAwq6BGGG4CNsK/ CBvs60/bd3J/6raloygMKQa5JDkHOJ8hv8Io4JA12f6b29YlZX2J93zG++XRzFfQ +BfEQk8sIuXh0CjwxiAmxjpjff1vOVfHmLREfuQU/K8DJur803JfGD3kdTHBjN7L /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)