SlideShare a Scribd company logo
1 of 45
Download to read offline
CRYPTO 101
SUBSPLASH TECH TALK 2017
2
ATTACK AT DAWN
▸ How to hide a secret message?
THE PROBLEM
CRYPTO 101
3
ATTACK AT DAWN
DW DFN DW GDZQW
CRYPTO 101
BITS & BYTES
▸ bits
▸ 0
▸ 1
▸ bytes
▸ 8 bits
▸ 0010 1111
▸ 1100 0001
4CRYPTO 101
▸ Binary to decimal
▸ 0010 1111 -> 47
▸ 1100 0001 -> 193
▸ 0000 0000 -> 0
▸ 1111 1111 -> 255
▸ Decimal to binary
▸ 65 -> 0100 0001
5CRYPTO 101
CRYPTO 101
ASCII ENCODING
6
! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [  ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~
CRYPTO 101
ATTACK AT DAWN
7
A 65 0100 0001
T 84 0101 0100
T 84 0101 0100
A 65 0100 0001
C 67 0100 0011
K 75 0100 1011
32 0010 0000
A 65 0100 0001
T 84 0101 0100
32 0010 0000
D 68 0100 0100
A 65 0100 0001
W 87 0101 0111
N 78 0100 1110
CRYPTO 101
A 65 0100 0001
▸ Coin
▸ Head -> 0
▸ Tail -> 1
▸ 1 0 0 1 1 0 1 0
8
CRYPTO 101 9
“A” - 0100 0001
key - 1001 1010
??? - 1101 1011
CRYPTO 101
EXCLUSIVE OR (XOR)
10
A B A⊕B
0 0 0
1 0 1
0 1 1
1 1 0
CRYPTO 101 11
A 0100 0001 1001 1010 1101 1011
T 0101 0100 0101 1100 0000 1000
T 0101 0100 0111 0111 0010 0011
A 0100 0001 1110 1110 1010 1111
C 0100 0011 0010 0101 0110 0110
K 0100 1011 0010 1011 0110 0000
0010 0000 1100 1111 1110 1111
A 0100 0001 0010 0101 0110 0100
T 0101 0100 0111 1110 0010 1010
0010 0000 1111 0001 1101 0001
D 0100 0100 1001 1001 1101 1101
A 0100 0001 1101 1010 1001 1011
W 0101 0111 1110 0001 1011 0110
N 0100 1110 0011 1100 0111 0010
db
08
23
af
66
60
ef
64
2a
d1
dd
9b
b6
72
9a
5c
77
ee
25
2b
cf
25
7e
f1
99
da
e1
3c
CRYPTO 101 12
ATTACK AT DAWN
9a5c77ee252bcf257ef199dae13c
db0823af6660ef642ad1dd9bb672
⊕
||
??#?f`?d*????r
CRYPTO 101
ONE-TIME PAD
▸ Perfect secrecy
13
db0823af6660ef642ad1dd9bb672
1101 1011 0000 1000 0010 0011 1010 1111
0110 0110 0110 0000 1110 1111 0110 0100
0010 1010 1101 0001 1101 1101 1001 1011
1011 0110 0111 1100
CRYPTO 101
ONE-TIME PAD KEY
▸ As long as the plaintext
14
9a5c77ee252bcf257ef199dae13c
1001 1010 0101 1100 0111 0111 1110 1110
0010 0101 0010 1011 1100 1111 0010 0101
0111 1110 1111 0001 1001 1001 1101 1010
1110 0001 0011 1100
CRYPTO 101
IS ONE-TIME PAD GOOD ENOUGH?
▸ Not practical in real life
▸ “ATTACK AT DAWN” - 14 Bytes (B)
▸ A letter - 3 Kilo Bytes (KB)
▸ An audio - 4 Mega Bytes (MB)
▸ A video - 2 Giga Bytes (GB)
▸ Can we do better?
15
CRYPTO 101
BLOCK CIPHER
16
plaintext
↓
+--------------+
key -> | Block Cipher |
+--------------+
↓
ciphertext
CRYPTO 101
DATA ENCRYPTION STANDARD (DES)
▸ 1970s
▸ IBM
▸ Block size: 64 bits
▸ Key size: 56 bits
▸ password
▸ 3689207c138acf18
▸ 9adf272b96969988
17
CRYPTO 101
TRIPLE DES (3DES)
▸ 1998
▸ DES -> DES -> DES
▸ Key size: 56 * 3 = 168 bits
▸ Also 3 times slower than DES
18
CRYPTO 101
ADVANCED ENCRYPTION STANDARD (AES)
▸ 1997-2000
▸ NIST
▸ Finalists
▸ Rijndael/Serpent/Twofish/RC6/MARS
▸ Rijndael is the winner
19
CRYPTO 101
AES (RIJNDAEL)
▸ 2001
▸ Block size: 128 bits
▸ Key size: 128/192/256 bits
▸ e9e9fb64e075818aacb6d86c502d8b63
▸ 5ba36e701dd67693b4ada36cdc5b7a89624e94e0583
df09c
▸ cd8394660e5e4003d634cedbaa19b04d2ebaa8568ee
55197222f56ce1886ae17
20
CRYPTO 101 21
plaintext
↓
+--------------+
key -> | Block Cipher | (DES/3DES/AES)
+--------------+
↓
ciphertext
CRYPTO 101 22
ATTACK A T DAWN
-------- ------
64 bits 48 bits
ATTACK A
↓
+----------------+
password -> | DES Encryption |
+----------------+
↓
1a2dd25ec47c36fd
T DAWN00
--------
48+16 bits
T DAWN00
↓
+----------------+
password -> | DES Encryption |
+----------------+
↓
03fbff11a9a8e0f0
1a2dd25ec47c36fd03fbff11a9a8e0f0
CRYPTO 101 23
ATTACK A
↓
+----------------+
password -> | DES Encryption |
+----------------+
↓
1a2dd25ec47c36fd
T DAWN00
↓
+----------------+
password -> | DES Encryption |
+----------------+
↓
03fbff11a9a8e0f0
↓
+----------------+
password -> | DES Decryption |
+----------------+
↓
ATTACK A
↓
+----------------+
password -> | DES Decryption |
+----------------+
↓
T DAWN00
ATTACK AT DAWN00
ATTACK AT DAWN
CRYPTO 101
BLOCK CIPHER MODE
▸ ECB
▸ CBC
▸ CFB/OFB
▸ CTR
24
CRYPTO 101
ECB (ELECTRONIC CODEBOOK)
25
plaintext
↓
+-----------------+
key -> | Block Cipher Enc|
+-----------------+
↓
ciphertext
plaintext
↓
+-----------------+
key -> | Block Cipher Enc|
+-----------------+
↓
ciphertext
↓
+-----------------+
key -> | Block Cipher Dec|
+-----------------+
↓
plaintext
↓
+-----------------+
key -> | Block Cipher Dec|
+-----------------+
↓
plaintext
CRYPTO 101
ECB PENGUIN
26
CRYPTO 101
CBC (CIPHER BLOCK CHAINING)
27
plaintext
|
IV ----------> ⊕
↓
+-----------------+
key -> | Block Cipher Enc|
+-----------------+
↓
ciphertext
plaintext
|
+--------------> ⊕
| ↓
| +-----------------+
| key -> | Block Cipher Enc|
| +-----------------+
-----------+ ↓
ciphertext
↓
+-----------------+
key -> | Block Cipher Dec|
+-----------------+
|
IV ----------> ⊕
↓
plaintext
-----------+ ↓
| +-----------------+
| key -> | Block Cipher Dec|
| +-----------------+
| |
+--------------> ⊕
↓
plaintext
CRYPTO 101
WHICH ONE TO USE?
▸ ECB
▸ CBC
▸ CFB/OFB
▸ CTR
28
CRYPTO 101
STREAM CIPHER
▸ RC4
▸ Salsa20/ChaCha20
29
CRYPTO 101
THE PROBLEM
▸ How to hide a secret message?
▸ How to securely send my secret message to others?
30
CRYPTO 101
ALICE, BOB & EVE
31
secret
Alice -------------------------------------------> Bob
key key
secret secret'
Alice ------------------ Eve --------------------> Bob
key key
CRYPTO 101
CRYPTOGRAPHIC HASH FUNCTIONS
▸ Data integrity
32
secret
Alice -------------------------------------------> Bob
key key
secret
digest
Alice -------------------------------------------> Bob
key key
CRYPTO 101
IDEAL HASH FUNCTIONS
▸ digest = hash_function(input)
▸ Deterministic, same input always results in same digest
▸ Quick to compute for any input
▸ One-way function
▸ Avalanche effect, small change in input cause huge change in
digest
▸ Collision resistance, infeasible to find two different inputs with
same digest
33
CRYPTO 101
COMMON HASH FUNCTIONS
▸ MD5 (1992)
▸ SHA family
▸ SHA-1 (1995)
▸ SHA-2 (2001)
▸ SHA-224/SHA-256/SHA-384/SHA-512
▸ SHA-512/224, SHA512/256
▸ SHA-3 (2015)
34
CRYPTO 101
EXAMPLES
▸ hash(“ATTACK AT DAWN”)
35
MD5 042049321f10319f00d45dcc615f6bc1
SHA-1 19447f653ac5522b662bae641646bcce5102ade8
SHA-224 3db2c67781691fa0b7f82247fd8c7f5aa5977dc673d8c0979189919e
SHA-256 11e35eb1a2d18f4e2bfc43a1483c6b2b0f3ba4d6eb8b937278d3c9ab6897f4b8
SHA-384 51769418bf68409b6c41a4db245c7ff9d1e631f56c76661b1b84205d0419a179
6dd1ae3d474e204cd6c7ccf12907d46b
SHA-512 1df976845cfb9b2eddf77828c96e77a84ca17f864ab0513f70e8e50433f235be
9137ac500b6b181eb26d6db300304ba4a13b2c756c09cb073fb3926ea000a535
CRYPTO 101
IS DATA INTEGRITY ENOUGH?
36
secret
digest
Alice -------------------------------------------> Bob
key key
secret secret’
digest digest’
Alice ------------------ Eve --------------------> Bob
key key
CRYPTO 101
MAC (MESSAGE AUTHENTICATION CODE)
▸ Data integrity & authentication
▸ tag = mac_function(key, input)
▸ CMAC/CBC-MAC/VMAC/UMAC
▸ HMAC
▸ tag = hmac(hash_function, key, input)
▸ Poly1305
37
CRYPTO 101
HMAC
▸ hmac(hash, “mysecretkey”, “ATTACK AT DAWN”)
38
MD5 e9252bb2b93a94ac54af3fe1c6944e63
SHA-1 b22bf4d6ba5ca72a437def56f273025bc9480fa1
SHA-256 5a4590b9b30a2dc5899b0043ec407c561efd36eaa73abb3735752aa52f0c8c65
SHA-512 ad490070b7c792e4057d49d1b05d3515517505f9bb38413baab44326d0639f28
5791994496eeca1508471c8a97feb791dba129b4e3561cb1df73b4095d5d87d9
CRYPTO 101 39
secret
tag
Alice -------------------------------------------> Bob
(key, key2) (key, key2)
secret
digest
Alice -------------------------------------------> Bob
key key
secret secret’
tag ??????
Alice ------------------ Eve --------------------> Bob
(key, key2) (key, key2)
CRYPTO 101
SO FAR…
▸ Encryption
▸ DES/3DES/AES
▸ RC4/Chacha20
▸ Authentication
▸ HMAC/Poly1305
40
CRYPTO 101
HOW TO USE THEM?
▸ Encrypt then MAC
▸ IPsec
▸ MAC then Encrypt
▸ SSL/TLS
▸ Encrypt and MAC
▸ SSH
41
CRYPTO 101
AUTHENTICATED ENCRYPTION (AE)
▸ CCM/CWC/OCB
▸ GCM
42
CRYPTO 101
THE PROBLEM
▸ How to hide a secret message?
▸ How to securely send my secret message to others?
43
CRYPTO 101 44
secret secret’
tag ??????
Alice ------------------ Eve --------------------> Bob
(key, key2) (key, key2)
secret
tag
Alice -------------------------------------------> Bob
(key, key2) (key, key2)
(key, key2)
Alice ------------------ Eve --------------------> Bob
?????
CRYPTO 101
RESOURCES
▸ Cryptography I - Dan Boneh, Professor, Stanford U
▸ https://www.coursera.org/learn/crypto
▸ Enroll starts Aug 07, 2017
45

More Related Content

What's hot

Clasificación general
Clasificación generalClasificación general
Clasificación generallimas17
 
How To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemHow To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemJay Corrales
 
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 Design and Develop SQL DDL statements which demonstrate the use of SQL objec... Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...bhavesh lande
 
Weka วิเคราะห์ 55102011029
Weka วิเคราะห์ 55102011029Weka วิเคราะห์ 55102011029
Weka วิเคราะห์ 55102011029so_so37
 
Apache Cassandra - Data modelling
Apache Cassandra - Data modellingApache Cassandra - Data modelling
Apache Cassandra - Data modellingAlex Thompson
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in ElixirJesse Anderson
 
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202Mahmoud Samir Fayed
 

What's hot (8)

Clasificación general
Clasificación generalClasificación general
Clasificación general
 
How To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemHow To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification System
 
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 Design and Develop SQL DDL statements which demonstrate the use of SQL objec... Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
Design and Develop SQL DDL statements which demonstrate the use of SQL objec...
 
Weka วิเคราะห์ 55102011029
Weka วิเคราะห์ 55102011029Weka วิเคราะห์ 55102011029
Weka วิเคราะห์ 55102011029
 
Apache Cassandra - Data modelling
Apache Cassandra - Data modellingApache Cassandra - Data modelling
Apache Cassandra - Data modelling
 
Hash map
Hash mapHash map
Hash map
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in Elixir
 
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202
 

Similar to Crypto101

Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural NetworkJun Young Park
 
Decipher Multi-Factor Authentication - A Developers Introduction
Decipher Multi-Factor Authentication - A Developers IntroductionDecipher Multi-Factor Authentication - A Developers Introduction
Decipher Multi-Factor Authentication - A Developers IntroductionArcBlock
 
論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)
論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)
論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)mmisono
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionChristoph Matthies
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryptionhubx
 
