S1 - Foundations of Cryptography
ZK & Privacy Bootcamp · 1:49:56
Milica introduces cryptography through Caesar, substitution, and Vigenère ciphers, with hands-on encryption and decryption exercises. The class then explores primes, modular arithmetic, frequency analysis, key exchange risks, and randomness as preparation for later zero-knowledge lessons.
Speakers
Topics
From ZK & Privacy Bootcamp, published by dev3pack; community: dev3pack.
Transcript
Hello. >> Oh gosh. >> Yeah. Yeah. Yeah. Hello. because I don't like your mask but like it's just >> a bit red. Hi. Hi. >> Hello. >> Yeah, but this time with time that going to change. Anyway, that's cool.
>> I don't also speak French. >> No, no, no, no. I can only speak a bit like this. I can only say sava and also. No, >> no, no, no. What's your favorite word? >> Oh, I cannot say my favorite word here. So then teach me really terrible words in French. >> No, no, no. It's a lie. Um, all right. So, I would just put a message. Oh my god, I'm like a tomat today.
Tomatoes literally [Music] still in pajama. It's perfect. It's perfect. You can show up in pajama. No reason. >> Actually, I'm a bit in my pajamas, too. But >> you understand the concept. Yeah. >> No Spanish there.
Sorry. Sorry. >> It's my mom. >> I'm just going to say like, yeah, I will be with camera on just when I have only pas in the top down. >> Okay. Okay. >> That's not going to happen to me. >> Okay. Let's not turn camera on then. >> All right. This message recap. [Music] My daily life is to o the sation but I I been a while in fact like >> what
>> since a month like I didn't host >> oh >> was my daily life >> you're in Argentina huh >> no no >> yes Okay. >> Yes, I am. >> Oo, perfect. Then >> are you going to >> little death tree pack? >> Am I going where? >> To the >> Yes, but today no. But I moved very close to the so now I can go every day.
>> Okay. >> Oh, wait. probably we are just uh like I'm moving No, I don't I'm leaving at 5 minutes from the because I'm just like >> really >> Yeah. >> Where? >> So that's why >> we live pretty close then. >> Okay. Okay. Uh uh yes. So, we're gonna wait like I do >> three more minutes.
>> Yeah. Yeah. Exactly. >> Let's wait together. >> Yeah. And [Music] you do you have your mask today? my mask. Did you talk with me? >> No. No. >> Oh, okay. >> Like has a special mask and she puts she put um represents privacy.
Uh talk talk. I think I have like ah probably I have like an e >> really sorry wait >> I will >> I don't know if you are playing music where are you coming from just put your uh flag chat to start >> I saw people from Turkey so that's good >> oh nice >> on my is you can guess easily.
>> Yeah, with the accent. >> Yeah. >> Yeah, I have a good accent. >> Philippines, Spain, India, Mexico, BA, Morocco. Nice. >> We have a lot of participants all all around the world. Yes, literally every time is is the case and I think even people from Australia, New Zealand too are there. So, >> but isn't it night right now? And >> no, I don't know.
>> Like 10 10 maybe something like this. >> Yeah. >> Oh, I say because it's like my French accent, but I like D. I don't know how we say >> no. >> We say like this, right? >> I don't think so. But okay, >> could you hear us? >> Oh. Oh, you are talking. Hey. Hi. Hi, guys. How are you?
>> Yeah. >> Good. >> Like I was trying to say your name. Oh, I I thought you were talking about some concept, some derivative or something. >> My bad. >> It is because of Sen's active, right? Like she couldn't say your name. >> Yeah, but but you were doing almost fine. It's It's Disha. >> Oh, but it's perfect. It's what I said. >> Yeah. Yeah, it's both. Cuckoo.
>> Hello everyone. Hello. Happy to be here. >> Hello. >> Yes. Um, so Melika is coming and then I will just make a quick before starting. Um, all right. So we are one hour late. Um uh >> we needed to postpone the one hour. >> Yeah. Yeah. Yeah. Um Mika probably will explain why. I don't know. And >> oh it is because ZK verify is going on mainet and she need to deal with the
documentation and everything. This is why. >> Yeah. So let's go. Yeah. So that's great. Um first of all like uh we got many application like 180 and we stopped like one week before the >> deadline. Yeah. >> Deadline. Yes. Because we can't accept more great application like a lot of great one. So we wanted to to have um like a specific small group uh because like it's a really technical topic and and so I I will feel it's going to be better like this. Um and so yeah,
congratulation for being here. Um literally um that's so great. You can think about this this um boot camp as a safe space like to to learn uh and also like um really to to just yes make connection uh but also if you want to ask any kind of question um like there is no stupid question there literally. So make sure um to ask whatever you want to ask. Uh we have great uh teacher a really great teacher.
So yeah exactly Rosio um and um what I wanted to say yeah actually uh I wanted to to do this uh this boot camp because um it was a request from from Deupac uh community. So a couple of them wanted to really uh make start their first step uh into zinc ziki in privacy. So I said okay let's do that. And so basically uh atun cooked uh a curriculum for you uh literally uh in probably two weeks um with with speakers like great teachers as I mentioned and probably at if you
want to like make a little introduction about you about also like the curriculum or yeah whatever you want to. Hello everyone. I am actually a CS uh student, my last year. I'm going to graduate this year. Oh, really sad year right now. Um I wanted to prepare a compact ZK curriculum and everyone all of our uh tutors really helped me during this process and hope you will find it uh well and you will benefit the the most.
>> Yeah. Uh thanks. Um so yeah we are hosting uh it with a couple of partners. So basically they can verify so many minutes are there. Um so she she will teach you a lot of things today but also during the upcoming weeks. Um she will be our main teacher. So feel free to ask whatever you want to ask for sure. Um and uh and yeah uh I feel all good. Um if also you are interested to join uh Dev Tupac. So um we have soon a quart but the thing is um people who will finish uh this boot camp uh successfully
will be also fasttracked into the community. Um just to let you know >> one last thing please check Google Classroom. uh we have attendance and also like uh we're publishing all of the resources there so please check it. >> Yes, I will send the the the link there. All right, all good. Um Melissa, the stage is it for you. >> All right, thank you everyone for joining. Uh my name is Milit. I'm currently in Milan in our wonderful office because we're launching a mainet.
Um I'm develop relations engineer at ZK verified and then also doing my PhD studies um in in noad in zero knowledge proofs. Um so yeah it's my it's really my pleasure to have you all here. We're going to have um a lot of um yeah well we're going to cover cryptography um everything we know about zero knowledge proofs that will be suited to this audience and uh also we have some practical exercises because why not you know the theory is one and the practice is something else. Um so yeah uh can uh someone tell me here in this audience uh
you know what do they know about zero knowledge proofs or they new to zero knowledge proofs? What excites you about zero knowledge proofs? I think for me what excites me about zero know proof is like the math behind and how it works and how you can actually like prove something without giving like giving knowing actually the parameters of it. Um so yeah understanding that and how to use it like the use cases.
>> All right someone else. Hey. Hi. >> Sorry. >> Yeah, you go ahead. Go next. >> Yeah, thanks. Hi Mika. Hi everybody. Exciting. Yes. Zero knowledge. Um it's been we can say uh this year I happened to visit Jamaa and there I happened to meet again Arman from ZK verify. So he pled me all about he pled me all about what Zik and privacy is all about and from that onwards I cannot you can say push away neither Ziki neither privacy from my mind. So I happen to you can say did some um collaborative work with ZK
mock some marketing stuff out there. So I'm quite you can say interested to know more about the domain. Yes, the math is complicated. Obviously, Arman did took uh did took some sessions on GK start and snags and all. Um for me it was like chords and tangent frankly speaking I didn't get that mark very well but yeah later on I did found your you can say one YouTube video which you posted out that feel quite an easy peasy thing and then that again you can say inspired me to push again to you can say have or get on this bandwagon for ZK and privacy. So yeah, privacy for me is like inner peace like yeah and I'm you can say an opponent of that and yes that's why I'm here in this boot camp to explore that
I'm well versed with the knowledge and and the process. So yeah looking forward to all these cohorts and sessions and to our discussion and of course for the building aspect of it cannot you can say remove the building aspect of it only learning learning it's not a great use case until you apply those in real life or real life scenario. Yeah, >> bravo. >> Yeah. Uh, hi everyone. Uh, for me basically uh I've been a believer in uh privacy and as well as in uh the zero knowledge. Uh I got introduced to the knowledge way back I think three years back thanks to stark net and and then
the journey the more I learned about it. I'm still learning to be honest. But it the the thing with the knowledge and privacy is we live in a age where AI is taking over everything right and we don't realize it. We are in uh AI is basically invading our privacy to next level. every other day there are some tools which are coming and that's what is very scary to me and that's why I feel uh privacy and especially through uh using zero knowledge will be uh the game changer because that's the need of the R and uh I think that's why I want to keep learning more and uh use this knowledge to build uh projects where
like I'm building in the gaming side as well as other thing and future applications So thanks thanks again uh to uh Solen and Hun and all the dev 3 pack team and I can see a lot of familiar faces and honestly I feel like I'm home. So thank you all beautiful people. Thank you for the opportunity. >> Um hi I can go next. What excites you about uh ZK? So I read somewhere uh in Twitter while I was scrolling uh what optimistic rollups are and it was mentioned that uh it's something that you are innocent until proven guilty
which was uh you know is the concept where if you're why are you like uh always proven as innocent unless you are actually like uh proven and with ZK it's like you're guilty unless until you're proven you're not so that concept around like it's verify and only then trust uh because you we have seen so many fake identities all across the crypto this is something that is a gamecher and I'm really bullish on it I was there at the ZK verify uh India hacker house as well over there I met Arman and Steve from ZK verify team and they also kind of zk me we had a good chat and I'm super bullish on it
>> I'm so happy for you it's Um it's uh it's been really a pleasure to have all you guys in the hacker house. I'm so sad I'm not in India but then uh you know it's um it's business so we need to we need to be where we are called. Uh but yeah is there someone else to share why they want to learn zero knowledge proofs? >> Um >> yes I can. >> Yeah please go. >> Thanks. Um it's Lup from Bolivia. I think I've heard for the first time CK this year in a hackathon um around July August July and then some somebody told me it's really important I was like I
don't know what is that and after that a friend of mine sent me a comic with CK and it was like this is a reading about CK for children and I was like oh okay now it makes more sense and how it's compared and all. So I am I just got more curious about that and I think the real world applications built on top of it are amazing. So that's what excites me about this. >> Super cool. Uh Karolina wanted to say something.
>> Yes. Hello everyone. Um happy to be here actually to continue somehow my discovery of the zero knowledge uh technology. I I tried a bit to play with it during ZK hack stumble. It was uh one year and a half ago and it was fun but I always have the feeling that uh um it's hard to understand everything all the the curbs um all this ecosystem uh what's possible. So I I feel like uh each new vision of the technology is we have something to learn from that and very uh um curious about your vision and what you see and what you can learn to
us. So yeah the goal would be to uh even better understand the schemas the possibilities of combining curbs and all these things. So yeah thank you again for having me. Great. Thank you, Karolina. Uh, yeah, I see, you know, a lot of uh cases here for privacy and people are very curious about Matts and Zik and everything that uh we're offering here uh to you to learn. So that's um that's really great and I'm so happy that you know like a couple of members here have uh heard
about ZK through the company I work for here at ZK Verify. So that's um that's really awesome. Um all right if um yeah we have some questions. Let's see. Uh okay. Yeah, I just saw it. Um yeah, we're all excited about certification of Zik and the real world use cases. That's why we are here because we don't want to leave it up to theory but um we actually want to uh make it real life uh application.
Okay. Um so now I'll um I'll share a small presentation I prepared um with you guys. Um please let me know when you see it. >> Yes. Awesome. Perfect. >> Okay. Ah, so um we're not going to um overwhelm you guys here because um diving into cryptography is um quite a serious business. Um I have uh studied cryptography in my bachelor studies and also did my masters in it. Um now I'm doing um my uh PhD um specialized in
zero knowledge proofs that means that um it's focused a lot on cryptography right because cryptography is the basis for zero knowledge proofs and um to be um someone who is um working on um on a cipher um I did it in in the military like couple of years ago And it's quite exciting but it's quite um also um it's a quite responsible job because you you always need to be on the tip of your toes regarding maths and um and the you know the vulnerabilities that we are going to show here.
So yeah um let's start guys. Um so yeah what is cryptography right? So you know like I've heard like a couple of you have um you know stated uh privacy as a case for doing cryptography at all and it has been that like that for um well since we exist as human beings people wanted to you know uh um have some uh secrets or they didn't want to publish everything uh about them. they wanted to communicate um secretly with their families that are maybe in another village and um that's how it started. So people um tried to um to make the
information obscure um to everyone else so that the end recipient can read it. And as with what's the most of the technology that we see as uh the the advanced ones, it started with the military application with wars and um some of the earliest um ciphers we know um are Caesar cipher because he was uh he wanted to communicate uh secretly with his generals that were on the other side um let's say on the of the country of the Roman Empire. You see it's like I'm I'm I'm talking about Caesar Cipher while
being here in Italy uh which was once the Roman Empire. So like um nothing is a coincidence, right? Uh so that's uh that's super cool, right? Uh so yeah it's uh people wanted to to to retain confidentiality uh the integrity of the message because like if we do not have uh um if we do not have the the message properly delivered then maybe that message is not uh useful to the end recipient at all and the authenticity as well. um because we want to we want to be uh able to recognize that message is a genuine one that reached us. Um okay. So and um yeah
so we have started from simple substitutions um through symmetric and asymmetric cryptography to modern zero knowledge proofs. So you can look at zero knowledge proof as uh some sort of a crown of cryptography right. So um yeah let's um let's just explain what like what is symmetric and a symmetric cryptography like um it's mostly the answer lies mostly in the keys. So usually when you have um when you lock your door, right, you have one key and whoever has access to your apartment or your home has the copy of
that key and the same key will open uh the the same the same lock. Right? So that is the case with symmetric uh cryptography as well. When you have ciphered text um you will have uh uh in in the case of symmetric cryptography you will have um single key opening that with symmetric cryptography um the trick is that you will have um uh one uh key that can sign the message and another one that can open. It's uh it's a public and private key and uh that's something we'll see later but it's important for you to know regarding concepts that
something like that exists. Any questions so far? Okay. Looks like a no. It looks like a no. Yeah. Okay. So yeah it's um the regarding the historical context. Yeah it's um we have uh started from uh shifting um they um uh we we shifted the the alphabet letters uh from left to right. That was like the
first thing that we had. Then we uh had um because that was easily breakable, right? Especially if you are if you know that uh people are um just shifting um A to C or or B to D, you will easily catch that and like you will be able to ease drop or even change the message. uh with substitution cipher um that means that like each letter that you have you will substitute it with another letter but it's not tied to this shift okay so for example you can assign A to B Q or B to be let's say J it doesn't mean uh anything when you look at it
like you will usually you will have two rows like from A to Z and then like um unique letters assigned to all of them. Uh but they are not uh uh in in the alphabet order order but Caesar cipher and any shifting ciphers you will have it in the exact order. Uh also there are like blank there are maps with with blank spots. So sometimes you will have uh this um this nets with blank spots where you would um you would uh write your um secret text, but you will need to stop at the certain point. And if you
do not have that map with let's say blank or or or black uh um quadrants, you will not be able to um you'll not be able to to decode it. And um and yeah there are visioner ciphers uh that was like um that was uh unbreakable for quite some time uh because um it had keyword shifts and uh we'll see all of that uh because um we're going to show it live how it looks like and how it works. So you will have the practical example as well.
So yeah um so but uh how does it look like? So for example, hello here will be uh if we do shift by three uh that's usually the the Caesar cipher example uses three you will have the you will retain the same length of the plain text and um you see that we have double L and then it repeats with the double O so you will retain the frequency And uh attackers are using frequency analysis and they can easily break apart. What does that mean? Like frequency analysis
it means that for every language you have the frequency of letter u that is uh being um shown in a text. So let's say if you if you if your cipher text is uh 1,000 words long um you will be able to do frequency analysis and showing that let's say uh one letter is the most frequent one. Usually you can map it to A. If it's like Q, you can map it to A. And you will see like all of these frequencies would um be easily comparable with um if you're using English language. H you will it will be comparable um and um you would be able to replace them and um you
can try it in in in the sequences and once you have something that looks um understandable to you you are in a in in a good spot right um so let's um let's try one of those examples uh let me just See? Okay. So, I don't know. Do you still see my screen with the cryp? >> Yes.
>> Okay. I will send a message uh in uh Zoom. Okay. I'm sending one in chat. Uh which one are we looking at? So uh this is alphabet. Uh back in Caesar's time they did not have um J. So they mapped um J to to I u but like it was it was not at that point. But now that you have it, you will just do the same shift.
Uh so uh what was the example right the example was hello and we can see yeah it's um it's this one. So uh how does it work? Like so we usually cryptographers when uh they were uh calculating they would write down alphabet like this and this is what it would end up like. So then d is like a uh uh once you see the a in the beginning it becomes d.
So let's try for example like and uh n what would it be? Does someone know you >> exactly? So let's try with let's say Anna right A became D N became Q and A again became D. So it retained the looks and if we uh if we start changing the the shift it will um it will just move to another direction but um you will see that it will retain uh
the same frequency right it would look like it. Yeah. Okay. Um so next thing um let's uh let's try um visioner cipher uh where we're going to have let's say a substitution cipher uh where where yeah like um instead of having Caesar cipher where you just shifting everything and you are retaining uh the frequency you here you will still retain the frequency
but it's it would not be as easily breakable uh because you are assigning randomly letters. So what would it look like? Um so let's use this example but um it's uh going to be um it is going to be something else like uh let's say that um we can say like a um a is going to become g or d is going to become m and like you can just assign it um randomly as as you wish.
So let's say it's some um special ca like it's a special case of um uh substitutions like war like shift ciphers because here you you know exactly what are you uh um so you're still replacing it. It's still substitution, but it's it's a simple substitution, the Caesar cipher. But with uh the the other substitutions, it's um it's uh it's um breakable but um very prone to frequency analysis. So what people do in those cases is um they have added some sort of salt. What does that
mean? It's uh they they would uh add something at the rear end of the message that um will show you that the message ended but it will not um add anything significant um to the the reader. Okay. So let's go to vision cipher. So vir cipher is um uh again like there is a there's a key there's always a key.
So with um with shift cipher the key is uh uh how many shifts are you going to move your your text. Uh with substitution ciphers like uh you need to have the alphabet and um the exact substitute for every letter. With visioner cipher you are going to have one keyword that is going to be applied and repeated over text. So what does that mean? We can say um let's say uh some someone's name let's say uh Ariel Cardas right so we can we
can uh uh we can encrypt Ariel Cardennas with crypto and um you know how does it go so we're going to repeat it until um we are out of uh the plain text right so once we have the plain text let's say it ends with uh uh uh what ends at C R Y P and that's a stop because we're not going to do anything with T or O. And um what's good with that is that your key is small. So um it's uh it's a it's a good um uh good uh thing to have. nice uh nice nice uh um benefit.
Uh but yeah, like until the advanced analysis was unbreakable and that's something you need to remember that um there are no unbreakable ciphers. Uh that's what uh people always teach you in cryptography classes. It's just the lack of uh tools that we currently have. Right. Okay. I'll show you how does visioner cipher look like. Let's say okay vision cipher. Okay. So usually yeah we have the quick brown fox jumps over 13 lazy dogs. Right. It's um it's
uh so the the numbers are retaining its um um qualities here. Uh but there are sometimes there are um methods to transfer them as well that we can map them and um you know if you see the quick brown fox jumps over a c lazy dogs you would know that it would probably mean it's like one and three right that's how we're going to map it. So yeah, this is the the cipher text that's being produced with this key. But we can say uh we want to do crypto and it changed
um what's a nothing changes. Let's say if we have a a b. So now every third letter has changed right you see one two three one two three and like this means nothing but if we know the key and we know that we're using visioner cipher we would definitely be able to decode this um to decrypt this and it will be brown and still like this is fox etc. So we can even um Yeah. Yeah. Hatam, I see you have a
>> I have a question. I'm sorry. Why change with AA? >> Uh because Yeah. Yeah. Yeah. Because it's mapped as zero. >> Oh, okay. >> No movement. Yeah. So B is one movement, but let's say C is going to move E to F and G two steps. Oh, I thought that like we are ignoring or something like that. We are just shifting it then >> with the number of the letter >> uh in the end. Yes. Because what's what's going on here? You say like AAC and uh how are you going to encrypt that?
You're going to put your plain text and over your plain text you're going to to let's say it's crypto. You're going to this is how it goes like you write your plain text and then on top of that you're going to take crypto your key and repeat it crypto crypto crypto crypto crypto. Uh when you have spaces, you do not use it. You just skip it. And then you're going to add you're going to add C to the T.
So this cryptoc you're going to the T. >> Uh R to H. But um if you shift everything you will just end up like you can you can make an implementation uh of cipher with uh a being uh one and uh you will just have another shift that will point to because it's a modulus uh you will just have another shift that will point back to a but uh >> oh I see will not move anywhere like uh you need in in this alphabet you need one that will not move anywhere like let's say uh a moves to uh one places
but when you come here um this will then need to move back. >> Yeah, we can make a uh we can make an exercise out of this. Uh so yeah like um uh Hatton and Selena told you guys to bring pen and paper. So let's try this. It's a great example. So first of all you would need to know uh the the values right. So you need to know like um you write values on top of your alphabet 0 1 3 4 0 1 2 3 4 etc. So that a is zero and d is three. Uh let's
try it. Let's first map um alphabets. Um like put alphabet and underneath it you can put 013 0123. I don't know why I'm eating two. Maybe because I'm living in a binary system. I don't know. Yes, I could hear right.
Yes, we're shifting the whole text. Who is seeing stars? Uh and why? Uh uh so for now um we will use we will use the you can just write your uh alphabet and on on top of the alphabet
or underneath it you can write numbers. So that's the first step you need to have in order to be able to um work on any plain text. Okay. Um, please let me know when others are done too. If you don't write this, you will not be able to work with uh ciphers. So, Is there someone who did not do it yet?
That's funny. Guys, do you see uh Austo's message? Um so Austoa has cipher text who gets to repeat itself uh within um within thrices. Why is that happening? Uh because um he took uh three um consecutive like next to each other letters in the opposite direction. So let's say it's 3 2 1 and when it's uh when it is
um uh um adding to uh 1 2 3 it's it ends uh all fours. So that's what's happening. Okay. Um so guys which plain text should we should we work on? What do you want? The three pack. >> Yeah, maybe. Yeah, let's go for it. >> Yeah. Uh, okay. I will give you the I will give you the plain text.
So, this is the plain text. Hello. What are we going to do? Um, so the key, what will be the key? If you do ZK, would it be to like short.
>> Uh you can do it with minimum two. Yeah. Come ZK Monday. >> Yes. >> Yeah. Perfect. >> Let's go. I'll ask you to show your papers.
Yeah guys, can you show it on on camera? What have you written? Let me see. Let me see. It is so small. >> Uhhuh. Okay. Yeah, that's it. Uh has it right. That's that's uh that's prime example how you want to do it. Uh Roberta. Okay. Yeah. Bravo.
We love it. Who else wants to show us? Don't be shy. Oh yeah, you can uh
if you're using um your own alphabet, you want to um you will definitely then need to to include um ciphers. If you want, you can use it on that one. Yeah. Yeah. And uh I'll tell you the story of um cryptography as well is um in in I think it was I when the allies have used I think it was people from Navajo tribe. So um only
they knew that language in a in a like small group of people. So they have put them in two ends where they needed some info and they were able to plainly communicate but there was no one to decipher that. So yeah that that exists too. It's uh it's old concept. Okay. Um, someone else to show their ciphers or are you guys still writing it?
Okay, I'll um I'll start um uh encoding and decoding um some of the some of the sentences people have sent here and um the first ones that um we have uh shared. So yeah. Uh not sure like okay I'm now I'm screen sharing right? You see the the cryp. >> Yeah. >> Yeah.
>> Okay. Cool. Okay then. Um let's see what is the text box for it. Okay. Chat. Okay. So, we used ZK Monday as key because why not? And our plain text was hello dev3 back. And you see the key mode is repeat. So, it's over over the the plain text. it repeats and it u adds on and it shifts
uh the the output text to this one. So all the people who got this um are right. Congrats to you guys. Uh Rosia had some special message. We can we can encrypt that one and try it out instead. Uh yeah, let me see. Um that is uh Rosio's Rosio suffer text start with S R U G and that's right bravo Rosio.
That's it. Usually when uh people send you something like that at least you know that they have retained um they have retained the form of the sentence because you see you four letters then two letters three letters etc. But you still have to check. Um, so it's um I I see it's um it's written well. Uh yeah. Uh someone used um Turkish letter. Nice. Uh okay.
Yeah. Yeah. Yeah. Yeah. We can we can introdate this tool. Yeah. It's um we can have our own kind of language and so it's um it doesn't have to in this in this place like um we can have a we can maintain case or ignore case. So it's it's up to you guys. For me um my personal choice is to emit the case if I can uh because it will show something.
So you would see here and you would know it's some sort of name or or something like that and you know it's six letters and uh and you know it says something. So this could be uh I don't know Monaco, Milano, Milita, something like that and you would definitely know like okay it's either a toponym or a name. So it's it reveals something so it's less secure in in that way. Okay.
Um let's uh let's go further now that we have resolved even visioner cipher. Yeah. uh from time people said like okay now we have to move from puzzles to some maths because people start started being very clever and started breaking uh things apart right and then they started number theory primes model arithmetics modulus um discrete logarithm and everything that we now know as modern cryptography
that Um I don't know if there is like any service that we have that does not have cryptography layer that would be quite strange because how will we have our passwords um safe etc. Um so so it's uh it's um it starts from you know password for for let's say for Wi-Fi or um you are buying um uh t flying tickets to somewhere like you need to log into your portal and you will receive code and you want to know it's from a genuine website that has some signature you want to check that
signature then you will see like oh it's ECDSA curl proof. So what does that mean? It's it's built on number theory. So we need to cover that too. Uh yeah, like why number theory? Uh well, it's um it's uh definitely a foundation of modern cryptography. Um uh you will see in uh in the next lesson that we have. Um I think it's scheduled for Wednesday if I'm not mistaken. We'll see um how we can um exchange our keys in in a secretive way using Dy Helman protocol. uh what is elliptic curve cryptography or RSA
and uh what it deals with are primes divis divisibility modular arithmetic um we will see um create divisor and um everything that supports that. So who knows what are prime numbers and wants to talk There are numbers that cannot be divided by by any other number. For example, you cannot divide seven between two or three or five because you not get a an integral number. And there's curious
because yes only by one and it's curious because at the first site you can believe that it's kind of Fibonacci structure but when you start to getting more numbers you realize that it doesn't >> a great answer. Uh thank you so much. So you know like when you when you look at these numbers um you can say like okay like uh what happens if I multiply the two you would say like okay 7 by 11 is 77 right and you know if someone asks you you know do you know like uh what's uh what two
numbers or three numbers if I multiply them I will get 77 and you would say like I think It's obvious it's 7 * 11. But if you have some ginormously big number that is like uh consisted of um let's say two primes that are um I don't know um six digits long and the other one is like maybe six or seven and you have you end up in some ginormous number then to find who is uh dividing that number it It is very difficult. You need to go from one, two,
three, four, five, etc. to go and to you know to name everything up until that number. Okay. So that's uh that's really really difficult to do. And um even here like if you multiply 11 by 13 you will end up with uh uh 143. And people would be like okay like uh it's not divisible by two because it's not ending in in a in a a bar number but it's not divisible by uh by three because the the addition does not end up in something uh the final addition does not end up in something that divisible by three and that's how you start it's not divisible
by five because we do not see zero five in the end and that's you know how you can tell uh if some uh number can be divided quickly with some uh lower primes but when it comes to bigger ones it's it's quite quite difficult. Um yeah so it's uh if we look at um greatest common divisors uh we will see like okay like uh uh 13 20 21 and let's say six and they have common divisor of uh of three and um so does um um let's say um we can we can use some other
intermediary numbers and that one is used in key generation and co-romality checks. We will see that as well uh on some uh examples and we will actually calculate those and in the next session but for now it's important for me that you know the concept of it modular arithmetics who doesn't know do you think um uh let's say uh we we do have something that we use every A and modular as modular arithmetics and it's uh we can use it with addition and
multiplication and and exponential calculations as well and it's uh quite interesting because all of us were all using it and uh how does it look like? It looks like um you know when you have uh um let's say uh what what's can someone tell me what's the time now? >> Where I'm at is 1.
>> Uh but one a.m. or pm >> p p.m. >> PM Okay. So, uh what's another uh what's another way to say 1 p.m. >> 13? >> Exactly. >> Why is that so? Because we are calculating you see when we when you have this regular clock it's from 1 to 12 13 it becomes 100 p.m. So on a daily basis we're always having the modular arithmetic.
So, um, so yeah, like it's uh what's it uh 400 pm somewhere? Yes, it's also 1600 in um in another notation. So, yeah. Yeah, someone said 1929. Uh, what would that be? Um, it's uh 700 p.m. and uh 29 minutes. 13. Yeah, it's 1 p.m. 11. I don't know. Is it one? Is it before or or after noon? Minus 12. Nice.
Perfect. Perfect. Um so yeah this is this is um a modulus operation on addition and um and you can do uh modulus operation also on uh on multiplication and exponential uh functions. So um yeah any questions so far we are like we passed by um of one hour mark everything is clear. Oh my god, that's
um you're you're going to you're going to you know spoil me here. I'm so happy. Uh yeah, like who who would thought we are doing modulus on a daily basis but we actually do it all the time. So you know perfect. Um why does modulo even matter? Um you know if we if we do not have modulus on a daily basis even like day and a night basis in in our day we will just start counting uh time in some very very
strange pattern where like in a couple of days I can say like oh it's 134 hours here and my colleague in India would say it's 137.5 hours uh there or like my colleagues in US they would say like it's 128 hours so like it's it's things are not simplified right so it's um if we have modulus we will stay within finite range it's not going to burst out so can you can you even imagine what how would that strange be like if we have calculated the time
like all the hours from the beginning or not uh or not even having months months is also a good example of modulus because there are 12 months in a year. So if we didn't have that like why would you have even why would you even have years it would just start repeating like it's it would be like 168 months or something like that. And uh the good example of doing moduses is when um when someone tells you like my kid is I don't know 18 months old and then they're just like counting like okay like it's a year and a half because it's easier for me to you know uh calculate
in years than like months or like because I can uh end up saying like oh hello I'm 360 uh months old right Like why would someone calculate that? So like I can give just information in in years and that that would be uh much easier like someone can tell like I'm 500 months old. Maybe we can have birthdays with that. Like who knows like why not? The more the marrier. Uh so yeah it's uh it keeps uh it keeps us within something that um human mind can comprehend. But with machines it's important so that we do not get uh memory overflow that we can actually
calculate that that um other machines that were we were being kept within standards so that other machines can join and uh calculate um and decrypt uh certain messages. So yeah, it's uh basically the core um do hashing and RSA and elliptic curve cryptography especially uh because uh even though you have a function of elliptic curve uh what happens is it's if you look at the function it's infinite right but u you cannot work with an infinite field um but you need to work in certain set of
fields so we will see what happens once we pass the range of modulus. Let's um try and do some quick demo. Um so what would be if uh we compute 7 * 8 and do modulus of time. So let uh I would I would just >> Yeah.
>> Six. >> Yes. But five >> and 56 and if we divide by 10 five and the rest is six. >> Yes. Exactly. Like the 18 year 18 months old kid it's like one year and six months. So if you want to calculate the rest of the months, you need to you need to use the the the year divisor. So yeah, that's the right answer.
Modulus is used to cut off certain values. So in this case 7* 8 is 56. But because we have the modus 10, anything uh above 10 is swept over including 10. that would be zero. So yeah, the answer is uh six. Bravo Maggali. What about the other one? Does someone want someone else want to take the challenge?
>> Yeah, it's uh one answer. >> Why do you think it's one? >> Um it's three uh multiplied four times. that is 81 81 divided by 5 it's um 16 16 and again it's remainder to one so that's the reason is it's one oh that that's the calculation bravo that repack has only uh picked the smart people and we love Let's try
uh next exercise. Let's try with Caesar cipher. So anyone who has uh who wrote um their their alphabet uh adjourned with numbers they will be able to um to decipher it and I will tell I will give you this one. I will just write it. What the messages chat?
This one. and we're going to use Caesar cipher with um the standard shift of three. So a becomes d etc. What can you do to um make substitution faster is to write your alphabet and then underneath the alphabet that starts with D and ends with C.
Seems like we already got some answers, the correct ones. Bravo. Someone is listening and paying attention to the class, right? Um so yeah, the solution is zero knowledge proofs are amazing and they really are. But um let's try and um and see if that's something that we we actually uh had in mind. So yes, you can you can do the reverse. Um you can decrypt using the script tool and um
yeah, so zero knowledge pros are definitely amazing. Yeah, that's true. Um you can uh play with this tool. Um so first of all it was very important for me to show you how to do it by hand so that you can understand uh what is behind um the tool but um instead of Caesar cipher you can um you can use all the other ones um yeah you can you can use the pibia square know all these kinds of um um uh encryption methods uh but um yeah it was Like you can you can even use the Enigma machine that was like unbreakable at the time that was
used in World War II um and see how it works. But um but yeah like you know try it out because why not um you already have it so you know if uh if you want to you can uh try um using your name or something and see the the different results through it. All right. Uh yeah. So uh let's try to encrypt um ZK verify with shift five um let's do that. So now it's uh it's um instead of
um using three we will use five. What does that mean? You see a becomes f and let's say let's type zk verify. This is what we'll end up. And um if we uh decrypt this one, we will end up with hello. Yeah. So it's quite uh interesting, right? Playing with ciphers.
Yeah. Uh we can use the keyword math and encrypt it with proof. So what we'll have in this example because the plain text is shorter than key uh we'll use ner cipher and we'll use math and what was the encryption was proof okay so uh what will happen in this case is that we will write proof on top of matt but because math has math is shorter than proof. We will just use P R um see uh P R O on top of math and uh we're
going to combine the two and uh we will end up with the same length of uh of the cipher text as plain text. Um that's the way um how you do it when you have um it's it's very rare uh that you have a shorter plain text than um than the key but in case you see something like that that's how you cope with that one. Okay. Uh let's go back. Um yeah, let's um guys, let's you know um have some uh chat like um I hope it's uh it's your your brain is not fried with all the uh
encryption and divisions and additions and everything else. Um but yeah like uh what do you think like which uh ciphers felt stronger that you applied? Yes. I think vision I think it's reading like that right I'm sorry I think it's a French name um uh because the other one with the frequency um analysis we can kind of understand for example in English there are a lot of e and a blah blah or like there are some patterns that we can understand but if uh with the vision we have a key that is
constantly changing ing everything. So I think it is kind of stronger than the Caesar or >> Yeah. Yeah. Yeah. Yeah. Yeah. And why is that? Because like your key is um if especially if your key is uh is huge because it uh some uh letters can repeat. Let's say okay like that's a smaller one like proof you will have double O. Uh but what would happen is that um um you know your A uh will uh your A can combine with all all of them depending on the SP depending on the place where you find them. So yeah like a will not result always in in some letters so it's less
prone to frequency analysis. It's it's a great answer. What was the most interesting one that you guys tried so far? So this I was not aware um in Verifer at the short the length of the um characters that you are encoding it remains the same post after you applied the logic. This I was not aware I was just um dealing with um it just the key text that you punch in and the same
exact it applies that is no-brainer kind of sorts of thing but the last one vigil I was not aware how exactly the key is retained and there there exactly it applies with respect to the strength how we have password strength is is how it is like strong it's weak so I guess so in earlier strike We did have this concept. Wner's cifer is um is the strongest one uh or or you can say you cannot break the password or break the cifer text or decode it very easily I guess. So I'm I'm I'm right on that or not and I'm still speculating on >> sure. So that was new for me like at
least I didn't know about this. >> Good really good reasoning. Really good reasoning. I I love it. Yeah, it's uh when you're doing shift uh you are um perfectly preserving the the frequency. The same things go with u substitution. Uh but uh with uh with substitution you need to map uh you need to find uh every uh letter to map it. For example, if you're doing frequency analysis of um shift cipher, you can just find uh the
let's say two or three most frequent letters and um and you can try and shift everything else and then you will have it quickly. But uh with substitution you need to um you need to find you need to try and do the same frequency analysis until um something um looks familiar uh some words and uh but yeah with uh uh with Vera the frequency is is um the frequency analysis would not help in that manner because like one letter is not always mapping uh to the same letter. It can
map to something else. Somebody else. Uh where do you guys see the weaknesses of this >> enoding is okay like but um once um the pattern
is recognized you can decode it very well. So and then this can happen with bots or algorithm applied the once somebody or like typically in a hacking case once the hacker understand the patterns how exactly the encoding and decoding works it is like they can decode it very well or they can get the answer they can get the password crack or something like that. So main key is the pattern. How exactly that pattern or the frequency that you mentioned how how good or how easy it is to break that frequency. So the main weakness lies there only otherwise encoding decoding like once you get the key you can
readily solve the answer very well or you can get into the systems but the pattern um if it is logic is something else. Say suppose right now when we are shifting uh three three letters if I say my logic is 3 + 1 that every person will not know they will figure it out numerous patterns to check it out what exactly the closest answer numerous iterations will be done to get to the answer. So that's the reason we always say like even while storing the password don't don't keep your password very simple your birth dates or something like that that is easily crackable but have something numerous combinations of uh extra special characters and and stuff and this and that. So that's how
the frequency or the patterns are correct or is the logic that I can connect to. I'm not sure that it might be right it might be wrong but this is the logic I related to. Great. How do you wanted to say something? >> Oh, I was I was thinking that if I need to if I'm using V I don't know the name. uh probably the problem for me to choosing the key because I would think about my you know loved ones name and those kind of stuff so that if people check my life so that they can find the key really easily. I don't know if um
this stuff can use on military or something. It can have some social weakness I think. But yeah. >> Yeah. Yeah. Yeah. Yeah. Um there is uh once now that you mentioned like uh what can be a secret um there was in ancient times um skittleal used for encryption. So what is skittleal? It's like a stick. So, let me see something here from the office. Okay, this is uh this is a good example now that I found this. So, I can um let's say that this is a bit thicker and you
want to have your um message written here, but you want to go around and wrap it and it will be like in portions. So let's say you wrap it around around and when you unroll it it means nothing but if every single line that you wrapped has something and like you can write here I don't know um zero knowledge proofs here will be the z er but when you unwrap it and if you had like one roll of that paper it will end up in something that's uncomprehensible.
Uh let me show you the example of um skittle. Uh >> I think I shared on chat. Are you mentioning that one? Because I find it really interesting. [Music] >> Skittle cyro. Um it's uh it's this one. Oh, that's that's really cool, >> right? Because uh here what is the the right the key? The key is the circumference of uh of the stick. So
like we had one and then you wrap around your paper around and around but when you wrapped it out it's like stf doesn't mean anything or e r o l but uh it's you know it's if if you know the circumference it's it's easy but for anyone else like they can just like try and you know because it cannot be like something it's infinite, right? It will not be uh practical to use. But uh but yeah, that's uh that's also one uh good example of um of ciphers that we use.
Um so yeah to guys to wrap it up um cryptography of course started with ciphers and uh now it's uh uh now it's uh you know now you need to be a mathematician to to be able to you know contribute to cryptography and uh to ciphers. uh for the core building blocks we have primes and modular mythics and uh we're going to see it in um and uh in the next session and um yeah so any questions now or never
>> actually it was we need to >> thank you very much. >> Oh, >> that was really clear. >> Uh, someone want to pass something. >> I I think we could collapse all of us. Sorry. Um, maybe Alas, you can go ahead. Yeah, I just wanted to say it's a lot to study like GCD modulo the cifer text the vigner text like we we need to try some numerous iterations and check for ourselves more so it's a lot of homework for me to you can say to ponder upon to work upon so yeah by the next time we'll
certainly have some more questions onto it perfect uh Ah people trying out enigma machine cryptography is like transform you from speakable to silence. Yes you can read in text. No you cannot. Uh there is a actually um now when you said like you can't read the text you know when people have their phone and they have this um some foil that you cannot look from other sides. Um it reminded me of a case of steganography where people would um they would try to
um they would try to hide messages let's say in um in some uh picture like um something behind me and that's called um steganography. So that's uh that's something maybe you want to look it up. Uh but yeah, it's uh um it's also, you know, hiding that you're hiding something. Uh when you're just sending a text that's like um gibberish to anyone else except for you and the person who is going to receive that um they know you're that you are that's a cipher text. But if with a different case, okay. uh uh rot 13 uh yeah it's uh the
rotation for 13 characters uh let's see yeah yeah yeah yeah people can uh try yeah you can uh if you're not that savvy with coding you can uh try um even creating something with AI tools but uh we hope uh all of who are able to code uh basic um uh basic uh uh cryptography and Cyprus. Uh Pikish said, "This class is exciting. My head hurts though." I'm sorry, dude.
[Music] The encryption method can be the message sampling. That's true. That true. Uh, that's true. Um, so what do you do? You're like um taking one part of the message and you're trying to decode it and that's uh called sampling because you're taking one sample at a time. Ah. Oh my god. Yeah. New merge.
Okay, Rosio. Um, she is uh claiming here that she cheated on on some exams. Um, on Rosio using Skittle. Yes. It's like a bicycle look. Yes. Uh someone else wants to add uh something a question. Uh okay, there is uh Sunday Moses asks uh will there be a time when the two cryptography methods are combined so as to solidify the
encryption um all the time? Um so for example you would have um you can uh uh you can apply like couple of methods like uh you can apply shifting methods and then on top of that you can apply visionary cipher. So you know to try and to increase the security you can uh uh you can apply a table a map of blanks blank uh spots as well. Um, so you can have uh um let's say like uh my name is Milita and then like one blank spot that
uh adds with uh the the key but then another ones are not adding another ones are adding but that one is just a blank one. So you know it kind of confused uh whoever is trying to ease drop on that. So yeah, like all the time cryptography methods are trying to uh to be combined although um you need to be very careful uh because sometimes you can retain the same um the same uh uh vulnerabilities you had uh with uh the other cryptography methods. maybe you will retain the frequency analysis or something else and
he will be prone to that uh kind of attack. Uh but uh but yeah like you need to you need to know um you need to know uh uh uh you need to be good in um in statistics to be able to to know how to combine the two methods. So the general weakness would be that if we have all the pieces of the puzzle, we can put together the message. Um this is interesting thing because there are like
um some um concepts as secret sharing as well that only the people who are um who can uh um if they contribute together the the secret can be in place otherwise um they cannot uh decrypt it. Uh yeah that is the the key steganography exactly like that almost why monoscript uh question the most important thing is to understand these basic concepts there's no need to go into depth if your goal is to become zk dev right um it's
uh it's a good start to you know fall in love in cryptography right with cryptography. So it's um it's it's a nice place uh because you will see how statistics work. You will see um you know how cryptography is changing the input text. You will see later uh what is the hash uh how we can use it. what is that used for? And um I think like um all these things that we are paying attention to, it's going to help us in other concepts later. So um for example
with modulus it's better to uh it's better to explain it with something that's simpler than uh on a you know straight to a zk um in into some zk specific case. Thank you. Thank you. Uh yeah the teacher is is problematic right that you the one that you are writing
exam help for uh uh if we made the visionary key as long as the internal message never reused it. Would that actually be unbreakable? Hm. Uh in my opinion is uh what I what I remember is um yes you would the longer the key you have it will it will have the less repetitions but um you need you need to make uh that uh key. Um so we we will we'll you know uh talk about randomness as well. What is
pseudo randomness? What is uh actual randomness? So let's say that um you can take um you know for your key you can take a Bible for example like the whole Bible you can take it for as a key for example because it's a it's a big book but uh then you are using the words that repeat themselves but um if you are using like one huge key and um the problem with uh with that is that You know, you need to send that key as well, but and it's going to be impractical.
Um it kind of reminded me like one time pad like um it is like still I believe they're using in military where you randomly create a huge key uh as long as the text size and I remember in our security classes they told me like oh it's kind of like unbreakable literally um you know secure but I'm I I don't know the details so I wanted to share with the chat but [Music] >> uh yeah it's um depends how do you pick uh randomness of the key. So true
randomness it's difficult if we try to generate it uh using machines and so there are like uh rooms let's say uh where there are picking up on very very random events uh like changing the slight changing in temperature of the room or changing in light um and uh in the room Um and this is how it goes. Um some visitors um they want they want to see it and like they are contributing to randomness. I don't know if you guys have ever used moving of your mouse to
create something uh some some randomness but that's that's how it is. So that is like true randomness can come from uh uh that can come from events that cannot be predicted as day and night like falling in temperature versus rising in temperature. Uh but yeah it's um yeah that's the exact room. Oh yeah you see people uh people are like uh really really savvy about zero not proof and cryptography. So yeah that is how the the true randomness can be created. Um any kind of randomness that we create um using our computers or any kind of other
machines they are producing randomness based on functions that are um written by by people who said like okay this can satisfy the randomness. Yeah. Okay. Uh guys, I have Are there some other questions? >> It looks okay. I don't know.
>> Yeah. Yeah. Yeah. Yeah. Nice. Ju just to to have it clear the the weakness between all these kind of cipher systems is that you have to share also the the key right? >> Yeah. That's that's a vulnerability. Yeah. >> Yes. If we are if we are let's say we have um symmetric encryption how would how would you and I you know exchange some messages like the only way is to see each other in person and like write it in a piece of paper or just remember
it. um especially if it's um if it's something like say like visionary cipher that can be as long as the messages and we're going to crypt it once and like throw it away. Um yes, it's going to be like the probability of that being breakable is small really really like negligible. Uh but yeah like um the problem is with the exchanging of that type uh keys uh encoding decoding and encryption uh decryption. Yes. Uh yeah that's the same encoding decoding encryption. It in our
lingo that's the same. Is there a way to encrypt our key in our encrypted uh text? Um yeah, but how will you decrypt it? I think we're clear. Um, right.
It was really amazing. Such an really like literally it is two hours long, but I didn't even felt it. So, it was amazing. I I'm glad you guys liked it. >> I saw a couple of tweets. I >> It was super amazing. I want to thank you. Uh everything was clear and easy to understand and I don't know how to say thank you. >> Yeah, thank you very much. >> I will put the recording uh on YouTube uh just after the session. Um so everything will be on Google classroom uh on telegram as well and also normally
you will receive an email like with um everything you need to know. Yeah. So all good. Thanks a lot Melissa for the session. Um so yes Ma will be your main teacher. You will see her a lot. Nice. >> Yeah. from the the different sides of the globe. I guess >> actually you are in Italy. >> Yeah, right now I'm in our Milan office. Uh we are launching mainet. So our engineers are still there.
>> Good luck with everything then. Nice. >> All right. So see you on Wednesday. >> Okay. Thanks. >> Perfect. Thanks again. >> Bye. Bye-bye. Take care.