Top Banner
End-to-End Encryption in Distributed Applications @jeffinkoguru – [email protected] Hi, I'm Jeff
54

End-to-End Encryption of Distributed Applications

Jan 22, 2018

Download

Jeff Lambert
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Hi, I'm Jeff

Page 2: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The need for applications to speak in encryptedmessages is no longer an after-thought it is

a requirement

Page 3: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

What is End-to-End Encryption?

Page 4: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

A method of communicating where only theauthorized users can read the messages

Page 5: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

This method is used by apps like WhatsApp & Signal

Page 6: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

It prevents man-in-the-middle attacks

Page 7: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

If done right, you need physical accessto read the communications

Page 8: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Even if an ISP is asked to supply a customerscommunications, it will only appear as..

Page 9: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The recent WikiLeaks show that even.. The CIA could not break End-to-End Encryption

Page 10: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

They had to create malware that “uses” the app onyour phone in order to read the messages.

Or

Keyloggers that capture the message as youenter it into the program before it is encrypted

Page 11: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

So how do we implement this?

Page 12: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We want our system to be as secure as possible

Page 13: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We don't want to store our keys somewherethey can be hacked/stolen. They need to be

generated and one-time use only.

Page 14: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Give Me Your Keys!!!

Page 15: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

What Keys?

Page 16: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

When encrypting our messages, we also don'twant to know the password. They need to be

generated and one-time use only.

Page 17: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We want to use the strongest encryption available

Page 18: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Not SHA-1 ;)

Thanks Google!

Page 19: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We want to sign our message so weknow it was not tampered with during transit.

Page 20: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We don't want someone monitoring our networktraffic to easily recognize the format of our

messages. The structure should be random.

Page 21: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

What are some of options we have?

Page 22: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Option 01:

JSON Web Tokens

Page 23: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Output:

Our Code:

Page 24: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The Benefits

Page 25: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Our payload is encrypted into a small packet

Page 26: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We can use different algorithms

Page 27: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The Problems

Page 28: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

There are too many constants, even when thepayload and secret are different

Page 29: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Page 30: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

This is partly because the header containsinformation about what algorithm

is used and the type of token

So it will remain constant if these are the same

Page 31: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The separator is always a period

Page 32: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The secret is embedded into our code

Page 33: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Is there a better way?

Page 34: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Option 02:

blanket

Page 35: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Output:

Our Code:

Page 36: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The Benefits

Page 37: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Our outputs are more randomized than in JWT

Page 38: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Page 39: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The secret is generated for us and destroyed after use

Page 40: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The Problems

Page 41: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Our separator could be more random

It is currently a random three digit number

Page 42: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The message size is much bigger

vs

Page 43: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

The Differences

Page 44: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

JWT blanket

Page 45: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

In JSON Web Tokens (JWT)

Even with a new secret, parts of the message structure and output are always the same

Page 46: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

In blanket

Our secret is random and the output is always different,

even with the same input

Page 47: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Things We Can Improve

Page 48: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We can randomize the size and location of theseparator to further disguise the

structure of our messages

Page 49: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

We can use a hardware secret generator

Like YubiKey or Embedded Chips

Page 50: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Over time our own sequence, even though morerandom, could be discovered. So we should

constantly improve our own code and think of ways to break it

Page 51: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Nothing is ever “secure enough”!

Page 52: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

For more information you can visit..

github.com/jpadilla/pyjwt

or

github.com/JeffinkoGuru/blanket

Page 53: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Thank You!

Page 54: End-to-End Encryption of Distributed Applications

End-to-End Encryption in Distributed Applications

@jeffinkoguru – [email protected]

Questions?