learn you some erlang - chap0 to chap2
learn you some erlang - chap0 to chap2learn you some erlang - chap0 to chap2
learn you some erlang - chap0 to chap2경미 김
 
OakTable World Sep14 clonedb
OakTable World Sep14 clonedb OakTable World Sep14 clonedb
OakTable World Sep14 clonedb Connor McDonald
 
Cryptography (under)engineering
Cryptography (under)engineeringCryptography (under)engineering
Cryptography (under)engineeringslicklash
 
A Deep Dive Into Understanding Apache Cassandra
A Deep Dive Into Understanding Apache CassandraA Deep Dive Into Understanding Apache Cassandra
A Deep Dive Into Understanding Apache CassandraDataStax Academy
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기Ji Hun Kim
 
20082501 Leeds Pm
20082501 Leeds Pm20082501 Leeds Pm
20082501 Leeds PmAndyA
 
The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196Mahmoud Samir Fayed
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to CassandraGokhan Atil
 
Crypto talk OpenValue meetup 20-3-18
Crypto talk OpenValue meetup 20-3-18Crypto talk OpenValue meetup 20-3-18
Crypto talk OpenValue meetup 20-3-18Roy Wasse
 
Cryptography: way to Arkham - Andriy Savchenko
Cryptography: way to Arkham - Andriy SavchenkoCryptography: way to Arkham - Andriy Savchenko
Cryptography: way to Arkham - Andriy SavchenkoRuby Meditation
 
