SlideShare une entreprise Scribd logo
1  sur  57
Télécharger pour lire hors ligne
yllan, 2015
• @yllan
• hypo
https://hypo.cc/
• SOLDA
https://solda.io/
•
Q: AES
•
•
• /
• key
• key
Encryption
Encryption System
• Block Cipher
•
• DES, AES, RSA, …
• block padding
block
• Block Mode: ECB / CBC / GCM / ……
Don’t Use ECB mode!
Block 1 Block 2 Block N…
Cipher 1 Cipher 2 Cipher N…
ECB: Cut & Paste
Cookie: auth=AES-ECB(username)
Cookie: auth=AES-ECB(1234567890123456admin)
ECB: Byte-by-Byte
• Oracle(m)=AES-ECB(m‖secret, key)
AES-ECB(123456789012345secret, key)
AES-ECB(123456789012345*secret, key)
AES-ECB(123456789012345ssecret, key)
AES-ECB(12345678901234secret, key)
AES-ECB(12345678901234s*secret, key)
AES-ECB(12345678901234sesecret, key)
AES-ECB(1234567890123secret, key)
A block: 16-bytes
CBC
comment=hello ,%20MOPCON. %26admin=true
&admin=true
comment=hello ,%20MOPCON. %26admin=true
&admin=true
comment=hello ?SDA(*H@*(#$& %2&admin=true
&⊕6
CBC Padding Oracle
• PKCS7 Padding
• xxxxxxxxxx01
• xxxxxxxxx0202
• xxxxxxxx030303
if (!bytes.takeRight(bytes.last)
.forAll(_ == bytes.last))
{
throw Exception(“Padding invalid!”)
}
030303
030303
⊕01
030302
⊕01
030302
⊕01
030303
⊕02
030301
⊕02
valid padding!
030301
⊕02
valid padding!last byte ⊕ 02 = 01, last byte = 03
030303
valid padding!last byte ⊕ 02 = 01, last byte = 03
??040404
⊕??070707
Authentication
(Signing)
(Crypto) Hash
• MD5, SHA1, SHA2, SHA3……
• input n output
• One-Way: H(x) x
• 2nd Pre-Image Resistance: y H(x) = H(y)
• Collision Free: x ≠ y H(x) = H(y)
Hash ≠ Authentication
• user=yllan&rating=5&album=12345
• MD5(secretalbum12345rating5useryllan)
•
• Length Extension Attack
Length Extension Attack
• ????user=yllan&rating=5
• ????user=yllan&rating=5…&admin=true
data data paddata
1 length0…0
64bytes 64bytes 64bytes
data paddatadata
64bytes 64bytes 64bytes
v1: 0x67452301
v2: 0xEFCDAB89
v3: 0x98BADCFE
v4: 0x10325476
v5: 0xC3D2E1F0
data paddatadata
64bytes 64bytes 64bytes
v1: 0xAAAAAAAA
v2: 0xBBBBBBBB
v3: 0xCCCCCCCC
v4: 0xDDDDDDDD
v5: 0xEEEEEEEE
data paddatadata
64bytes 64bytes 64bytes
v1: 0xFFFFFFFF
v2: 0xFFFFFFFF
v3: 0xFFFFFFFF
v4: 0xFFFFFFFF
v5: 0xFFFFFFFF
data paddatadata
64bytes 64bytes 64bytes
v1: 0x00000000
v2: 0x11111111
v3: 0x22222222
v4: 0x33333333
v5: 0x44444444
SHA1: 0x0000000011111111222222223333333344444444
? ???
64bytes 64bytes 64bytes
SHA1: 0x0000000011111111222222223333333344444444
? ???
64bytes 64bytes 64bytes
SHA1: 0x0000000011111111222222223333333344444444
v1: 0x00000000
v2: 0x11111111
v3: 0x22222222
v4: 0x33333333
v5: 0x44444444
? ???
ytes 64bytes 64bytes
v1: 0x00000000
v2: 0x11111111
v3: 0x22222222
v4: 0x33333333
v5: 0x44444444
PadExtension
? ???
ytes 64bytes 64bytes
v1: 0x55555555
v2: 0x66666666
v3: 0x77777777
v4: 0x88888888
v5: 0x99999999
SHA1: 0x5555555566666666777777778888888899999999
PadExtension
? ???
ytes 64bytes 64bytes
v1: 0x55555555
v2: 0x66666666
v3: 0x77777777
v4: 0x88888888
v5: 0x99999999
SHA1: 0x5555555566666666777777778888888899999999
PadExtension
MAC
• Message Authentication Code
• HMAC-SHA256(message, secret)
• m, MACk(m) n, MACk(n)
Side Channel Attack
Comparison
public static boolean isEqual(byte digesta[], byte digestb[])
{
if (digesta.length != digestb.length)
return false;
for (int i = 0; i < digesta.length; i++) {
if (digesta[i] != digestb[i]) {
return false;
}
}
return true;
}
Java 6u15: MessageDigest.isEqual
Constant Time
Comparison ( )
public static boolean isEqual(byte[] a, byte[] b) {
if (a.length != b.length) {
return false;
}
int result = 0;
for (int i = 0; i < a.length; i++) {
result |= a[i] ^ b[i];
}
return result == 0;
}
Side Channel
•
•
•
• HEARTBLEED
• bcrypt()
• RSA/DES library… Orz
Q & A
1 2 3 4 5 6 7
8 9 10……

Contenu connexe

En vedette

Design Patents for Bluetooth Consumer Electronics
Design Patents for Bluetooth Consumer ElectronicsDesign Patents for Bluetooth Consumer Electronics
Design Patents for Bluetooth Consumer ElectronicsAlex G. Lee, Ph.D. Esq. CLP
 
Lenovo's Key NEC 3G & & 4G LTE Standard Essential Patents for Smartphones
Lenovo's Key NEC 3G & & 4G LTE Standard  Essential Patents for SmartphonesLenovo's Key NEC 3G & & 4G LTE Standard  Essential Patents for Smartphones
Lenovo's Key NEC 3G & & 4G LTE Standard Essential Patents for SmartphonesAlex G. Lee, Ph.D. Esq. CLP
 
Manuale minimo-delleconomia-politica-dellimmaginario
Manuale minimo-delleconomia-politica-dellimmaginarioManuale minimo-delleconomia-politica-dellimmaginario
Manuale minimo-delleconomia-politica-dellimmaginarioAlain Denis
 
LTE-based Vehicle and Drone Networks Insights from Patents
LTE-based Vehicle and Drone Networks Insights from PatentsLTE-based Vehicle and Drone Networks Insights from Patents
LTE-based Vehicle and Drone Networks Insights from PatentsAlex G. Lee, Ph.D. Esq. CLP
 
Oa At Solarbron Slide Presentation Auto
Oa At Solarbron Slide Presentation AutoOa At Solarbron Slide Presentation Auto
Oa At Solarbron Slide Presentation AutoJulieJulian
 
HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...
HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...
HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...Manas Kanungo, MBA, MS Bioengineering
 
테크아이피엠 특허 지식재산 전자신문 기고모음
테크아이피엠 특허 지식재산 전자신문 기고모음테크아이피엠 특허 지식재산 전자신문 기고모음
테크아이피엠 특허 지식재산 전자신문 기고모음Alex G. Lee, Ph.D. Esq. CLP
 
IoT Connected Car High Litigation Risk Patents Assessment
IoT Connected Car High Litigation Risk Patents AssessmentIoT Connected Car High Litigation Risk Patents Assessment
IoT Connected Car High Litigation Risk Patents AssessmentAlex G. Lee, Ph.D. Esq. CLP
 
IBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from PatentsIBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from PatentsAlex G. Lee, Ph.D. Esq. CLP
 
08 urgencias en odontologia
08 urgencias en odontologia08 urgencias en odontologia
08 urgencias en odontologiagilbert69
 

En vedette (20)

AFS7 Math 3
AFS7 Math 3AFS7 Math 3
AFS7 Math 3
 
Design Patents for Bluetooth Consumer Electronics
Design Patents for Bluetooth Consumer ElectronicsDesign Patents for Bluetooth Consumer Electronics
Design Patents for Bluetooth Consumer Electronics
 
Future Apple iPhone Insights from Patents
Future Apple iPhone Insights from PatentsFuture Apple iPhone Insights from Patents
Future Apple iPhone Insights from Patents
 
Race for 5G News & Information Center 1Q 2015
Race for 5G News & Information Center 1Q 2015Race for 5G News & Information Center 1Q 2015
Race for 5G News & Information Center 1Q 2015
 
Lenovo's Key NEC 3G & & 4G LTE Standard Essential Patents for Smartphones
Lenovo's Key NEC 3G & & 4G LTE Standard  Essential Patents for SmartphonesLenovo's Key NEC 3G & & 4G LTE Standard  Essential Patents for Smartphones
Lenovo's Key NEC 3G & & 4G LTE Standard Essential Patents for Smartphones
 
Wireless/Mobile Patent Analysis Methodology
Wireless/Mobile Patent Analysis MethodologyWireless/Mobile Patent Analysis Methodology
Wireless/Mobile Patent Analysis Methodology
 
Manuale minimo-delleconomia-politica-dellimmaginario
Manuale minimo-delleconomia-politica-dellimmaginarioManuale minimo-delleconomia-politica-dellimmaginario
Manuale minimo-delleconomia-politica-dellimmaginario
 
1948 Buick streamliner
1948 Buick streamliner1948 Buick streamliner
1948 Buick streamliner
 
Tempos idos - 1920
Tempos idos - 1920Tempos idos - 1920
Tempos idos - 1920
 
LTE-based Vehicle and Drone Networks Insights from Patents
LTE-based Vehicle and Drone Networks Insights from PatentsLTE-based Vehicle and Drone Networks Insights from Patents
LTE-based Vehicle and Drone Networks Insights from Patents
 
Oa At Solarbron Slide Presentation Auto
Oa At Solarbron Slide Presentation AutoOa At Solarbron Slide Presentation Auto
Oa At Solarbron Slide Presentation Auto
 
Strategic Patent Management in Mobile Telecom
Strategic Patent Management in Mobile TelecomStrategic Patent Management in Mobile Telecom
Strategic Patent Management in Mobile Telecom
 
Coaching Presentation 3 08
Coaching Presentation 3 08Coaching Presentation 3 08
Coaching Presentation 3 08
 
FinTech, Internet of Things & Patents
FinTech, Internet of Things & PatentsFinTech, Internet of Things & Patents
FinTech, Internet of Things & Patents
 
HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...
HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...
HealthyTutor - Virtual Multi-level, Multi-environment, Clinical Outcomes base...
 
Big Data Applications Insights from Patents
Big Data Applications Insights from PatentsBig Data Applications Insights from Patents
Big Data Applications Insights from Patents
 
테크아이피엠 특허 지식재산 전자신문 기고모음
테크아이피엠 특허 지식재산 전자신문 기고모음테크아이피엠 특허 지식재산 전자신문 기고모음
테크아이피엠 특허 지식재산 전자신문 기고모음
 
IoT Connected Car High Litigation Risk Patents Assessment
IoT Connected Car High Litigation Risk Patents AssessmentIoT Connected Car High Litigation Risk Patents Assessment
IoT Connected Car High Litigation Risk Patents Assessment
 
IBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from PatentsIBM Internet of Things R&D Insights from Patents
IBM Internet of Things R&D Insights from Patents
 
08 urgencias en odontologia
08 urgencias en odontologia08 urgencias en odontologia
08 urgencias en odontologia
 

Plus de Yung-Luen Lan

Really Simple Cocoa Tips (2007)
Really Simple Cocoa Tips (2007)Really Simple Cocoa Tips (2007)
Really Simple Cocoa Tips (2007)Yung-Luen Lan
 
Incarnation - Turning Real World Objects into Perfume World
Incarnation - Turning Real World Objects into Perfume WorldIncarnation - Turning Real World Objects into Perfume World
Incarnation - Turning Real World Objects into Perfume WorldYung-Luen Lan
 
Prfm programming 2_with_notes
Prfm programming 2_with_notesPrfm programming 2_with_notes
Prfm programming 2_with_notesYung-Luen Lan
 
Scala Bot for Small Business
Scala Bot for Small BusinessScala Bot for Small Business
Scala Bot for Small BusinessYung-Luen Lan
 

Plus de Yung-Luen Lan (6)

Really Simple Cocoa Tips (2007)
Really Simple Cocoa Tips (2007)Really Simple Cocoa Tips (2007)
Really Simple Cocoa Tips (2007)
 
Incarnation - Turning Real World Objects into Perfume World
Incarnation - Turning Real World Objects into Perfume WorldIncarnation - Turning Real World Objects into Perfume World
Incarnation - Turning Real World Objects into Perfume World
 
Prfm programming 2_with_notes
Prfm programming 2_with_notesPrfm programming 2_with_notes
Prfm programming 2_with_notes
 
Prfm programming 2
Prfm programming 2Prfm programming 2
Prfm programming 2
 
Scala Bot for Small Business
Scala Bot for Small BusinessScala Bot for Small Business
Scala Bot for Small Business
 
Immutability
ImmutabilityImmutability
Immutability
 

Cryptography