You are on page 1of 11

Guess I made a mistake I don't know exactly what happened but pop quiz 4 betterley life

so I mean anybody life until the end of the class so you can pick any moment to finish that
I'm not going to stop the class ah if you want you can finish it already you can wait till
close to the end of the class but I don't know why you got Polish time and anyway it
doesn't really matter just keep in mind pop quiz four it's there you can finish you can take
it any moment that you want I think it would be better if you take it towards the end of
the class because well unless you already know the topics that we're going to cover it will
be better if you wait till the end of or close to the end of the class so you give me a chance
to cover these topics anyway it's it's it's there and then I'm not going to even better at
figuring out what happened why did correct Polish I think he got published personal
recently it's like he got synchronized with my morning class I don't know if that's
something in related team's or whatever it doesn't matter it's there if you can finish
checking the I mean sorry plant take that up please before the end of the test that's that's
it sorry that it's it's it's a little bit confusing so other than that you are perfect I meant it's
also life I published that yesterday and you will have about a week to finish that OK so
again keep an eye on teams so you know when the deadline is going to be so you don't
miss it and it's going to be pretty much or it is going it is exactly the same in terms of how
to work in this as your laugh is it's a a group activity you get assignment you divide the
word do the steps you solve the challenges there get the screenshots right the report and
then every everybody in your group should upload the report to teams OK so also keep
align an eye on that it should be marked on your on your calendar but don't wait till the
end of the weak finish that that trying to work that in advance OK so today we are going
to keep talking about cryptography we're going to hopefully go into more details
regarding symmetric encryptions asymmetric encryption algorithms hashing in and all of
that I will try to make this as fun as I can I will try to keep the math talk to the minimum
but of course if at any point you have questions please let me know and I will try to
answer them OK so I'm going to work on skeletron one second here so I can get one
second OK so here screen no I don't want to share my screen I want to share just a web
page later for now there is no need for that OK so this is going to be wait more one more
second Here let me try this one more time OK now let me working and I have all of you on
my second screen so I can check on the chat if you have questions OK so let's start we are
going to talk about all these cryptographic algorithms right symmetric encryption
asymmetric encryption and all of that but before doing that I do need to introduce you to
the most famous people in cryptography and actually in communication in general so
every single time that we want to talk or we want to describe a communication process
we use these two names right so we have our dear Alice enforce Bob so we have Alice and
Bob communicating but in our case we want them to communicate in a secure manner
right we want them to communicate sometimes we want to achieve confidentiality of
information somewhere times we want chief integrity will see how we can do that with
therapy but at the end of the day Alice wants to send some message to Bob and Bob
wants to send turn reply send message back right but because we these are real people
we need to represent them in the digital world so in order to represent them in the digital
world we are going to use robot Alice Ann robot Bob so let's bring robot Alice here we
have Robert Alice right it's labeled labeled Roblox Gray and because I don't like her
looking to the left I'm going to picks up European anything magic and now let's do the
same with this just move it dad I guess and now we have Robert and of course we also
need brother Bob so let's do that let's add our robot here this is going to be our problem
hard going label communicate with each other maybe they need to share some sensitive
information some confidential information at safe remaining that they want to maybe
they want to stay in love letters to each other right Anne privacy we need to offer them a
way to do this I think it's better and reward together enforce Bob world 1/2 a also nice
things too so you see these are this this all these communications all these messages are
their private life and well we have no business in their private life right so how can we
help them communicate securely and that when cryptography comes to play so we're
going to use cryptography or the first we're going to use symmetric encryption you're
going to see how we can do this with metric scription right OK OK that's better I guess so
with symmetric encryption what we need to do is well increase messages right we know
that do that how can we do that well it's quite simple Alex will pick a message M and then
what she will do 8/2 well create a cipher version of that message just by encrypting the
message with a particular piece of information you're a piece of data that we are going to
call a key alright so Alice will need to use some sort of key in order to do this OK we'll see
how we can do that but this is what Alice is going to do and once the ciphertext is being
produced well she will send that 2 Bob to use as many graphical references and I will try to
color code all my information here so hopefully that will help you understand how these
things work right so receiving the message Bob will do the opposite you will take the just it
will take the ciphertext and then he will recreate or get the original message by decrypting
ciphertext using again some key information here some key material that we still don't
know what it is looks but this is pretty much the whole process for doing that OK So what
is missing here is a key OK so let's give Robert Alice and Bob OK so now both of them cars
that they have please value this key that they will use two in the case of Alice triple
encrypt the information using this key and of course Bob is also going to use the same key
two different things so because they both know this secret key they both know this this
please Kiki they are able to communicate now it wants to reply back to Alice well he will
do exactly the same steps I mean all of these will be exactly the same except that it will go
from Bob to add so now you can see that this process is going to be pretty much identical
or symmetrical it doesn't matter were you looking from Alice's point of view or Bob's pov
it's going to be pretty much the same OK it's going to be exactly the same so if we want
we can duplicate this there's move some stuff around you see we only need 2 move this
over here and these over here Anne same you see that's why we call this symmetrical
because well it's pretty much the same from either side it doesn't matter if this is Alice and
this is in or Bob they are going to do exactly the same thing or going to use exactly the
same kyan and everything is going to be pretty much the same I know our theme why we
call this symmetrical will have to do with the what this he represents here the EN that EE
of course represents encryption and the represents decrypt right so every time that we
see The OR ether in every time we see here remember he means encryption the neglect
that's what these labels mean so we can move that over here without OK now for
symmetric encryption a common example is symmetric encryption algorithms it's going to
be AES the advanced encryption standard now if you remember what it was claiming that
last class I I said that symmetric encryption is pretty fast it's pretty simple to implement it
doesn't use complex operations or complex mathematical formulas or anything like that
it's actually true symmetric encryptions pretty much ultimate Rick encryptions use mainly
two types of operations transpositions and substitutions now transpositions just means
changing the position of one element in the message just taking one symbol from the
message places in your symbols and then sometimes a means DND means TNT means are
OK so as long as you know these rules you have pretty much a symmetric encryption
algorithm right that's exactly what BES free webcam overlays OK no I need that Tina
encryption here is what BY S date back in the 70s it was developed in the 70s approved in
77 and we use it until 2001 and it's pretty much as simple as that these are the system
different boxes as boxes they take some bites or beat you can you can it works either way
he takes him let's call this beats because everything is measured in beats in this image so
it takes a block updata 64 bits to be precise divided into then you take 1/2 that that has 48
beats you combine them with an X or operations freezing both really easy to implement
both on regular machines and in computers and then you take the result of that right you
take all these 48 beats resulting beats and use them in this substitution boxes and what
they do is that they take this input in transform that to an outlook of four bits where the
information has been changed or substituted by the resource of course the Xbox inside
beat out something it dropped a couple of lines you see here you have 6 beats as an input
and then just four beats as an output so the Xbox decided which beats not to use which
beats replace and which bits to move to a different position OK then you have these
permutation box that the only thing that I did was to completely shuffle the order of the
elements here now nothing here it's random OK just keep in mind that's why it could be
reversed because nothing here is random it's just a combination of dropping information
adding or information changing the changing positions and that's it that's pretty much
your entire desd algorithm now you do this couple of times and then you get your
encrypted message now of course by 20 sorry by 2001 by the year 2001 the
computational power available at that time was enough to crack the to be able to be able
to reverse the encryption even though you didn't know the key because well pretty much
you can try all these different patterns in which beats were dropped where is how the
permutation was done in and all of that so pretty much in in in less than one day you were
able to practically encrypted message with the yes that's why the call for a replacement
for that so it created a content in ask people to submit their ideas and the idea that won
the contest was an algorithm called rindal that later got created AES right so if you look for
AES encryption the advanced encryption encryption standard well this is the new
symmetric encryption standard that we use it is a block cipher I will explain a minute what
three much an extension of will be yes and just keep in mind pretty much every single
symmetric encryption algorithm is going to look the same it's going to have transposition
and substitution if you take the enigma machine for example it's that it's substitutions and
transpositions and sometimes export operations it's pretty simple is pretty fast OK so if
you completely analyze the AES algorithm you will find exactly the same ideas right they
are combined in a in a different order and the number of rounds the number of
repetitions is also different the size of the key it allows it's also different but again the the
main ideas are just substitutions and transpositions OK so there is there let's let's how AES
works animation right I'm going to share this link with you this listing with you copy that
there watch a simulation an animated simulation of AES how it works how shift
information I mean how the substitutions in the transposition operations are done AES
works using matrix the information is represented represented on a matrix and then for
the transposition part what it does is just cheating Rosen shifting columns and also there is
there is a nice table that will allow you to depending on the on your key this side which
value is going to substitute the original character or regional right you do that a number of
rounds a number of times by doing substitution shifting roles shifting columns and mixing
the key and you get your cryptographic or your your cipher text give me a second please