SQL techniques for faster applications
SQL techniques for faster applicationsSQL techniques for faster applications
SQL techniques for faster applicationsConnor McDonald
 

Similar to Crypto101 (20)

Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural Network
 
Decipher Multi-Factor Authentication - A Developers Introduction
Decipher Multi-Factor Authentication - A Developers IntroductionDecipher Multi-Factor Authentication - A Developers Introduction
Decipher Multi-Factor Authentication - A Developers Introduction
 
論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)
論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)
論文紹介 Hyperkernel: Push-Button Verification of an OS Kernel (SOSP’17)
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryption
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryption
 
learn you some erlang - chap0 to chap2
learn you some erlang - chap0 to chap2learn you some erlang - chap0 to chap2
learn you some erlang - chap0 to chap2
 
OakTable World Sep14 clonedb
OakTable World Sep14 clonedb OakTable World Sep14 clonedb
OakTable World Sep14 clonedb
 
Cryptography (under)engineering
Cryptography (under)engineeringCryptography (under)engineering
Cryptography (under)engineering
 
A Deep Dive Into Understanding Apache Cassandra
A Deep Dive Into Understanding Apache CassandraA Deep Dive Into Understanding Apache Cassandra
A Deep Dive Into Understanding Apache Cassandra
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
R programming language
R programming languageR programming language
R programming language
 
