ENCRYPTION WITHOUT MAGIC, RISK MANAGEMENT WITHOUT PAIN - - PowerPoint PPT Presentation

encryption without magic risk management without pain
SMART_READER_LITE
LIVE PREVIEW

ENCRYPTION WITHOUT MAGIC, RISK MANAGEMENT WITHOUT PAIN - - PowerPoint PPT Presentation

ENCRYPTION WITHOUT MAGIC, RISK MANAGEMENT WITHOUT PAIN #qconlondon @vixentael @vixentael Product Engineer Feel free to reach me with security questions. I do check my inbox :) CRYPTOGRAPHY? Blowfish Twofish Rabbit Salsa20 AES OFB


slide-1
SLIDE 1

ENCRYPTION WITHOUT MAGIC, RISK MANAGEMENT WITHOUT PAIN

#qconlondon @vixentael

slide-2
SLIDE 2
slide-3
SLIDE 3

@vixentael

Product Engineer

Feel free to reach me with security questions. I do check my inbox :)

slide-4
SLIDE 4

CRYPTOGRAPHY?

slide-5
SLIDE 5

CRYPTOGRAPHY?

AES

DES

3DES CBC

CFB

SEAL

Salsa20

RSA

DSA

OFB

Blowfish

SHARK

RC4

DSS

ECB

CTR

Twofish

Camelia

SEED

Rabbit

ECDSA

#qconlondon @vixentael

slide-6
SLIDE 6

CRYPTOGRAPHY?

AES

#qconlondon @vixentael

DES

3DES CBC

CFB

SEAL

Salsa20

RSA

DSA

OFB

Blowfish

SHARK

RC4

DSS

ECB

CTR

Twofish

Camelia

SEED

Rabbit

ECDSA

MD5 SHA1 SHA3

slide-7
SLIDE 7

#qconlondon @vixentael

algorithms elliptic curves key management public key validity storing secrets

CRYPTOGRAPHY

cool, but…

slide-8
SLIDE 8

#qconlondon @vixentael

crypto is not a but a method to manage the attack surface

slide-9
SLIDE 9

#qconlondon @vixentael

ATTACK SURFACE

– all the possible places where sensitive data may be stolen by adversary

https://www.owasp.org/index.php/Attack_Surface_Analysis_Cheat_Sheet

slide-10
SLIDE 10

#qconlondon @vixentael

it’s easier to monitor the suspicious behavior in a small place

slide-11
SLIDE 11

#qconlondon @vixentael

HANDLING SECRET DATA WITH CARE

avoid plain text as possible manage keys properly decrease time of plaintext secrets in memory log, monitor and inspect

slide-12
SLIDE 12

– HOW TO MANAGE THE ATTACK SURFACE OF MY DATA?

slide-13
SLIDE 13

#qconlondon @vixentael

  • ne container
  • ne key

symmetric encryption with poor key management

slide-14
SLIDE 14

#qconlondon @vixentael

attack surface is arbitrary

  • ne container
  • ne key

symmetric encryption with poor key management

key leaked → data leaked

slide-15
SLIDE 15

#qconlondon @vixentael

WHAT IS A CRYPTO-SYSTEM

https://en.wikipedia.org/wiki/Cryptosystem

slide-16
SLIDE 16

#qconlondon @vixentael

KEY AND TRUST MANAGEMENT SHOULD REFLECT YOUR SYSTEM

slide-17
SLIDE 17

#qconlondon @vixentael

MESSAGING

https://core.telegram.org/api/end-to-end

slide-18
SLIDE 18

#qconlondon @vixentael

GOOD MESSAGING

IS E2EE

…but your infrastructures are not only for messaging

slide-19
SLIDE 19

#qconlondon @vixentael

NAIVE DATABASE ENCRYPTION

attack surface is almost everywhere

slide-20
SLIDE 20

#qconlondon @vixentael

NARROWING ATTACK SURFACE

middleware-side encryption client-side encryption

slide-21
SLIDE 21
slide-22
SLIDE 22

MIDDLEWARE-SIDE ENCRYPTION