https://www.youtube.com/watch?v=gP4PqVGudtg&ab_channel=AppliedGo

Or it's just taking one bite or one beat at a time encrypting that and producing the result
so you see it's just a stream of data that flows through the the cipher it you can imagine
the cipher as a box then you have a stream of input information going one way and then
an output of information going the other way one element at a time that's why it makes it
a stream cipher a block cipher if you want to imagine a block cipher now imagine that you
have a buffer in front of the algorithm you forgot the encryption process and you first
build the entire buffer or buffer is just a fancy word dependency word or block so you feel
that block of data and then feed that block of data to decipher the cipher will do its magic
and produce a block all encrypted information sometimes the result is going to be the
same except exact size of the original look sometimes it will be it could be larger OK but
that's the the only difference that the order sorry the main difference between being a
string cipher and being a block cipher when you have a block cipher in blocks of
information and the AES these are pretty much all block cipher algorithms OK so to
encrypt and to decrypt you just pretty much run the exact same algorithm internally all
these transpositions in substitution they work like like like magic so they go one way you
go the other way it will reverse the process once you go into all the details reading exactly
how they work you can imagine this as just being endpoints connected with cables or
something like that and you will see that it's pretty much the same projector it's pretty
much the same path that the beats will take from point A to point B N if you flip it over it
would look exactly the same like an hourglass type of situation OK so that's the beauty of
pretty much any symmetric encryption algorithm that you can think of it's super easy to
do uses only transposition substitutions and it looks pretty much the same if you want to
encrypt something or if you want you decrypt something there is not much randomness
here there is not much but the only thing that makes the algorithm work and produce a
different result it's sticky OK so if you take one message like this one here if you take one
message in and you apply a key K so this algorithm you are always going to get the same
seat right now if you take these cipher message see here in apply the same except
algorithm guess what using the same key you will get the original message that's how it
works there's nothing there's no math there's nothing extremely complicated here to
explain I said that is being designed to work like that OK this is this is a the the point of any
symmetric encryption algorithm use metric because they pretty much look the same OK
so that's it it's easy to understand how we can do these or how can Alice and Bob
communicating using symmetric encryption but the problem now is that I'm eight day
can't sure this secret key K well down there in troll everything here works both Alice and
Bob shared the key if they don't they cannot use symmetric encryption and for that we
can actually use asymmetric encryption so let me Here OK let me when I need this create
create move it over here let's talk about asymmetric encryption so when we have a
symmetric encryption the idea here is to enable how is involved to communicate with
each other without needing to share a secret key in advance now you know how these
work right or at least in theory we know word we know that for this all Alice and Bob they
have son some cryptographic material right like they have again some some magic keys
and then imagine process that will help them to do that the idea is pretty much the same
as before it's pretty much the same as one more time ally has a message that she wants to
send to Bob so she will encrypt that message but cheat needs to use special mathematical
piece of data called a key and well Bob will get no information and by reversing the
process he will be able to obtain the original the original message from the the ciphertext
OK so now we need to determine what these keys are because well they're going to be
different and not going to be exactly the same as before they actually going to work that
we know that when we talked about symmetric or sorry asymmetric encryption our users
they will have a Perry off keys alright so they won't have a private key and a public key
let's labeled let's use cake a percent Alice's private key in K prime A to represent Alice is
public key and of course this is also going to be true or Bob right he will also have some
key material similar to so here's where color color coding things it's going to be very
healthy OK so Bob's private key and of course this is going to be Bob's public OK so that's
that that because this is an asymmetric encryption public keys are public that means
everybody knows and bottom of all the users in the system so for our little sample here
that means that means that Bob knows this is public key enforce the same is true or as
Alice will know Bob's public OK so you see having everything color coded it's kind of
helping us to understand already how things are going to work right so that's why we have
in turn asymmetric encryption let's see what can we use to allow involved to
communicate OK so for that we're going to do the following we are actually going to well
try to use all keys we were trying to bind all these and see what can we do with them so
we had box driving in public keys and of course we will have the same or else right Alice's
private key and Alice is public now let's see how this works let's see what will so Alice
Anne oh remember another thing that is very important to remember with asymmetric
encryptions mathematically the mathematical foundations of is metric incription means
that whatever you encrypt with one key could be the project using the opposite key right
so please keep this in mind whatever you encrypt with one key can be decrypted using the
other key the opposite key so if you clip something with KK it needs to be decrypted with
K prime age because that's the opposite right the box public key is not the opposite of
Alice's private key or Alice's public key Bob's public key it's the opposite of Bob's private
key right so you know it works if you put something here off a color any color over here
you need to use the opposite of that you need to use the other key that is off the same
color so if you put a green key here you'll need here another drinking if you put a blue key
here you need here another blue key OK so based on that if you take Alice's private key
over here and you need to use public key over there so you have green with green will this
work yes mathematically speaking this would work now will this help them to
communicate securely now why not because remember everybody that knows how this is
public key will be able to decrypt the message that's what we have here and if add that
knows the public key will be able to decrypt the message so whatever see Alice sends to
Bob it's not going to remain secret anybody can decrypt it in what we want to achieve a
secure communication between Alice and Bob right so whatever Alice is sharing with Bob
Bob will be the only one who can read it and vice versa so although this mathematically
makes sense well it's not our solution because the confidentiality of the message is not
guaranteed so let's try the other way around let's use the public key here and the private
key over here right well these were mathematically speaking again yes because we are
using the same the same pair of keys on the right pair of keys but now what's the problem
problem is that well Alice will be able to do this because she knows her public key but Bob
doesn't know Alex is private key right because it's private and because only Alice should
know that nobody else in the entire world should know Alice is private key so this will not
work as well this is actually how can Alice how Alice can encrypt a message for his or
herself if she does this she will be the only person in the world able to decrypt that
message this is how Alice will protect some data for herself right she will be the only one
able to read that message OK but this is not what we want we want Bob to read that
message so no green combination over here will work we tried both combinations any
didn't work so let's try the other combination we try blue here OK will this work well
mathematically speaking yes it will work now is it possible to do it no because again now
Alice doesn't know Bob's private key and she shouldn't because it pops private key only
Bob should know this key so this combination doesn't work either leaving us with only one
remaining impossible combination which is going to be the correct one OK Alice will use
box for the key send the information in Bob will use his private key to the crypted
message nobody else knows Bob's private key so he is the only one able to decrypt that
message that's why on Mondays question do you remember that that meant question the
right answer was Alice needs to use Bob's public key in here is discrimination why here is
the why hopefully now it's it's clear why right answer it's that it Alice wants to send
private message to Bob she needs to use box public in general and let's let's add a what to
remember section here remember what we need to remember asymmetric encryption
and a secured message we must create it you sing the receivers public that's the one to
remember for a symmetry encryption that's the only rule that you need to remember or
asymmetric if you want to create a cemetra P fine use the recipients public key and of
course the recipient can decrypt the message using it's private OK so it's not that hard it's
not that complicated now let's keep adding your let's keep analyzing what what what else
can we do of course if now we have the opposite if now we have Bob sending a message
to Alice well you know what we need to do right we need to rivers the steps we will use
the right because right now we don't have the right set of keys now we need to use the
recipients keys and their recipient is Alex that means we need green keys public key for
encryption private key for decryption that's it that's how they can communicate to each
other in a secure way using asymmetric encryption OK now in terms of algorithms that we
can use for this the most recognized one it's going to be RSA right now so you get a sense
of how place is this let's take a look quick look at RSA right now RSA uses a special type of
operations first of all all mathematical operations are going to be produced module end so
all of these are modular operations right and then we need spawn in ciation now how
does it work how use RSA well first of all we need to choose a pair of very distinct prime
numbers P and Q over here right this is going to be very large numbers prime numbers
203 hundred digit long number then we're going to multiply these numbers and produce
this value of N right and immediately after that we're going to discard we're going to
forget about it because actually storing PNQ can help breaking RSA here the the strength
of RSA relies on doing a factorization of very large numbers because it be P&Q are really
large numbers if you multiply them and it's going to be a even bigger right in doing a
factorization of that meaning trying to find P&Q from N it's going to be or fight hard for
regular computers like the ones that we have right now it's it's a very tasking sorry very
taxing task right so it's not that easy will take you forever quantum computers on the
other hand it's for them it's easier to solve these kind of things that problems it will take
them seconds to do it regular computers like that the strength of RSA realizes there after
we have him and actually before deleting PNQ we need to produce two more values END
and the in in E&B they have a very unique property g * d should be equals to one module
a now how can we do that well there are ways to do that we can use the euclidean
algorithm we need to use P&Q and find prime numbers and I don't want to bore you with
all the math here but just keep in mind that it is mathematically impossible to do that right
given a PQ N produce two more values E&E such as when you multiply them E times E
equals to one model N and this is the biggest part for RSA because now you can choose
one of these values to be your public key or you're encrypting key and the other you're
decrypting key is actually doesn't matter which one you choose right in order to encrypt in
message you will take that message and raise it to the power of the encrypting key let's
call that E for now in to the create that message you would raise again that resolve to the
other key in this case the decrypting key D now this remember equals 2M raised to the
power of y * d and if you remember he times the mod N is equal to 1 so this that you see
here is just an Martin and that's how RSA works OK to increase check the message raised
to the power of the encrypted key you just do that now take that ciphertext in praise it
again to the power of the decrypting key and you reverse the process everything must end
so you see this is not as simple as substitutions transitions in export this this will actually
take lots of time Computer memory in presence in power in order to achieve that is
mathematically possible to do so that's a nice example of what an asymmetric encryption
is OK so back here did you see this is how it looks and that's why we call this asymmetric
encryption because well for symmetric encryption everything is pretty much the same for
asymmetric encryption you need to be very careful which keys you use look at the colors
look at what one on one side the private key in the other side is the public key or vice
versa and so you need to be you need to pay attention to what you do with your keys on
asymmetric encryption now when we were trying all our configuration actually let me
check if there is any questions no we don't have questions OK so when we were trying all
these different configurations of gates was another configuration that work that was
when Alice was using her private key to encrypt the message and everybody was using her
public key to decrypt the message that is actually what digital signature is OK so digital
signature it's part of the asymmetric encryption world that's why I would put it like this
digital signature it's part of the asymmetric encryption process but now as I said we are
going to use Alice is private key for encryption and for public key for decryption right with
digital signature we want to achieve two goals one go first 8/2 assure the integrity of the
message meaning that we are able to detect it somebody changes something in the
message and the second the second goal is what we call non repudiation meaning that we
have proof that Alice is the author of the message and she cannot back up she cannot
deny doing or being the author of that message that's why we call this non repudiations
she cannot say I didn't do it so I can be achieved that speakers one one of our first goals it
integrity but we are going to do is to use hash functions this this this is where hash
functions starting appear in the picture right So what we're going to do 8/2 message in
Alice will take the message and it will compute it's harsh but she will use any hashing
function to produce a hash tag right now for the properties of a hash function or a hashing
function it's fast it doesn't generate collisions it doesn't produce collisions meaning we
have to different files we're going to get two different cash balance and this is important
this is key for us to determine the integrity of the message because if somebody changes
even one bit just one bit of this message in the entire hash value is going to be different
OK that's how it works that's how caching works if you change even just a beat of the
message you will get a different hash value over right so great also a hashing function will
produce a fixed size output that is going to be quite small it's going to be 128 bytes or it
could be you know 248 I mean 256 sorry 2048 pounds 256 pounds and so on right always
power in it's going to be small it's going to be really small doesn't matter how big the
original message is it would always produce a fixed size output the size of the output
would depend on the algorithm right so for example as I said we can produce a 100 and
28256 or most commonly now the 2048 but right that would be the size of ash so then
because we have a small message we can we can create this the signature for the message
and for that we are going to creep the hash value using show or some sort of key right we
already mention that the key that we're going to use it please traffic OK then over here
we're going to use the public key so here we use alesys private key remember this Dawson
gave us sorry this doesn't guarantee as any confidentiality doesn't provide confidentiality
but we don't care about confidentiality here because we are encrypting that hashing
hashing hash tag encrypting the hash tag in hash value or a hashing function is non
reversible meaning that if you know the hash value you won't be able to from that value
obtain the original message right so we don't care about this hash value we don't care
that you know that you can discover with what the hash value is we don't care OK so now
Alice will send this and Bob well take the signature and then he will verify the signature
how first it won't octane the hash value by decrypting the signature using alysis public OK
then he will take remember this is done after we done this as well so here Bob already
have he already has these end message right so you will compute a new hash value let's
call this a harsh prime this is going to be the hashing of the message that he received from
us write this message here list and he's going to compute that and finally it these two
values are the same well that means the information is valid that means that the the
message that he received previously it's the actual message OK so we have asymmetric
encryption or we use asymmetric encryption or two things we create everything using
their recipients public key but then Ali will sign the message this way she would compute a
hash value and then encrypt that hash value with her private key and send that
information to Bob that involved can verify the signature by first retrieving from the
encrypted message the original hash then from the previous message the previous and
that he got from Alice it will compute a new hash value if this you have values are the
same that means that the message that he received from Bob it's the same exact message
that Alice used to compute the hash value it's somebody at some point modify the files
these hashes are not going to be the same remember in any of these files God change the
hash values are going to be different because that's what that's a property of a hashing
function right we use hashing functions to guarantee integrity data because if you
manipulate the file just by changing one little bit it will show in the hashing and a hash
value and that's how we can we can see that here we can we can prove the integrity of
the file by doing that now what about non reputation well again if this is true it means
that the age value that Bob recover from here it's a valid page and the only way that this is
a valid hash value it's because the decryption process was correct so if the decryption
process was correct using Alice is private Alice's public key that means that the incription
was done using Alice is private any only person that knows Alice's private key well so there
is only one user in the system able to sign define and that was so that's proof that she is
the author of the message because it has it has her signature OK so I have a question
shooting Alex use the public key that Bob generated for more security what security this is
not about security this is about proving that the file is actually the same file and the
author is Alice we don't want to encrypt them we don't we don't care about the
confidentiality of the hash that's why we use Allison public private key because Alice Alice
wants to prove that she is the author of this she wants to prove her identity and this is the
way that we achieve that if she encrypts something with her private key in your able to
decrypt that that is proof enough of the identity of act remember what we want to prove
here is the identity of the author and that's exactly what we're doing if we use babsky we
are doing the confidentiality again and we don't care about confidentiality here OK so
that's digital signature now as you can see both symmetric and asymmetric encryption
well they have their their advantages and disadvantages right we already covered these
also on Monday but what if we can come with an idea that would let us take the best
parts of symmetric encryption being fast being simple being all of that it also taking the
good parts of asymmetric encryption right we can do all these things we can sign things
we can prove identity we don't need to agree on a short Creek on a shared key secret key
before hand and not that how it would be it would be wonderful if we can combine these
two things and produce one cryptographic way of doing things that has the advantages of
both worlds and that's exactly what we have with what we call hybrid encryption OK so
hyper encryption is not other thing that combining alright so hybrid encryption In
symmetric how we use asymmetric encryption Greek secret key to be our session it's also
called a session symmetric encryption wiki page with that section key to communicate OK
and that is hybrid encryption so what is happening here it's at first we use the asymmetric
encryption protocol to agree on a secret how can we do that well there are a couple of
ways a couple ideas that we can use remember asymmetric encryption works right it's just
too slow for large files and then for real time applications where time is sensitive right but
it works right so what if Alice chooses a secret right why did Alice Alice chooses a
temporary secret and she encrypts that secret with bobs public key and sense that will be
able to decrypt that using his private key in get the same secret so now both Alice and Bob
sure a secret that was communicated that was shared over a secure way and then we can
use regular old symmetric encryption to communicate in an encrypted way but in a fast
way because symmetric encryption is just fast so that's exactly what the majority of the
secure communication protocols that you can think of do that's what TLS does when you
have an HTTPS connection you are using hybrid encryption first we use asymmetric
encryption to create this session key and then we use the metric encryption with that
session key to encrypt the rest of the communication another way that we can do that or
sorry all the protocols that might use this as I mentioned before SSH pretty much the same
idea that's why when you first log into a new SSH server the first message that you get it
one saying 8 this is the servers public key you want to send it once you accept that key you
can use asymmetric encryption to produce the session key and then use the session key to
encrypt everything else VPN same story now I know that way that we can agree on a
secret based on asymmetric encryption it's what we call dipping hellman key exchange
algorithm right it's quite simple actually let me show you an example let me show you
here a picture how we do that Alice we have again Alice involved over here so Alice has an
ag NP she will choose those three dots and then she will compute a capital a value which
is nothing else that sorry not gay but GG to the power 8 that's gay and she will send to
Bob G P in capital 8 now Bob will choose a value be a random value and he will compute a
capital B ask G to the B mod P in Bob will send that value that capital B back to us now
Alice will raise capital B to the power of 8 and Bob will raise capital A to the power be
marked right so if you replace here what B means in here what a mean let's do it like this
B it's just G do they eat so this is G to the power of b * 8 Marty and this is G to the power
of 8 * b mod be so it's pretty much the same time that's exactly what is explained here
right so 10K it's going to be your secret again using asymmetric encryption a couple of
private keys and public keys we can achieve by using diffie hellman we can achieve a
secret by doing a DP key exchange algorithm right here the private keys are going to be
lowercase a in lowercase B you see these two values are never shared between Alice and
Bob everything else it's Bob you can share them but as long as you keep it private key on
both sides you can agree on a secret Cherokee so that's another way that we can we can
do hybrid encryption right away that we can use asymmetric encryption to agree on a
secret key and then use that to communicate using symmetric encryption right OK so after
all of these why do we need a digital certificate why are they important so if you see
everything here everything that we talk this afternoon works because we're using the
right set of keys 5 because here we have a green key here we have our greens and blue
keys and they are correct there's nothing wrong with this now I don't understand why we
need different certificates I think it's time now to introduce you the third most, or does
the third most common person in cryptography our attacker we called the attacker eve for
evil or Mallory for my level end in all that so we called battery Hawker and the talker but
it's just any pastor somebody that once asked to believe that he is Alice bad in fact it's not
OK so that's exactly what we're going to do we're going to represent R attacker are not
very here also using its digital counterpart OK so don't forget about the pop quiz by the
way so we're going to add our battery power right we are going to call whereunto label in
memory or eve or impostor are Tucker Tucker correct so and this is an area when we talk
about symmetric encryption as long as Mallory doesn't have access to these key K you
won't be able to read the messages I mean he will be able to see the messages but The
only thing that he will be able to see it's just well pretty much search it won't be able to
read the message because he doesn't have the right key if he has access to the same key
of course he will be able to decrypt it like any other user like any other bob or alice in the
season that's why it's so important for us to keep this secret

You might also like