20082501 Leeds Pm
20082501 Leeds Pm20082501 Leeds Pm
20082501 Leeds Pm
 
The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196The Ring programming language version 1.7 book - Part 28 of 196
The Ring programming language version 1.7 book - Part 28 of 196
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
AES Encryption
AES EncryptionAES Encryption
AES Encryption
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Crypto talk OpenValue meetup 20-3-18
Crypto talk OpenValue meetup 20-3-18Crypto talk OpenValue meetup 20-3-18
Crypto talk OpenValue meetup 20-3-18
 
Cryptography: way to Arkham - Andriy Savchenko
Cryptography: way to Arkham - Andriy SavchenkoCryptography: way to Arkham - Andriy Savchenko
Cryptography: way to Arkham - Andriy Savchenko
 
SQL techniques for faster applications
SQL techniques for faster applicationsSQL techniques for faster applications
SQL techniques for faster applications
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Crypto101

  • 2. 2 ATTACK AT DAWN ▸ How to hide a secret message? THE PROBLEM CRYPTO 101
  • 3. 3 ATTACK AT DAWN DW DFN DW GDZQW CRYPTO 101
  • 4. BITS & BYTES ▸ bits ▸ 0 ▸ 1 ▸ bytes ▸ 8 bits ▸ 0010 1111 ▸ 1100 0001 4CRYPTO 101
  • 5. ▸ Binary to decimal ▸ 0010 1111 -> 47 ▸ 1100 0001 -> 193 ▸ 0000 0000 -> 0 ▸ 1111 1111 -> 255 ▸ Decimal to binary ▸ 65 -> 0100 0001 5CRYPTO 101
  • 6. CRYPTO 101 ASCII ENCODING 6 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
  • 7. CRYPTO 101 ATTACK AT DAWN 7 A 65 0100 0001 T 84 0101 0100 T 84 0101 0100 A 65 0100 0001 C 67 0100 0011 K 75 0100 1011 32 0010 0000 A 65 0100 0001 T 84 0101 0100 32 0010 0000 D 68 0100 0100 A 65 0100 0001 W 87 0101 0111 N 78 0100 1110
  • 8. CRYPTO 101 A 65 0100 0001 ▸ Coin ▸ Head -> 0 ▸ Tail -> 1 ▸ 1 0 0 1 1 0 1 0 8
  • 9. CRYPTO 101 9 “A” - 0100 0001 key - 1001 1010 ??? - 1101 1011
  • 10. CRYPTO 101 EXCLUSIVE OR (XOR) 10 A B A⊕B 0 0 0 1 0 1 0 1 1 1 1 0
  • 11. CRYPTO 101 11 A 0100 0001 1001 1010 1101 1011 T 0101 0100 0101 1100 0000 1000 T 0101 0100 0111 0111 0010 0011 A 0100 0001 1110 1110 1010 1111 C 0100 0011 0010 0101 0110 0110 K 0100 1011 0010 1011 0110 0000 0010 0000 1100 1111 1110 1111 A 0100 0001 0010 0101 0110 0100 T 0101 0100 0111 1110 0010 1010 0010 0000 1111 0001 1101 0001 D 0100 0100 1001 1001 1101 1101 A 0100 0001 1101 1010 1001 1011 W 0101 0111 1110 0001 1011 0110 N 0100 1110 0011 1100 0111 0010 db 08 23 af 66 60 ef 64 2a d1 dd 9b b6 72 9a 5c 77 ee 25 2b cf 25 7e f1 99 da e1 3c
  • 12. CRYPTO 101 12 ATTACK AT DAWN 9a5c77ee252bcf257ef199dae13c db0823af6660ef642ad1dd9bb672 ⊕ || ??#?f`?d*????r
  • 13. CRYPTO 101 ONE-TIME PAD ▸ Perfect secrecy 13 db0823af6660ef642ad1dd9bb672 1101 1011 0000 1000 0010 0011 1010 1111 0110 0110 0110 0000 1110 1111 0110 0100 0010 1010 1101 0001 1101 1101 1001 1011 1011 0110 0111 1100
  • 14. CRYPTO 101 ONE-TIME PAD KEY ▸ As long as the plaintext 14 9a5c77ee252bcf257ef199dae13c 1001 1010 0101 1100 0111 0111 1110 1110 0010 0101 0010 1011 1100 1111 0010 0101 0111 1110 1111 0001 1001 1001 1101 1010 1110 0001 0011 1100
  • 15. CRYPTO 101 IS ONE-TIME PAD GOOD ENOUGH? ▸ Not practical in real life ▸ “ATTACK AT DAWN” - 14 Bytes (B) ▸ A letter - 3 Kilo Bytes (KB) ▸ An audio - 4 Mega Bytes (MB) ▸ A video - 2 Giga Bytes (GB) ▸ Can we do better? 15
  • 16. CRYPTO 101 BLOCK CIPHER 16 plaintext ↓ +--------------+ key -> | Block Cipher | +--------------+ ↓ ciphertext
  • 17. CRYPTO 101 DATA ENCRYPTION STANDARD (DES) ▸ 1970s ▸ IBM ▸ Block size: 64 bits ▸ Key size: 56 bits ▸ password ▸ 3689207c138acf18 ▸ 9adf272b96969988 17
  • 18. CRYPTO 101 TRIPLE DES (3DES) ▸ 1998 ▸ DES -> DES -> DES ▸ Key size: 56 * 3 = 168 bits ▸ Also 3 times slower than DES 18
  • 19. CRYPTO 101 ADVANCED ENCRYPTION STANDARD (AES) ▸ 1997-2000 ▸ NIST ▸ Finalists ▸ Rijndael/Serpent/Twofish/RC6/MARS ▸ Rijndael is the winner 19
  • 20. CRYPTO 101 AES (RIJNDAEL) ▸ 2001 ▸ Block size: 128 bits ▸ Key size: 128/192/256 bits ▸ e9e9fb64e075818aacb6d86c502d8b63 ▸ 5ba36e701dd67693b4ada36cdc5b7a89624e94e0583 df09c ▸ cd8394660e5e4003d634cedbaa19b04d2ebaa8568ee 55197222f56ce1886ae17 20
  • 21. CRYPTO 101 21 plaintext ↓ +--------------+ key -> | Block Cipher | (DES/3DES/AES) +--------------+ ↓ ciphertext
  • 22. CRYPTO 101 22 ATTACK A T DAWN -------- ------ 64 bits 48 bits ATTACK A ↓ +----------------+ password -> | DES Encryption | +----------------+ ↓ 1a2dd25ec47c36fd T DAWN00 -------- 48+16 bits T DAWN00 ↓ +----------------+ password -> | DES Encryption | +----------------+ ↓ 03fbff11a9a8e0f0 1a2dd25ec47c36fd03fbff11a9a8e0f0
  • 23. CRYPTO 101 23 ATTACK A ↓ +----------------+ password -> | DES Encryption | +----------------+ ↓ 1a2dd25ec47c36fd T DAWN00 ↓ +----------------+ password -> | DES Encryption | +----------------+ ↓ 03fbff11a9a8e0f0 ↓ +----------------+ password -> | DES Decryption | +----------------+ ↓ ATTACK A ↓ +----------------+ password -> | DES Decryption | +----------------+ ↓ T DAWN00 ATTACK AT DAWN00 ATTACK AT DAWN
  • 24. CRYPTO 101 BLOCK CIPHER MODE ▸ ECB ▸ CBC ▸ CFB/OFB ▸ CTR 24
  • 25. CRYPTO 101 ECB (ELECTRONIC CODEBOOK) 25 plaintext ↓ +-----------------+ key -> | Block Cipher Enc| +-----------------+ ↓ ciphertext plaintext ↓ +-----------------+ key -> | Block Cipher Enc| +-----------------+ ↓ ciphertext ↓ +-----------------+ key -> | Block Cipher Dec| +-----------------+ ↓ plaintext ↓ +-----------------+ key -> | Block Cipher Dec| +-----------------+ ↓ plaintext
  • 27. CRYPTO 101 CBC (CIPHER BLOCK CHAINING) 27 plaintext | IV ----------> ⊕ ↓ +-----------------+ key -> | Block Cipher Enc| +-----------------+ ↓ ciphertext plaintext | +--------------> ⊕ | ↓ | +-----------------+ | key -> | Block Cipher Enc| | +-----------------+ -----------+ ↓ ciphertext ↓ +-----------------+ key -> | Block Cipher Dec| +-----------------+ | IV ----------> ⊕ ↓ plaintext -----------+ ↓ | +-----------------+ | key -> | Block Cipher Dec| | +-----------------+ | | +--------------> ⊕ ↓ plaintext
  • 28. CRYPTO 101 WHICH ONE TO USE? ▸ ECB ▸ CBC ▸ CFB/OFB ▸ CTR 28
  • 29. CRYPTO 101 STREAM CIPHER ▸ RC4 ▸ Salsa20/ChaCha20 29
  • 30. CRYPTO 101 THE PROBLEM ▸ How to hide a secret message? ▸ How to securely send my secret message to others? 30
  • 31. CRYPTO 101 ALICE, BOB & EVE 31 secret Alice -------------------------------------------> Bob key key secret secret' Alice ------------------ Eve --------------------> Bob key key
  • 32. CRYPTO 101 CRYPTOGRAPHIC HASH FUNCTIONS ▸ Data integrity 32 secret Alice -------------------------------------------> Bob key key secret digest Alice -------------------------------------------> Bob key key
  • 33. CRYPTO 101 IDEAL HASH FUNCTIONS ▸ digest = hash_function(input) ▸ Deterministic, same input always results in same digest ▸ Quick to compute for any input ▸ One-way function ▸ Avalanche effect, small change in input cause huge change in digest ▸ Collision resistance, infeasible to find two different inputs with same digest 33
  • 34. CRYPTO 101 COMMON HASH FUNCTIONS ▸ MD5 (1992) ▸ SHA family ▸ SHA-1 (1995) ▸ SHA-2 (2001) ▸ SHA-224/SHA-256/SHA-384/SHA-512 ▸ SHA-512/224, SHA512/256 ▸ SHA-3 (2015) 34
  • 35. CRYPTO 101 EXAMPLES ▸ hash(“ATTACK AT DAWN”) 35 MD5 042049321f10319f00d45dcc615f6bc1 SHA-1 19447f653ac5522b662bae641646bcce5102ade8 SHA-224 3db2c67781691fa0b7f82247fd8c7f5aa5977dc673d8c0979189919e SHA-256 11e35eb1a2d18f4e2bfc43a1483c6b2b0f3ba4d6eb8b937278d3c9ab6897f4b8 SHA-384 51769418bf68409b6c41a4db245c7ff9d1e631f56c76661b1b84205d0419a179 6dd1ae3d474e204cd6c7ccf12907d46b SHA-512 1df976845cfb9b2eddf77828c96e77a84ca17f864ab0513f70e8e50433f235be 9137ac500b6b181eb26d6db300304ba4a13b2c756c09cb073fb3926ea000a535
  • 36. CRYPTO 101 IS DATA INTEGRITY ENOUGH? 36 secret digest Alice -------------------------------------------> Bob key key secret secret’ digest digest’ Alice ------------------ Eve --------------------> Bob key key
  • 37. CRYPTO 101 MAC (MESSAGE AUTHENTICATION CODE) ▸ Data integrity & authentication ▸ tag = mac_function(key, input) ▸ CMAC/CBC-MAC/VMAC/UMAC ▸ HMAC ▸ tag = hmac(hash_function, key, input) ▸ Poly1305 37
  • 38. CRYPTO 101 HMAC ▸ hmac(hash, “mysecretkey”, “ATTACK AT DAWN”) 38 MD5 e9252bb2b93a94ac54af3fe1c6944e63 SHA-1 b22bf4d6ba5ca72a437def56f273025bc9480fa1 SHA-256 5a4590b9b30a2dc5899b0043ec407c561efd36eaa73abb3735752aa52f0c8c65 SHA-512 ad490070b7c792e4057d49d1b05d3515517505f9bb38413baab44326d0639f28 5791994496eeca1508471c8a97feb791dba129b4e3561cb1df73b4095d5d87d9
  • 39. CRYPTO 101 39 secret tag Alice -------------------------------------------> Bob (key, key2) (key, key2) secret digest Alice -------------------------------------------> Bob key key secret secret’ tag ?????? Alice ------------------ Eve --------------------> Bob (key, key2) (key, key2)
  • 40. CRYPTO 101 SO FAR… ▸ Encryption ▸ DES/3DES/AES ▸ RC4/Chacha20 ▸ Authentication ▸ HMAC/Poly1305 40
  • 41. CRYPTO 101 HOW TO USE THEM? ▸ Encrypt then MAC ▸ IPsec ▸ MAC then Encrypt ▸ SSL/TLS ▸ Encrypt and MAC ▸ SSH 41
  • 42. CRYPTO 101 AUTHENTICATED ENCRYPTION (AE) ▸ CCM/CWC/OCB ▸ GCM 42
  • 43. CRYPTO 101 THE PROBLEM ▸ How to hide a secret message? ▸ How to securely send my secret message to others? 43
  • 44. CRYPTO 101 44 secret secret’ tag ?????? Alice ------------------ Eve --------------------> Bob (key, key2) (key, key2) secret tag Alice -------------------------------------------> Bob (key, key2) (key, key2) (key, key2) Alice ------------------ Eve --------------------> Bob ?????
  • 45. CRYPTO 101 RESOURCES ▸ Cryptography I - Dan Boneh, Professor, Stanford U ▸ https://www.coursera.org/learn/crypto ▸ Enroll starts Aug 07, 2017 45