slide-23
SLIDE 23

#qconlondon @vixentael

SQL injections code injections execution flow attacks reflection attacks XSS crypto-miners everywhere MitM

REAL-WORLD WEB SERVER

slide-24
SLIDE 24

#qconlondon @vixentael

ATTACK SURFACE IS EVERYWHERE :(

REAL-WORLD WEB SERVER

monitor everything

slide-25
SLIDE 25

#qconlondon @vixentael

TRY SYMMETRIC ENCRYPTION?

encrypt/decrypt data using symm key

slide-26
SLIDE 26

#qconlondon @vixentael

TRY SYMMETRIC ENCRYPTION?

encrypt/decrypt data using symm key

easy to steal a key

https://www.alibabacloud.com/ help/faq-detail/37505.htm

slide-27
SLIDE 27

#qconlondon @vixentael

ASYMMETRIC ENCRYPTION

wrapped data = Enc(data, random symm key) container = Enc(wrapped data, PKweb, PubKtds)

slide-28
SLIDE 28

#qconlondon @vixentael

wrapped data = Enc(data, random symm key) container = Enc(wrapped data, PKweb, PubKtds)

PubKey of ‘trusted decryption service’

ASYMMETRIC ENCRYPTION

slide-29
SLIDE 29

#qconlondon @vixentael

TRUSTED DECRYPTION SERVICE

wrapped_data = Dec(container, PKtds, PubKweb) data = Dec(wrapped_data, random symm key)

decrypts data

slide-30
SLIDE 30

#qconlondon @vixentael

trusted element in infrastructure

SEPARATION OF DUTIES

no decryption keys

monitor & log

slide-31
SLIDE 31

NARROWED ATTACK SURFACE

TRUSTED DECRYPTION SERVICE

#qconlondon @vixentael

slide-32
SLIDE 32

#qconlondon @vixentael

monitor everything monitor decryption proxy

slide-33
SLIDE 33

#qconlondon @vixentael

WHERE TO USE THIS TECHNIQUE?

micro-services infrastructure public-oriented interfaces non trusted client side (browsers, IoT devices) hard to store keys securely

slide-34
SLIDE 34

#qconlondon @vixentael

HOW TO IMPLEMENT?

ACRA

https://github.com/cossacklabs/acra

GREEN SQL

https://github.com/larskanis/greensql-fw

HEXATIER

http://www.hexatier.com/

ORACLE DATABASE FIREWALL / TDE

http://www.oracle.com/

slide-35
SLIDE 35
slide-36
SLIDE 36

CLIENT-SIDE ENCRYPTION

slide-37
SLIDE 37

#qconlondon @vixentael

MOVE TRUST TO CLIENTS

session hijacking unattended backups MitM replay attacks misconfigured ACL

trusted element in infrastructure

slide-38
SLIDE 38

#qconlondon @vixentael

P2P TRUST

system doesn’t know anything about data

encrypted containers user-generated keys

slide-39
SLIDE 39

ZERO KNOWLEDGE ARCHITECTURES

#qconlondon @vixentael

slide-40
SLIDE 40

ZKA is a design principle that enables software to provide services

  • ver protected client data without

having an unencrypted access to it.

#qconlondon @vixentael

slide-41
SLIDE 41

e2ee clients

ZKA INCLUDES:

#qconlondon @vixentael

slide-42
SLIDE 42

e2ee clients all operations are on encrypted data:

– control access to data from different users – CRUD – search (in encrypted data)

ZKA INCLUDES:

#qconlondon @vixentael

slide-43
SLIDE 43

#qconlondon @vixentael

weak key management algorithm weakness user pocket

atuack surface RISKS FOR ZKA:

slide-44
SLIDE 44

WHEN TO USE ZKA?

#qconlondon @vixentael

trusted client side (mobile, HSM/TPM)

slide-45
SLIDE 45

ZKA is already solved for specific use-cases or in a naive ways

#qconlondon @vixentael

slide-46
SLIDE 46

MESSAGING END-TO-END ENCRYPTION

#qconlondon @vixentael

slide-47
SLIDE 47

AUTHENTICATION ZERO KNOWLEDGE PROOF

https://www.cossacklabs.com/zero- knowledge-protocols-without-magic.html

#qconlondon @vixentael

slide-48
SLIDE 48

COLLABORATING ON DATA

– store encrypted – share with others – manage access to parties

#qconlondon @vixentael

???

slide-49
SLIDE 49

naive approach

– duplications – key management problems

#qconlondon @vixentael

SHARING ENCRYPTED DATA

slide-50
SLIDE 50

give access to certain blocks of data to exact users

https://github.com/ cossacklabs/hermes-core

#qconlondon @vixentael

OUR TAKE

slide-51
SLIDE 51

– Key wrapping

storage keys

user keys blocks

#qconlondon @vixentael

HOW TO BUILD IT?

slide-52
SLIDE 52

#qconlondon @vixentael

HOW TO BUILD IT?

– Key wrapping – Manage privileges

slide-53
SLIDE 53

– Key wrapping – Manage privileges – Control requests

#qconlondon @vixentael

HOW TO BUILD IT?

slide-54
SLIDE 54

shared audit logs complex docs, spreadsheets config files file system document store protection

#qconlondon @vixentael

MORE POSSIBLE USE-CASES

slide-55
SLIDE 55

OTHER IMPLEMENTATIONS

#qconlondon @vixentael

HERMES

https://github.com/cossacklabs/hermes-core

ZEROKIT

https://tresorit.com/zerokit

LAFS

https://tahoe-lafs.org/trac/tahoe-lafs

slide-56
SLIDE 56

#qconlondon @vixentael

monitor everything monitor client side

slide-57
SLIDE 57

MORE GOODIES TO THINK ABOUT

slide-58
SLIDE 58

Cryptography is well implemented, if it allows to narrow attack surface, and increase control of data.

#qconlondon @vixentael

slide-59
SLIDE 59

if the system has

  • ne perimeter,

it will fail!

ECHELONIZATION

#qconlondon @vixentael

slide-60
SLIDE 60

#qconlondon @vixentael

..add more layers

  • f defense

ECHELONIZATION

slide-61
SLIDE 61

EXCEPT CRYPTO, YOU ALSO NEED

log and monitor events intrusion pattern detection access control firewall ...

slide-62
SLIDE 62

https://pdos.csail.mit.edu/papers/cryptobugs:apsys14.pdf

269 CVEs

from 2011-2014

17%

83%

bugs inside crypto libs

misuses of crypto libs

by individual apps

#qconlondon @vixentael

slide-63
SLIDE 63

RECAP

2

slide-64
SLIDE 64

#qconlondon @vixentael

THINGS TO REMEMBER

  • 1. cryptography aims to narrow the attack surface
  • 2. choose relevant encryption scheme
  • 3. combine crypto and classic techniques
  • 4. there is a lib for that
slide-65
SLIDE 65
slide-66
SLIDE 66

https://hackernoon.com/eli5-zero-knowledge-proof-78a276db9eff

Explain Like I’m 5: Zero Knowledge Proof

https://medium.com/@9gunpi/devops-and-security-from-trenches-to-command- centers-466dfb58fe5b

DevOps and security: from trenches to command centers

https://medium.com/@cossacklabs/12-and-1-ideas-how-to-enhance-backend-data- security-4b8ceb5ccb88

12 and 1 ideas how to enhance backend data security

LINKS

https://www.smashingmagazine.com/2018/02/gdpr-for-web-developers/

How GDPR Will Change The Way You Develop

slide-67
SLIDE 67

https://github.com/ vixentael/my-talks

…and more

MY OTHER SECURITY SLIDES

slide-68
SLIDE 68

@vixentael

Product Engineer

Feel free to reach me with security questions. I do check my inbox :)

slide-69
SLIDE 69

IMAGE CREDITS

www.flaticon.com freepik, linector, switficons, pixelperfect, smashicons, icon pond, dinosoftlabs

Authors: