Hey there friends, how's it going? My name is Kevin and today we're playing some more AI dungeon Where we'll all experience a little bit of pain Some more than others. Okay, so I think this time I'm using a better AI I upgraded to premium, but it's not really told me anything It supposedly gives you better AI, but it's kind of confusing. Right. Let's get started All right We're gonna go with mystery this time and I will be the detective and your character's name Jim Pickens Let's go. You were Jim Pickens.  You enter the forest where you believe the criminal you're searching for fled to Suddenly you hear a twang and feel an impact in your back You turn around and realize that you've been shot by an arrow very dramatic if you ask me Ease the arrow We're back to this arrow is made of plastic so it doesn't hurt too much going down It still tastes terrible say ah just like mama used to make it Jim Pickens says I'm dying Jim Pickens says cops don't die They just get re-killed Jim Pickens says where am I I feel like that arrow may have done more damage than we expected it to do Jim would then say oh, I'm inside myself now. I can remove that arrow Unfortunately when you approach the arrow to pull it out it falls deeper into Jim Pickens As you wander your dilemma the sun sets and you were struck with inspiration You realize that the arrow is not an arrow But in fact a pointy arrow like people use in thumbnails pointing directly at the treasure I just realized why am I wearing my headphones? I there's literally no sound like nothing. I'll just put these down Don't kind of make it without them though Do you think I'll get demonetized for nudity you were overwhelmed excitement and rush home to research it further You rush out the door extend your wife It was a clue now I know where that treasure is buried say who knew the real treasure was inside me all along Classic twist your wife is confused. I'm not I'm not surprised It was an awkward line to read you rush into the library and decide to research the treasure further Hmm it says here the treasure is either gold or stomach acid The book says that the arrow or harpoon as it is referred to in the novel points towards to treasure It also mentions how it was used by sailors to catch food Specifically whales what so the arrow that he ate is actually a harpoon and the book is like it's pointed towards the treasure But I already saw it's pointed towards the treasure the only information it gave me that it was also used to catch food Specifically whales, and I'm not sure what to make of that. I'm perfect I can use this to catch my enemy Toby Dick a distant relative of Moby Dick to avoid copyright issues He's just saying this all allowed to himself on a loud and strict safe mode. What is the name? Well, then I guess it's Tony Richard.  This is dangerous. I'm over 18 Should I get my mom's permission? Oh, and I am on the good AI. Okay. I figured it out by accident So far I got to say this AI does seem better I'm not immune. Yes, you are. No, I'm not you just wet yourself. It's not saying much, but there is an improvement there You say I'm perfect. I can use this to catch my enemy Toby Dick a distant relative of Moby Dick to avoid copyright issues You go to a pet store and buy a large fish bowl We're still talking about whales here, aren't we because that's gonna have to be a really big fish bowl You go to the pet store and buy a large fish bowl and fill it with water at the lake You fill it with water and one large fish wait, so I filled with water I guess then I suppose I filled with water and went wait if I'm going to the lake It's gonna be hard when it's already full to drive there, so I'll empty it and then fill it at the lake All right, it all makes sense. You just got to fill in the blanks This is a story for high IQ intellectuals and there's some things that won't make sense unless you fill in the gaps do set the water on fire Fill in the gaps the fish begins to sizzle in the water as it filled with fire It struggles to survive, but you manage to drop it into the fish bowl tank. What? Okay, I'm struggling to fill in the gaps here. Oh wait. No, that might be a dangerous sentence and eat your enemy Toby That'll have to do I'm afraid. I'm too scared to where this might go You enjoy eating your enemy your seedy past has now come to an end and your life has changed for the better What are the treasure inside? Okay? I guess that was a side quest.  Let's go get that treasure you get in your car and drive to the town closest to where you buried it But it's still inside of me you drive as fast you can to location, but it is night And you are very bad at navigating hmm. Maybe I should take a bus to get inside me instead of driving again We're in dangerous water is here just the phrasing alone you get on the bus and exit at yourself Okay, I'm here. I'm inside me you enter a building with many floors You reach the floor your parent is in and begin climbing up the stairs to your apartment say my stomach is quite spacious to fit An entire apartment block inside you enter your apartment and find it very clean you start digging But only find a few bones. This is wrong.  You begin to jiggle and morph into Jake Gyllenhaal over the course of 18 hours I had to one up him didn't I I couldn't just let him have this he did some super impressive and I'm just like yeah You want to see what I can do Brendan Frazier is delighted to see his buddy Jake Gyllenhaal They start to make a buddy comedy together But you do a clarity the film is titled nachos and burritos and only last 1.5 hours at most what all right, you know what this is going nowhere Brendan Frazier is finally at peace and released from his earthly bonds This is all he had to do He just couldn't move on until he made a buddy comedy called nachos and burritos with Jake Gyllenhaal He now resides on the moon with the rest of the dead actors. Jesus. Are they all up there? So that's why we call them stars because they're all up in the sky on the moon For some reason I like how the game congratulated me as well Anyway back to the treasure in my stomach Jim Pickens says He's getting distracted on all these other quests. It's like me playing Zelda I'm trying to have one thing done and it just keeps escalating and escalating till I'm doing something else in a totally different region You open up your belly with a knife. Oh my god if you can just walk in there Why you opening with a knife you begin rummaging around your intestines it feels in these sharp Which pricks your fingers you have found the treasure take the golden chest from your stomach and set it on the table It says hello friend. Would you like to learn about triple stars?  What is it? What is it? I'm just gonna say yes. Tell me more as you read the book you realize I Thought it was telling me all right as you read the book you realize you've learned all there is to know about triple stars My god, what are triple stars? Let me explain to you what triple stars there Now I might actually explain it. I want to know where it's going with this You explain in great detail what a triple star is congratulations. You've completed the story cre- What is a triple star? Jim Pickens decides to retire at the peak of his career going out with a bang Brendan Fraser gets arrested for breaking into a pet shop and stealing a fish. He was sentenced to death Did he die already? But yeah, he did. You're supposed to be on the moon Brendan What are you doing down here stealing fish? I doesn't know what to say. I Wonder why all right do attend Brendan Fraser's funeral, which is doubling as your birthday party to save on costs Jake gillian holds his back sings a song of Brendan's honor Brendan was my friend. I Have many friends But Brendan was my friend my friend my friend I'm sorry. That was just beautiful Do join in the singing I just it's so beautiful, you know I don't want to steal his limelight or anything well, maybe a little bit But I just feel like now is a good time to impress him and also honor Brendan You all finish the song in harmony You enjoyed singing with your friends and your voice surprised you you think you might have a career in singing All right, here's my moment sing Brendan's death song by the red hot chili peppers It's very fitting and yes, that is an actual song. You enjoy singing to yourself You enjoy singing more than acting you wish you would try it sooner He's not an actor the end you achieved the best ending God. I wonder what the worst one was I think that's a good point for him to end his story if that even qualifies as a story I don't know what's going on there. What's survival into your character's name Turric generating story Is this just gonna try and make me live?  I'm hoping he has speech maxed. Please have speech maxed.  Just give it to me. Come on, dude I'm the protagonist the goblin looks at you with a confused expression Say please give me the sword I'm trying to win this adventure through manners You offer the goblin a kiss on the cheek for his sword the goblin gives you his rusty sword Confiscate all of their weapons is contraband. I think they'll go along with this They're used to living in a civilized society. You confiscate the goblin's weapons. The goblins are running away Is that a victory? All right earlier, I got a mythic scroll when I when the first guy gave me a sword So I'm gonna try and use it whatever it does you use the mythic scroll you draw the knife and set stabbing at the goblins You kill 27 goblins. They're fleeing. This is against the Geneva Convention. Oh my god. I confiscated all My god, I confiscated all their weapons And then I used the mythic scroll but then just took out my knife and started stabbing them I don't know if this will work, but I'm putting in do be tried for war crimes What achievement to earn so that's where my bed sheet went what you be tried for war crimes you draw your life and stab a goblin What just during the court that the jury's not gonna like that the blade goes into the goblin's chest You kill one more the goblin's surrounding and said to beat you with their clubs.  Oh, I see. I'm dead I was sentenced to death. Well, guess I'll be out on the moon with Brendan Fraser and all the other actors I don't know if this will allow me continue, but I'm trying to say well now that I'm dead I'm on the moon with actors such as Brendan Fraser. I don't think this this one Allows me to just force the story in one direction do put on my space suit and have some moon cheese with Brendan Fraser Death takes no bribes. Benjamin Franklin. Okay. Can I not is it not allowing me to do anything am I dead? Yeah, I think I think I'm dead. That is sad. I wanted to have moon cheese with Brendan Fraser Wait, there's a multiplayer or multiplayer mansion. All right multiplayer. I am the protagonist I'm just forcing my way to be the protagonist. What does the protagonist say? I am the baddie Taking inspiration from Stuart Little in my previous stories as the others begin to scream you find yourself transforming into a completely different person Transform into call me Kevin. I don't think this is multiplayer. You know, I think this is just a lie It's like yeah, you're playing with people. Hope you're having fun Wow, everyone likes you the sheet adventures revealed to be the bodies of your friends You sit on a dusty couch and fantastically right at the screenplay to the strangest adventures of them all Right about a character called Jim Pickens who finds treasure inside himself This is getting a bit too meta now. The next few days are a blur You have a vague idea that you were involved in the creation of something called the dark carnival But it's all pretty hazy the dark carnival will be cancelled by the school if we don't raise enough money through the glee club I have a feeling like the protagonist struggles to focus which is again a bit too meta for me After the haze clears from your mind, you remember what happened last time you stop taking your medication Oh, even the game is like dude.  There's only one song that can generate enough hype for the crowd This is my moment. I'm committing.  He was my friend was my friend was my friend I think that was the words. I don't know. I can't remember. It's not the catchiest of songs You bow as the crowd goes wild Your career as a musician was short-lived but now the dark carnival can take place and bring an end to humanity God, it's amazing. We funded this entire thing like the end of humanity through glee club Hey, I doesn't know what to say. It's the end and just like that the stories are over I'm sure you are fast asleep now whether no matter what time of the day it is. Thank you so much for watching I appreciate you and I hope to see you next time. Bye for now


desk. I cannot do it on the board because with 64 bits it's not easy. So I've made up this other four-bit block cipher which is just passing out now. So you should see this. Everyone have a copy? Let's just explain how to read it first, just the first part, the example block cipher. This table, so I've made up a cipher and all the cipher does, remember, is take some plain text and produces some cipher text given a key. Okay, let's go through our example so we can move on to the last topic on block ciphers. Here's a cipher that takes a 4-bit input plain text and produces a 4-bit cipher text output and it takes a 2-bit key. Okay, block cipher. What I've done in this table is shown you the values of the cipher text for given key values. So with a 2-bit key there are four possible keys, 0 0 0 1 1 0 1 1 and in this cipher when we encrypt for example plain text 0 0 0 0 with key 0 0 the output will be 0 1 1 0. That's how to read this table. Here's the plain text, choose the key and we get the corresponding cipher text and of course we can decrypt as well using this information. So that's our example cipher. Instead of using real desks or even simplified desks we're going to use this one to demonstrate why the double desks or in general it's not just double desks, it's this concept of applying a block cipher two times. It's not any better or not much better than applying it just once because of the meat in the middle attack. So let's show how it works. And the setup for this meat in the middle attack is that what's in the table is just the single version of the cipher. The double version is that we encrypt our plain text, we get some output x, then we encrypt that value x with a different key or another key k2 and then we get our cipher text which is our final output. So that's the double version of this cipher. And what the attacker is going to do is try and guess the key. That's the goal. The attacker if in the single version the brute force attack how many attempts? Single version, brute force, maximum number of attempts. Easy. We just need to try four keys okay. This cipher has only got four keys so brute force in either case is easy but just to show the concept. So for a meat in the middle attack for it to work it requires the attacker to have some plain text cipher text pairs known in advance and I've given them two here. So we assume the attacker knows these two pairs. So the first pair plain text 1101, cipher text 1100. They don't know the key. Their goal is to find the key that produced it. Their goal is to find the value of k1 and k2 because when we encrypt we use four bits for our key in the double version. They also know a second pair. We'll use that later. Let's illustrate what the attacker will do to find out the key. Let me find my example. The first step and you can do it. What the attacker does, so consider the first pair and the attacker does a brute force attack on the known value of the plain text. So encrypt the plain text in the first pair. So we're going to do step one. Encrypt PA using all values of the key. In our case we don't have 2 to the power of 56. We have 2 to the power of 2 values. So encrypt this is PA here. This is CA. Encrypt 1101 with all values of the key and see what values you get. So try it. It should be easy and if I can work out how to write I'll follow it on here. So you take your first value and encrypt with all the keys. So k1, remember in our double cipher we use two keys, two two bit keys. Let's call them k1 and k2. So we take our plain text and encrypt using all four keys and see what the ciphertext is. What's the first value? So the output will be the ciphertext, actually CX. Let's get rid of that. I've gone through this example many times but I seem to lose my notes. So we'll try and record what we're doing. What's the value of the first value of X? That's our X. We encrypt PA equals 1101 with key zero. What's the output? So write them all down. And the next one, that's the first step. And then we do it from the other direction. We take the known ciphertext and decrypt using all possible key values. So how many operations so far? We count encrypt and decrypt operations as the same. So four operations or two to the power of two in this case. Two to the power of the number of bits in the key. Now do the same but start with CA, the corresponding ciphertext value and decrypt using all possible keys. See what you get. You try it. Obviously if I don't remember the answers. Corresponding ciphertext is 1100. So the attacker knows that ciphertext and then try the keys. I'll go backwards. We take the ciphertext 1100 and decrypt using key 00. What do you get? Take the ciphertext and using the table above decrypt 0100 and then do it for the other four keys. Other three keys. So you look up in the table to decrypt the ciphertext 1100, key 00. So look in this column, find 1100 which is here and to decrypt our plaintext will be 0100. So ciphertext key gives us the corresponding plaintext. So decryption stage. Do that for the four keys. So we get four more values of x. Which ones match? Now look at the ones that match. 10000 doesn't match with one of the other ones. No. 10010. Yes. 0100. Yes. And 113 possible pairs. So let's note those values. So possible keys we have now k1 and k2. The first pair where we got x1010, the key was of k1 was 01. And k2 was 11 here. And then do it for the other pairs. 10000 and 1110. So how many possible pairs do we have at the start? How many possible keys are there in total? There are 16 possible keys. Because we've got k1 and k2. There are four bits. There are 16 possible values. What we do is we find all these values of x, the brute force on the plaintext. And then do the opposite, or the operation, the decryption on the other, the output ciphertext. And with our double encryption, this value in the middle, if we encrypt our plaintext with k1, we get x. Similarly, if we decrypt ciphertext with k2, we should get the same x. So if we get the same x on both sides, then that suggests or that indicates that the k1 and k2 that we used are possibly the correct key. If we do not get the same x, then it means for sure that k1 and k2 are not the key. We got three possible keys in our case, k1, k2. So the key now, the attacker has cut it down from 16 possible values to three possible values. The key is either 0111, 100, or 1110. So from 16 possible keys, the attackers reduced it to three possible keys. What do they do now? We want to know the exact key. Perform another thing. You're correct? Correct. Perform the same steps using just this set of keys on the other pair of plaintext and ciphertext. Remember in the question there's two pairs known. The attacker, we assumed at the start, knew this pair of plaintext ciphertext and this pair of plaintext ciphertext. And that they have been generated using the same key. That is, this plaintext was encrypted using k1, k2, and we produced this ciphertext. We don't know what values of k1 and k2. That's what we're trying to find. Similar, this plaintext 1001 was encrypted with k1 and k2, the same as what was used here, and produced this ciphertext. So we've got three potential values of k1 and k2. Let's test them on this pair and see what we get. Try them. So you can try, encrypt that plaintext with your first potential value of k1 and k2 and check if you get the corresponding ciphertext. If you don't, you know it's definitely not the key. So try and encrypt using first this pair, and then this pair, and then this pair. Where you're encrypting p, let's say pb in this case, which is the value given in the handouts. What was pb? 1001. So encrypt pb with k1 equal to 01 and you get, if you encrypt 1001 get it as an output, the x value, 0000. And then encrypt that 40 again with k2. And what do you get? 0010. Try it for the other two pairs as well. So this, the first column is x and then c. Anyone get the answer? What's the key? It looks good. See if you can find the key, the final answer. So this is easier, this step. Just take pb and apply the double cipher using this pair. So pb encrypted with 01 gives 0000 and now encrypt this 0000 with 11 and you get 0010. So this is the value of x, the intermediate value, this is the final value of c. Does this match the expected value? No, it doesn't. So we know in fact because this doesn't match the expected value, the expected value, the expected value, we know it must produce 1101. If we encrypt 1001, we must get 1101 as the output. If we don't, we know that that key pair is wrong so we can discard that one. That one didn't work. So do it for the next one. Encrypt our pb with 10, k of 10, we get the output and then encrypt with k of 00 and we get the ciphertext. Is it correct? No, we're out of luck or in luck in fact because we're sure that last one will. Encrypt pb with 11, you get 0111 and then encrypt 0111 with 10 and you get 1101, which matches the value we know. This must be the key. We've found the value of the key now. We only had three possible pairs. We're sure that the first two are not correct because they don't give us the correct ciphertext and because the last one does, we know for sure that this is the key that the normal user used to produce those plaintext ciphertext pairs. So we've discovered their key. Count the number of operations we needed to discover that key. It's not a good example because it's just as many as we did a full brute force. Which one? Which step here? You can do this last step in different ways. You can encrypt the plaintext using the keys and you should get the corresponding ciphertext or you can go backwards, you could decrypt and you should get the corresponding plaintext or you can get them the matching x value in the middle. Yes. So in the first step, in our case, we've got three possible pairs. If we only got one, then we're lucky. We've found the key immediately. So if there was only one pair here that matched, then that indicates for sure what the key is. That's even better. Sometimes you'll get one, sometimes you'll get more than one. If you get more than one, then now you need to cut down of those possible keys which one is correct. So you needed that second pair of plaintext ciphertext. In some rare cases, there may be more than one here. There may be two possible that match and you just do it again with a third pair of plaintext ciphertext. But the probability of matching more than one reduces significantly. It turns out when you have much larger numbers that in most cases in the first instance there would be just one match because you have two to the power of 56 keys. You have two to the power of 56 values here and the possible number of values here are two to the power of 64 because you've got a 64 bit block. So the chance that one of them, more than one pair matches is quite low. So when you drop the full desk, it's even better. You usually find it in the first case. If not, you try another pair. Everyone can break double desk. Any problems? Let's hope so for the exam sake. In this case we had to, in fact we do four operations, another four operations, eight and then, in fact, how many we do here? Another six operations here. We were unlucky in that we had three that matched because we had, I had to do an encrypt, a decrypt, encrypt, encrypt, encrypt, encrypt and there's only the last one that matched. It was the first one and the other, well, we still have six I think in that case. In this case we had a total of, what, four plus four plus another six which is 14 operations. The worst case we'd need if we did a full brute force would be 16. We've saved two in this case. But in most cases, if we expand this to not two bit keys but 56 bit keys, we do two to the power of 56 operations in this step, two to the power of 56 operations in this step and then the ones that match is usually one, maybe 10, 15, another 15 operations is minimal, almost zero. Compared to two to the power of 56, if we have to do, if we get three matching here, that's easy to do. If we get 1,000 matching here, it's still easy to do compared to two to the power of 56 operations. So approximately we need to do two to the power of K, operations here, where K is the number of bits in the key. We did two to the power of two. In desk you'd need two to the power of 56 and then another two to the power of K, for example, two to the power of 56. Whereas single desk you just do it once. In double desk you effectively do it twice to break the key. It takes twice as long to break the key in double desk but that's not secure. If something is insecure at some speed, then another cypher takes twice as long, then we consider twice as long as no big deal. Because we just spend twice as much money and we can still break the cypher because we get two times the powerful computer. So if something's secure at this level, twice the time to break generally is not considered any more secure. A thousand times more time to break or a million times is secure but twice is not secure. So if you can break single desk, you can break double desk. That's the outcome here. Sometimes you need to do multiple steps here. Sometimes you're lucky and you just get one matching. Sometimes you're very unlucky and you may get, of these three, two are correct. So you need to try another pair. In real desk you take very little effort this last step here. You'll see in exams, break double desk. Any questions on how to do it? And that attack is called a meet in the middle attack. Because we encrypt from one side and get the value of x and then we come from the other direction, we decrypt and get the same value of x. We meet in the middle of that double desk. The end result, it's about twice as hard as single desk, which is not so useful. So, extend it to triple desk. Use three operations instead of just two. And that problem disappears, or at least becomes much harder because if we know a plain text, we can go in this direction and get a. If we know the corresponding ciphertext we can go in this direction and get b, but a and b are not the same. In double desk we get the same value of x, and that's how we find the key. But with three operations, we can go from p and try the brute force on k1 and get all the values of a, but they will not be the same necessarily as the values of b. So it does not tell us the key if we go in the middle attack. So triple desk is used in practice. Note that it's used in a slightly different way than what we've seen. It's used, you apply, there's different ways. These diagrams use just two keys. K1 and K2. K1 is used twice. So in fact it's a 112 bit key. K1 and K2, 56 bits each. There's another version not shown here that use three keys. K1, K2, K3 gives you 168 bits. 112 is considered okay in terms of security against brute force attack. We saw that 100 bits in 15 years from just before the break would take too much to break. So 112 is even better. But if you want stronger, 168 bits. And note also they don't do encrypt, encrypt, encrypt, they use the decrypt operation. Encrypt, decrypt, encrypt. It's just a way to make the implementation easier with single desk. You can see here. If you use, if we use this triple desk, where we encrypt, so we use the encrypt form of desk using K1 and then use the decrypt form of desk using K2 and then back to encrypt form. So that's triple desk. If we use the same value of K, that is K1, K1, K1, then it reverts back to normal desk because we see here, if we encrypt the plain text with K1, we get ciphertext. If we decrypt that ciphertext with the same K1, we'll get the original plain text. And if we encrypt that plain text with K1, we get some ciphertext. The idea is that we have triple desk. If we want to use triple desk, use two different keys or even three different keys here. With the same code or the same hardware, to get back to the original single desk, just use the same value of the key here. So someone has an implementation of triple desk. You can use that to perform single desk by just using the same values of the key K1, K1, K1. And you will encrypt your plain text and you'll get the same as if you encrypted just one operation. Just a bit easier in terms of distributing the hardware on software. Because you will not be able to revert back to single desk. That is, let's assume my piece of software implementing triple desk implements as shown here. Then what I do, so I've got a piece of software that does triple desk, three desk. Then if I want to use triple desk, I take my plain text, 64 bits and I supply a 112 bit key. And the software will split that 112 bit key into two values, K1 and K2. And it will use K1 to encrypt the plain text and then take the output and decrypt it using K2 and then K1 again. Or, so option one, I supply a 112 bit key. Option two, I can even supply a 168 bit key. And in that case it would use K1, K2, K3. I'd split that 168 bits into three different Ks. Both of them are considered triple desk. Option three, I supply a 56 bit key. These are two different variations of triple desk. This returns our cypher back to single desk, normal desk. Because what my code does, it takes that 56 bit key and just repeats it here. K1, K1, K1. And because of this sequence of encrypt, decrypt, encrypt, we have encrypt the plain text with K1 and then decrypt it with K1 and you get the original plain text back. So in fact, the first two steps we do nothing. Encrypt and then decrypt, you're back to P. So B equals P. And then encrypt with K1, which is just a single instance of single desk. So it's just a way to use the same code to implement single desk or triple desk and back triple desk using two different key lengths.  So if someone sends you some plain text or some cypher text, if it's in single desk, you use this code and pass in a 56 bit key. If it's in triple desk, then you pass in one of the two keys which has been accrued upon and it will decrypt correctly. So it's just a convenience to combine everything into one. If you had encrypt, encrypt, encrypt, it would not work for single desk. You can try it. You'd have to have another implementation of single desk. It's not for security, it's for convenience of distributing and using the code. We've got one or two more example. Other ciphers takes us two to three minutes. Any questions before we move on to that? Quiz was easy. That finishes with desk and triple desk. Triple desk is used today. It's available. One of the reasons to use desk and to expand it to triple desk is because it was a government standard in the U.S. Originally desk was a standard which meant that if you wanted to do business with the U.S. government and you wanted to encrypt, you had to encrypt your data, then in the past years you had to use desk to encrypt your data. It was supported. It was the only one supported or the main one supported by the U.S. government and therefore it became popular. So it made sense to make use of the same algorithm and triple desk has been used as well. The problem with triple desk is that it's three times as slow as single desk because we're doing the operation three times. And single desk wasn't very fast compared to some ciphers. So the performance is not so good. So people have come up with other standards and other ciphers. So the same organization that developed or standardized desk, they used triple desk but they wanted to find a faster cipher which is just as secure. And they started to call for designs. So ask researchers and companies for designs of new ciphers in 1997. Eventually some were submitted. So there was some competition. You submit your cipher and people evaluated it. And one called Rindale was chosen and that was standardized as what's called AES, the Advanced Encryption Standard. And that's very common now. We're not going to go through the details of AES. We're just going to use desk as their example. There's some similar concepts. It uses S-Boxes, X-Ord, multiple rounds. Has a 128-bit block size. In fact supports other sizes. Supports different key sizes. 128-bit is the minimum and then higher. And depending upon the key length between 10 and 14 rounds. And in each round different operations like X-Ords, S-Boxes and some different arithmetic to do some operations on the inputs and output. It's widely used now. AES, many of the hardware or file encryption systems will use AES, Advanced Encryption Standard. Many network communications protocols when you encrypt data across say a wireless network you can use AES. And it's generally considered secure. Both the algorithm no known attacks and the key length is sufficient. So that's a common one in use today. We're not going to go through the details. There's a, for teaching there's a simplified AES. You can see in the textbook but we'll not go through that. And there are other block ciphers. Maybe not as common but still available to use. Blowfish, Toofish, Idea, Skipjack and others. They have their advantages and disadvantages. Mainly they're considered secure but the advantages come mainly in terms of performance. Okay, how fast does your code execute to encrypt something? Openness That is, can you use that cipher without having to pay a license to use it? Can you include it in your piece of hardware without having to get a license? Because of patents and so on. So if you want to build your own wireless router and sell it and you want to encrypt the traffic then you need to make sure you use a cipher that is either open or unlicensed, free to use, or you need to pay a license to use a cipher. So that's another issue. Which encryption has been used on a cipher text? In practice some would be detected based upon similar to some software can detect file types based on the structure. But generally you can try if you encrypt something with des and you get some output and try to decrypt with AES it will give you an error. It will show that it cannot decrypt. Because most likely there's not just the cipher text but some extra information that identifies how long it is maybe sometimes what algorithm was used so that you can check whether the cipher text is correct or not. So it depends on the software that's encrypted. In most software I think you could be able to detect what cipher was used. Because the software would attach information to that file or that information and you'll receive the cipher name and the cipher text. But in theory no, it's just a sequence of bits. Cipher text is just a sequence of bits. Because in theory the cipher text is a random sequence of bits so all of the ciphers should produce a random sequence of bits. How do you know which one produced it from the cipher text? You cannot. In practice it's possible in some cases. Done. Block ciphers. What's next? AES uses a block of 128 bits. DES uses a block of 64 bits. The others are similar. I've got a one megabyte file. What do I do? How do I use AES or DES? They only encrypt 64 bits or 128 bits. I've got a one megabyte file. How do I encrypt that with DES? Break the file into smaller 128 or 64 bit chunks and then encrypt each chunk of 64 bits using the same key at a time. What's the problem? The performance is not a problem. We have to encrypt it. We cannot avoid it. So performance is not an issue. I've got a one megabyte file. Let's say I break it. I don't care how big it is. I break it into a million blocks of 64 bits. So 64 million bits at the start. 8 megabytes. I've got a million blocks of 64 bits. So I encrypt the first block with DES using my key. Then I encrypt the second block with DES and get some ciphertext using the same key. So we get one million blocks of ciphertext as the output. Any problem? Repetitions. If there was repetitions in the input plaintext, that file had some parts which repeat inside it. Then there will be repetitions in the output ciphertext when we join them all together. Because if we encrypt one block of 64 bits, we'll get ciphertext. If we encrypt the same block some time later, we've got the same input plaintext, we'll get the same ciphertext as the output. So if we have many blocks on the input and we just encrypt and then combine or concatenate, there's the chance of repetitions on the output. Two repetitions in the output is bad. We want randomness in the output, not structure. So the next topic is how to encrypt a larger piece of input, the different modes of operation. The way to encrypt multiple blocks and combine the ciphertext, they're called modes of operation for block ciphers, block cipher operation. There are different modes, why can't you see that? I can. Different block cipher modes of operation. We're going to go through a few of them, maybe the most common ones. There are others as well. We'll let's see in the next 30 minutes we'll get through two or three and some examples. So it's this concept as we've got a large piece of plaintext, we break it into blocks. The block size depends upon their cipher, so these modes of operation are not just for desks. They can be applied in general to any cipher. So we're not limited to desks now. We encrypt b bits at a time where b is the block size. There are different ways to do it. First one is what we just said. It's called electronic codebook. We break it into blocks, encrypt each block, get the ciphertext, and the resulting ciphertext is just a concatenation of the ciphertext blocks. Describe here. The input is plaintext p. We break it into n blocks. If we had 64,000 bits, 64 bit blocks, we'd have a thousand blocks. So a 64 bit block, the next 64 bit block, and we keep going to the end. So p1 to pn is our plaintext broken into blocks. And we quite simply apply our cipher, our block cipher, desk, AES, whatever, encrypt using k, get a ciphertext block, encrypt the next block of plaintext with the same k, the same key, get c2, keep going, get cn. The resulting ciphertext is concatenation of c1 to cn. The same as the plaintext is a concatenation of p1 to pn. That's generally called electronic codebook. That's the obvious way to do it. And the obvious problem with it is that if there are repetitions in the plaintext blocks, there'll be repetitions in the ciphertext blocks, which is insecure. Decrypt, you can check the decrypt operation, the opposite. It's okay if we want to encrypt a small amount of input, because there's less chance of getting repetitions. So if you've got a 64 bit key to encrypt, then you just need to encrypt using one block. So it's okay for secure transmission of single values of small information. But not good with long messages, because we get repetitions in the ciphertext. So an alternative cipherblock chaining. We have our plaintext. We break it into blocks, p1 through to pn. We choose some initial value. It's in fact called an initialization vector, IV. But think of it as an initial value, an initialization vector. It's a vector. It's a value which is the same length as the plaintext block. For example, choose a random 64 bit value. We XOR the plaintext block and IV, and then encrypt the answer of that XOR. We get ciphertext c1. Then that ciphertext c1 becomes the value that we XOR our next plaintext block with in the next stage. And we encrypt and get c2. And then c2 feeds forward into the next stage. The difference here is that if we have two plaintext blocks which are the same p2 and p3 were the same. p2 is XORed with c1 and then encrypted. If p3 is the same, it's XORed with a different value most likely. Because c2 should be different than c1.  That's why it's better than ECB, Electronic Code Block. So we've got this chaining of the blocks. The second one depends upon the output of the first one. The third one depends upon the output of the second one. And we take the output and XOR it with a plaintext block and encrypt that value. You can work out decryption XOR is commonly used in ciphers. We've seen XOR in the internals of DES. We see it here multiple times. XOR is fast to implement. To XOR two values in hardware and software is fast. Encryption and decryption, these gray boxes are generally slow. So when it comes to performance, the slowest part is applying, for example, the DES cipher. Encrypt here means apply some cipher. DES, AES, triple DES, whichever you choose. Compared to an XOR, the encrypt or decrypt is very slow. That becomes important when we compare some of these modes of operation. Also, what's another property of XOR? When you XOR A and B, and you get C, if AXOR B gives C, how do you get A back? If you take C, if you XOR with B, what do you get? You get A back, don't you? Try. So that's the property of XOR which is useful for encryption and decryption. If you XOR two values and get C, if you take C and XOR with one of those values you get the other value back. Which is like encrypting. Or we can use XOR for encryption. Take our plain text XOR with the key. You get cipher text. That's an encrypt operation. The decrypt operation is the same XOR. Take our cipher text XOR with the same key and you'll get the plain text back. So the nice thing about XOR is that you can use it to encrypt and the corresponding decrypt operation is the same XOR operation. It's the same in both directions. So we see it quite often in here. It's fast and easy to do both operations. Does it work? It works. Okay, that's good. We'll be in problem if it didn't. So we see here we use it to encrypt and the decryption operation take the cipher text apply the decryption of your cipher same key and then XOR with IV again. Because that's the opposite of encrypt. Encrypt was XOR encrypt. Decrypt sorry, wrong way. Decrypt is decrypt XOR. We go in the inverse. We apply the inverse operations. The inverse of XOR is XOR. Let's look at one more model operation and then you can do some examples. So CBC is used to encrypt data, a common approach used. The initialization vector must be known by the sender and receiver and it should be kept secret. So it's another secret value. One more before you do some examples. Cipher feedback mode. Let's not. Let's go to an example. It looks too hard. You've got the example. Do the first two. ECB and then CBC using the table on your handout. So here's the plain text. The table is the of cipher. Use a key of 00. So everyone's the same. When you need to use an IV of 1100 you only need that in some modes of operation. So do the first two. ECB and CBC. So find the cipher text. You can do those quickly. Do it first for ECB. Encrypt the data on your handout with ECB and then do it for CBC. You do it for ECB first. Anyone got an answer for ECB? That's the easy one. I'm not going to do that. Answer ECB. 1010. ECB for the second. 1001. So that's just looking up in the table. We're using key 0. So all we do is we look, find the plain text. Find key 00. Look in the column there and you get the ciphertext as the output. What's XOR? Can anyone remind him? When they have the same bits you get 0. When the two bits are different you get 1. It's not a different. You get 1. When they're the same you get 0. OK. CBC. We can see the problem with ECB. For this example the two plain text values P1 and P3 were the same. And as a result the two ciphertext values are the same. So we see repetition in the ciphertext because there's repetition in the plain text. That's bad from a security perspective. Try for CBC. Where you take your plain text block you XOR with initialization vector and then encrypt. So try CBC and see what you get as the output ciphertext. So take our plain text block XOR with the initialization vector. I chose it to be 1 1 0 0. We get 0 0 0 0. Encrypt this using key 0 0 look up on your table and you get 0 1 1 0 as the output. That's the first value of the ciphertext C1. Then take that C1 and use it with the XOR in the second stage. That is XOR C1 with your P2. Any problems? Once you know the answer do cipherfeedback mode. CFP. So we chain together the stages using the ciphertext from the first one as an input with the XOR or the second plain text block. XOR encrypt. Take C2 up and keep going. And the last one is 0 1 1 1. What are we at? 1 0 0. And note the values of the ciphertext C1 to C4. Any of them the same? Or more importantly when there's the same plain text block do we get the same ciphertext block? Not necessarily in this case no. If we do it's just unlucky. Or it's just luck. 1 1 0 0 was the plain text P1 the corresponding block is 0 1 1 0 in the ciphertext. Here 1 1 0 0 encrypts to 0 1 1 1. So even if we have repetitions in the plain text we don't get those repetitions in the ciphertext. Making it harder for the attacker to use the ciphertext structure to get the plain text. Any questions on CBC? CFB cipher feedback mode This mode is commonly used to turn a block cipher into a stream cipher. Let's do it next time. But let's do another one first. Easy one. The last one counter mode. We'll return to the others next week. Counter mode. You start with some counter value. Let's say 0 0 0 0. Encrypt that value using your key. And then XOR with the plain text block and your ciphertext. For the next stage you increment your counter. So 0 0 0 1. Encrypt XOR with the plain text. 0 0 1 0. So just increment the counter each stage. And encrypt the counter and XOR the output of the encryption with the plain text. And once you up to 1 1 1 1 in your counter go next one back to 0. Loop the counter. No the counter is the input to the encryption. Each stage you increment the counter. Think of it. The counter in decimal is 0 1 2 3 0 1 2 3. Because we have a 4 bit. Oh no we go up to 16. A 15. Sorry. We've got 4 bits. Very easy. Note that there's no connection between stages. If we quickly go back to CBC. Stage 2 depends upon the output of stage 1. The problem with this is performance. Because when we have a large piece of plain text to encrypt the second block we must wait for the first block to be encrypted. It's similar in the other ones. The ones we skipped over. We'll see CFB is similar. The second stage depends upon the output of the first stage. In OFB the second stage depends upon the output or part of the first stage. Which means in implementation you cannot implement them in parallel. Because you must finish one stage before you start the next stage. But with the counter mode the stages are independent. So what you could do in terms of an implementation is let's say you had a quad core CPU. Then you've got 4 cores or 4 CPUs effectively. You have a counter. You know the value in advance. Because it's just 0 1 2 3 and so on. So you could do the encryption this one on one of your cores, this on another core and so on. You can only implement this in parallel. And therefore it can be much faster. Because the stages are not dependent upon the other stages. And it's considered just as secure as the others. Encrypting a counter. We know the counter. But when you encrypt it you get a random value as the output. Some cipher text. And then XOR you get the plain text. XOR with the plain text and the cipher text. Decryption is just the same. Look at the pictures. Encrypt decrypt same. Same operation to encrypt and decrypt. With decrypt encrypt the counter XOR with the cipher text. This makes use of this property of the XOR. If you encrypt with an XOR plain text XOR with some value then you can decrypt with the same XOR. Cipher text XOR with that same value gets the plain text back. So implementation wise and speed of performance. This one's very good. And just as secure as the others. What we'll do next week is we'll return to the two we skipped over with some quick examples on them. They need a bit more time to explain. And then we'll summarize on this and move on to the next topic.


Hey Gems, welcome back to my channel. So in this video, we're just touching a little bit on feminine care. What do you use on your lady part? Is it really safe to be using or should you just omit it all and just use water? As you know, I am the creator and owner of Gems Holistic, where I make handcrafted natural skincare products using natural and organic ingredients as well as providing wound wellness services, herbal teas and more. So what I really want to touch on in this video is our use of feminine washes, yoni washes. Should we really be using them? Do we really need them? And what's in your feminine wash? So as you know, I do offer a feminine wash, a yoni wash on my website. I will insert a picture somewhere on the screen. But the reason why I created a yoni wash is because I used to get a lot of questions from women asking what feminine wash they should use, what do I recommend, whatever the case may be. And to be honest, I've never used a feminine wash other than my own. Back in the day, I know a lot of women used to use Summer Eve. I think that's the name of it. And I think there's this, there's another one that was really popular. I can't remember. But I've never used it because I was raised to know that the vagina is self-cleaning and you should only really use water down there. And you should not insert anything up there, especially not soap. Because it can throw off your flora, your natural flora and your pH balance and all of that. So I never really thought about initially even making a feminine wash. But as I continued to get questions about it, I was like, you know what? Let me dig into this a little bit more and do some research. So I started doing research years ago about feminine wash. I started reading the ingredients of popular feminine washes that's out there.  It sounds like let me make my own and offer it so that since people feel they need it anyways and it does something for them, whatever that may be, at least they're using a safer version of it or the safest version they can find. So I did my research and of course, your girl, being an aspiring herbalist, had to infuse hers with herbs that's good for your yoni area, that's safe to use and all of that. That has the antibacterial properties, antiviral properties. I do offer a yoni wash, but I am here to tell y'all that you shouldn't even need one. Okay, if that makes sense, we should only really be using water down there. Now, don't get me wrong, I make a yoni wash so I use my yoni wash because as you bathe, soap runs down and it can still interfere with that area. So the yoni wash is still pretty good for washing your lower parts anyways. But I was reading, I was in the pharmacy the other day and I was, I just, something just told me, let me pick up this yoni wash and read the ingredients because it's a very popular yoni wash. It's made by a black owned company, that's pretty big. I'm not going to say the name because ain't nobody going to tell me I throwing shade at no company because I'm not, I'm not going there. I'm just here to inform my ladies, okay, that's it. But something told me, let me read the ingredients because I was just curious and I saw propylene glycol in there and I was like, oh my gosh, why would they put propylene glycol in a feminine wash? So if you're not familiar with what propylene glycol is, it's a synthetic humectant that's used in a lot of cosmetics. If you don't know what's a humectant, it's a substance that draws moisture to the skin. However, the problem with propylene glycol is that I don't want to say it's toxic, but it's toxic, okay? Yes, the FDA consider it as generally safe, but the USA approves a lot of chemicals that's really not safe. Although it's not considered toxic according to the FDA, propylene glycol has been linked to damage to the nervous, the central nervous system and found as at least a little toxic. In short, it is an alcohol and even if it's considered generally safe, I really think that it's just one of those ingredients that you should not put in a feminine wash. In a product for the most sacred part of your body, propylene glycol should not be one of the ingredients. So I'm saying not to say this, ladies, please read the ingredients of your feminine care products and make sure you research those ingredients if you don't know what it is. Always, always, always do your own research and educate yourself because it is your body, it is your temple and you should know what you're putting on it. So I know a lot of women use feminine washes because of odor issues, because of irritation. If you are having those issues as a woman, you need to take a look at what you're putting in your body and stop trying to mask it with a feminine wash. That is not going to solve the problem. Always start from internal and then move to the external. Whatever it is that's coming out of your sacred area, whatever smells or unpleasant feelings that's coming out of there, it's because of what you're putting in your body. So let's get to the root of the problem and stop using these feminine products trying to solve the issue when it's like putting a bandaid on a broken foot. It doesn't work that way. So if you do use a feminine wash right now, please go in your bathroom and look at the label and read the ingredients. If there's anything in there that you're not sure what it is or you look it up and you see any controversial information on it, don't put it on your most sacred spot. Don't use it, not on your vagina, not on your yoni, okay? And if you do have a good feminine wash, share it with other ladies so that they know what to get. And if you don't want to look any further, go to gemselistic.com and order yours today, okay? Because it is very important that you know what's in your products, especially when it's touching the most sacred part of your body. So let's do better. Let's be better. And let's take care of our body and our womb. Anyways, that's about it for this video. I hope you all found it informative. And to all of my melanated women out there watching, protect your womb by any means necessary. And to everyone watching, protect your peace by any means necessary. I wish you all love, light, and prosperity, and you'll see me in my next video. Peace.


Welcome to the fourth class on power electronics and distributed generation. So, in the last class, we started looking at the distribution systems more closely. We are looking at models of the components on the distribution system. We looked at transformer model, the line model and we are discussing the fault model. So, we looked at the value of the fault impedances that could be used in the system. So, if you have a over current of at least twice the value for the rated for the given section, then potentially protective devices can start operating. So, we are talking about fault impedances starting from a dead short corresponding to Z f equal to 0 to larger values of Z f, but it has to be a small value of Z f compared to 1 to have the appropriate level of current. So, that you could actually initiate protective devices. One thing to consider when you are looking at the fault current models in power systems and distribution system, traditional protection application, when you are talking about current levels, voltage levels, you are talking about things in RMS time frame. So, if you look at the instantaneous currents, it might be going in a sinusoidal manner. That is what your ideal voltage is a sinusoidal voltage ideally your current is a sinusoidal current and its value is going from a peak to a negative peak going through 0. But, if you look at it on a envelope basis or on a RMS basis, say if you have a fault, then on an RMS basis you could think about the current level increasing. So, when people talk about instantaneous protection in power systems basis, you are talking about 2 to 5 cycles time frame. So, you are talking about 10s of milliseconds. So, you are talking about 10 milliseconds, 20 milliseconds going up to may be 100 milliseconds and it is not the instantaneous time that the students in power electronics are typically looking at where for a power semiconductor device, you are talking about switches that can operate in micro second or in 10s of nano seconds. So, the instantaneous from the power electronics perspective and the instantaneous from the power systems perspective, one has to keep the appropriate time frame in mind when you are looking at how the systems respond. When you are talking about instantaneous trip of a circuit breaker, you are talking about 1 to 3 cycles rather than micro second level and on a instantaneous basis from the power electronics perspective, your actual waveform might be a sinusoid. Whereas, if you are looking at the on a RMS basis, you can think of it as a slowly varying quantity, which can vary on a cycle to cycle basis and depending on the RMS values, you would decide on whether to open a breaker or keep the breaker closed. So, you have to keep the time frame in mind when you are actually discussing the protection level in the systems. So, another model that we would then look at is, what would be the appropriate model for power converters in DG applications. So, the simplest power conversion device that you could have for distributed generation is actually an electric machine and quite commonly a synchronous machine is used and given the large number of genses that are out there, the synchronous machine is a important component to consider for what could be a power conditioning system or a interconnection power conversion device that is being used in DG application. .. So, if you look at a synchronous machine, you can think of it as a voltage behind the impedance model that would be considered. Again, what the impedance is depends on the time frame of analysis that you would consider and you would be familiar with terms such as your stator inductance or your d axis and your q axis impedance of the machine for salient pole machines that you would consider for your steady state analysis. If you are looking at shorter time frames, you have your transient inductances, you can have for much shorter time frames sub transient inductance. So, your transient inductance might be of the time frame of may be a second or so, your sub transient inductance could be of the order of a cycle or a couple of cycles. So, depending on the time frame you are looking at, you could look at different impedances for the machine. So, if you are looking at typical parameters for these inductances, you are talking about 1.1 per unit for Xs, you are talking about slightly larger impedance for your direct axis impedance of a synchronous machine because your pole is facing that particular axis, your quadrature axis in case of a salient pole machine would have a smaller value of impedance. But, you can see that the numbers are quite large if you are looking at it on a steady state basis. Whereas, if you look at for shorter time frames where you might what you might be looking at for false, you might be looking at smaller value of impedances in the range of say 0.2 per unit to 0.3 per unit for your transient impedance and you might be talking about 0.15 to 0.2 per unit for your sub transient impedance. So, essentially whether it is a sub transient or a transient, it depends on how deeply into the synchronous machine poles your flux is penetrating. So, for a sudden change in operation may be your flux is penetrating just at the pole shoe level and you would have time your dynamic quantities die out in a shorter time frame. Whereas, if you are looking at your damper windings etcetera, it might take longer for your transients to die down. So, you are talking about transient durations depending on the level of penetration of flux into the machine on a steady state basis you are looking at the d and q axis impedances of the machine. Another aspect that is important especially when you are looking at distributed generation applications where you are looking at not just 3 wire, but 4 wire situation is a zero sequence impedance of a machine. The zero sequence impedance of a synchronous machine can be quite small of the order of 1 percent or 0.1 per unit or it can be even smaller. Essentially if you look at standard three phase windings on because the three windings are spatially displaced, if you are applying equal currents in all the three phases which is what your zero sequence component would do then essentially the fluxes are trying to cancel each other. So, if you get very little flux with the application of current it means that your impedance is small. So, you end up with very small impedances. So, you will end up with some unusual situations for example, in a synchronous machine where your single line to ground faults or single phase faults might end up taking more current than a three phase fault. So, you end up with situations which are slightly unusual when you have situations such as this. If you look at say a induction machine which could be another component which is used as a interconnection device between your distributed generation source and the electric grid and if you look at your impedance you are talking about impedance of about 0.15 to 0.2 per unit and if you look at the value of the inductance value that is used it is essentially the leakage inductance of the machine the sum of the stator and the rotor leakage inductance. If you look at how much current would enter an induction machine when you do a direct online start common number that people would consider is you would take the 5 times the rated current as your starting current of the machine and the reason is quite simple you have 1 per unit of voltage and your leakage in inductance is what limits the current. So, that is having a value of 0.2 per unit you will end up with 5 times 5 per unit of starting current in an induction machine. So, for again for fault application when you have a fault on a short term basis the induction machine would contribute about 5 per unit fault, but again the flux in the machine would decay down. So, it will not last for a long duration of time, but your initial currents could be of this particular order of magnitude. If you look at an electronic converter based power conditioning interconnection typical power converter that is used to connect with the grid is a current regulated power converter. So, you would be doing current control to ensure the quality of current is a sinusoid you may want to ensure that the power the current that you are injecting is in phase in the voltage. So, that you get unity power factor. So, often you will have a current regulation. So, you might be able to model your converters current injection as that of a current source. However, if you look at the converters that are available today, if you have a large transient in the grid for example, the grid voltage suddenly collapses down or if there is a big surge in the grid voltage where the value of the voltage goes up many power converters would just trip and shut down. So, large transients unless you specifically design your converter to actually handle this large transients in the grid your converter would shut down, but being able to handle the large grid transients is actually emerging requirement and it is already a requirement for many applications such as wind energy where if you have low voltage in the grid you have to have a power converter which is able to ride through the low voltage. So, you have things like low voltage ride through fault zero voltage ride through fault ride through characteristics etcetera which become more and more important for power converters and again when you are talking about fault you are talking about time durations of the order of tens to hundreds of milliseconds. So, your power converter will have to be able to operate for the hundreds of milliseconds when fault has occurred in the power system and you have extreme imbalances or under voltage levels and the power converter should operate through that situation without actually shutting down. So, that it can come back into operation when once the grid gets back to normal. So, another the thing that we will consider next after considering the power conditioning devices which can be machines or power converters is what sort of protection equipment would be there on a typical distribution system. So, if you are looking at protection equipment you are looking at over voltage protection or over current protection. So, if you are looking at over voltage protection you are looking at things such as surge arrestors. So, the type of surge arrestors that you would use in your equipment depends on your distribution system. So, for example, whether your transformers are solidly grounded or impedance grounded. So, for example, if you have solidly grounded transformers it means that your neutral shift when you have a fault would be small. So, you could have lower margins for your surge arrestors whereas, if you have impedance grounding your neutral could potentially shift by a larger amount which means that your surge arrestor would need to have higher voltage margins. So, if you are looking at over current protection you are looking at devices such as fuses circuit breakers or relays and if you look at the way the protection is being would be done in such devices you would have thermal which is essentially thermal over current protection in a fuse it can be a electromagnetic. In a circuit breaker you could have digital trip units in a relay package especially newer relay packages come with quite sophisticated digital trip units. And each of these things for example, a digital trip unit has to be backward compatible with what is already there in the system. So, you cannot make your digital trip unit respond as fast as your processor can calculate, but your digital trip unit should be able to emulate the type of characteristic that is there in a thermal over current protection or the electromechanical relay. So, as to have the backward compatibility so your newer protection device should be able to operate with your older protective devices. So, that is a important aspect of power system you cannot say every fuse has to be replaced by a newer device. So, whatever newer equipment that you are bringing in has to be compatible with your equipment that is already there in the system. Again as I mentioned your instantaneous trips have to be on is actually on a RMS basis rather than on a real time instantaneous basis that we would consider or on a waveform. So, you are talking about number of cycles to trip even when you are talking about instantaneous. .. So, if you look at a fuse for a fuse you are talking about essentially thermal coordination and you are selecting your fuse based on the point at which your fuse would start melting. So, you are depending on the fuse melt curve. So, if you are looking if you are thinking about fuse operating at some nominal current levels the participation in the fuse would be such that it would not heat up to the point where it would melt. But once it goes above some critical value your fuse will melt depending on the amount of current that is causing dissipation in the fuse. So, you are looking at your melt curve to determine at what point it would melt depending on what current level is actually going through the fuse. The fuses are actually quite reliable it is low cost and reliable because there is nothing complicated where you have you do not do any sensing and evaluation of algorithm if the current is more it melts. So, it is quite simple which lends itself to reliable operation. But you have other concerns that if you have a three phase system the over current might actually cause the fuse in one phase to melt and not all three phases. So, you could have single facing of lines you could have you will not be able to ensure that all fuses simultaneously operate. So, you might end up with situations where some loads would could potentially phase problems when you are actually having fuses the only protective devices. Single facing is a concern and every time a fuse blows it has to be replaced. So, yes the replacement is a concern whereas, in a circuit breaker you have a trip you could reset it and get back to operation. Because it is low cost and quite reliable often it can be used and it is used in the end of the system where cost is very critical closer to the end of your distribution radial structure or it can be used as a backup protection. Say if you are taking a circuit breaker and you want to have backup over current protection for your breaker or a relay then you could use a fuse to provide backup protection in case your breaker is not operating. So, your fuse would not typically melt because the breaker would typically operate in case it fails you now have a backup protection. If you look at the next device which is commonly used in for over current protection it is a circuit breaker and if you look at the circuit breakers that are available there are bimetallic circuit breakers which operate on a thermal basis. You have electromagnetic circuit breakers you are many large larger size of breakers available today have electronic trip units which actually operate decide on whether the breaker should open or stay closed. So, you could have different control packages to actually operate the breaker. So, the actual breaker is a device which would make or break the current whether it is whether it should open or close is decided by your trip unit. So, if you look at the ratings of the breaker you will have both your voltage ratings. So, and your current ratings. So, your voltage rating needs to be based on your based on the voltage level at which you would operate. So, whether it is 230 volts, 415 volts, 690 volts depending on your application you would have voltage rating. The voltage at which you are expecting your breakers to operate. The other item that is important is also your isolation voltage level where essentially if you have a voltage spike coming across the circuit breaker or on from one point to your frame which might be connected to your cabinet etcetera. You also have isolation voltage level where having opened what voltage it can withstand before things are cover. So, your isolation voltage is also important parameter of your breaker. So, often for many low voltage circuits you would need isolation voltage level of at least twice your rated voltage plus some margin on a RMS basis. So, that even if you are talking about voltage level at which it would operate your ability to isolate has to be much higher than the ability at which you actually operate. If you look at your current rating the current rating of your circuit breaker there are couple of important current ratings that need to be considered. One is if you select any device what is the current at which it would typically operate. So, if you are using a circuit breaker which is getting connected to a 10 amp circuit or a 15 amp circuit you need to have at least the capability of 10 or 15 amps. So, that the breaker does not overheat under normal loading conditions. The second aspect of the current rating which is important is. So, you use a 10 amps or a 20 amp circuit breaker, but when there is a fault downstream of the circuit breaker your actual current fault current is much higher it could go up to 100s of amps 1000s of amps. So, how much current can it actually interrupt. So, the interrupt rating of a circuit breaker is also a important parameter. So, if you look at the aspect there. So, there are multiple issues that you would need to look at before you select a circuit breaker how it is used and what would be the fault conditions under which it has to protect your actual load. If you think about a circuit breaker it is a form of a switch. So, it is a switch that is on or off, but if you look at what are the different varieties of switches that are out there breakers imply you have the ability to interrupt fault. Whereas, a normal switch may not have the ability to interrupt a fault. So, if you are using a contactor in a power electronic application it can carry rated current it may be able to switch off your nominal current level, but it will not be able to interrupt a fault current level. So, if you try to interrupt fault current level using just a regular contactor your contactor contacts would could can potentially melt. So, you need the structures of your circuit breaker to actually provide the appropriate arc impedance in your circuit breaker and ability to extinguish the arc and dissipate the energy in the arc. So, you need more extensive structures in a circuit breaker compared to a regular switch. If you are looking at just a isolation switch you are looking at the ability to maintain isolation voltage you are not even looking at the ability to interrupt load current. So, depending on the type of switch that is being used you would have different levels of complexity. So, because the ability of the circuit breaker is for application which is intended to handle much higher fault conditions your circuit breaker would be more expensive than just a contactor. So, if something is designed to handle much more challenging situations you would have associated cause with it. So, depending on what you are intending that particular switch to be applied and you have to make use of the appropriate variety of switch. If you look at a relay you can think about the relay as essentially the control package which governs whether the switch needs to open or close and for over current protection you are looking at a over current relay. So, essentially the relay is a device which initiates whether to trip the breaker or some breakers have abilities to reclose or close. So, the relays can actually give such commands to a circuit breaker and tripping or opening relays tend to be more expensive. So, it is a newer relays are that are available today are mostly electronic relays. So, with a relay now you can actually trip all three phases. So, you can actually ensure that all the phases get disconnected simultaneously. It can be made more sensitive and depending on your algorithm it can be made to respond in a fast manner and it is possible to implement many sophisticated functions like directional impedance evaluations etcetera. So, in fact the newer relays that are available are multifunctional relays they are often called intelligent electronic devices IED and can be used with in a variety of situations. So, if you look at another protective device which could be used in a distribution system one can think about say a recloser. So, essentially the idea behind a recloser is that many faults are large number of faults are temporary.  So, if you are able to open your circuit breaker for some time and once the fault is cleared you close it again you can potentially continue normal operation, but if you have say for example a situation where you have something where there is permanent damage then when you re-close again you end up with a over current and so you might try a few times to actually re-close and at some point you decide that yes this is actually a permanent fault then you stay locked out. So, essentially you would have reclosers are essentially you can think of it as a circuit breaker with a relay package which can actually re-close a number of times. You can have a programmable number of reclose cycles say 1 to 4 reclose cycles could be commonly used and again for thinking about how what the sequence of operation is you it would be good to think in terms of the RMS current levels when you have a fault. So, in this example over here what is shown is the recloser status either it is closed when say here when the logic is indicated high and it is open when the logic is indicated low. So, if initially it was closed and things were under normal conditions and say you have a fault at some instant say t naught. So, at this particular instant say you had a fault which causes caused your current to actually come up to a large extent to a higher level then in a short duration may be on a instantaneous basis depending on you would actually open your recloser. So, after opening the recloser you wait for some duration and then where your recloser is in the off condition and the line is de-energized and then you reclose. And you have two possible scenarios over here one is the fault has cleared in which case you go into a current level in this hatched area. And you continue operation in the hatched in this hatched zone as second situation is may be the fault did not get cleared by this initial pulse of current.  So, your current level continues at the high fault current level itself and again now you wait for a certain close duration and then you again open your recloser. So, you could think about say durations you might call it as you can give names for these durations and. So, once you have opened again when there is a fault seen during this first reclose cycle you again wait for some time and you open the breaker. So, under this open condition there is no current flowing and here now you try to close for a second time. So, the anticipation is now you have reclose for a second time you potentially have cleared the fault. So, you might go back to normal operation or in case you have something really solid on the feeder then causing a fault then you go back to your high current level you wait for some more duration and then you lock out. So, at this point if the fault is still continuing your recloser will lock out and stop further reclose attempts. So, this is a recloser with two reclose cycles. So, you have one opening a second opening and then it would lock out if the fault is permanent and if the fault is temporary now it has two chances to get back to normal after the first reclose cycle or the second reclose cycle. So, you can see that if you have a temporary fault on this particular feeder it would get cleared with minimal disturbance and you could reenergize and go back to normal operation. So, if you think about the recloser it can be thought of as a circuit breaker and the circuit breaker might have its own time over current characteristics and the circuit breaker might also have a program to actually execute this reclose action. And if you are having already relays in the substation you can actually now incorporate this reclose logic along with the feeder circuit breaker sitting at the substation. So, you could look at improving the power quality or the time of uptime of your feeder when there are potentially faults on the feeders. And this logic can be easily incorporated into your substation protection logic. So, if you look at another item that we had mentioned we had also mentioned sectionalizers. So, sectionalizer is a device which is intended to operate along with a recloser. So, suppose you have a feeder coming from a substation.  So, we will see how it can potentially be done. So, suppose you have a fault on this particular lateral downstream of the sectionalizer what the sectionalizer does is it would count the number of fault current pulses and it can shut down or lock open after counting a given number of pulses current pulses flowing through it.  So, you have multiple situations if this particular fault was a temporary fault then this recloser which was initially closed after its first opening you potentially if this fault cleared you can go back to normal operation nothing would change on your recloser or the sectionalizer. Suppose, you have this recloser with two recloser cycles and say this sectionalizer is counting for two current pulses. So, in this particular case you have say a permanent fault occurring at this particular location and at the initiation of fault at time t naught you end up with one current pulse flowing through the sectionalizer at the end of your first during a first recloser cycle you end up with now a second pulse now flowing through this particular sectionalizer and then through this particular sectionalizer and then the recloser opens. So, when the recloser opens essentially this sectionalizer would count now two cycles and lock open. So, when the recloser now recloses for a third time the sectionalizer is open which means that this feeder can go back to normal operation and this lateral has actually opened and got disconnected where you have the permanent fault. So, you can see that there are two things that are happening over here the logic for it is not complex because you are just comparing current pulses rather than doing more complex time over current characteristic. The second thing is the sectionalizer is opening when the recloser is open which means that you just need a simple contactor type of switch rather than a circuit breaker. So, it can it is interrupting at low current levels or 0 ideally at 0 current levels. So, you could have lower cost device as a sectionalizer. So, in this particular case you had a two cycle recloser and you had a sectionalizer which counted two pulses and locked open. So, you isolate this particular lateral and you go back to normal operation sectionalizers need not just be on lateral it can also be on really long feeders you may want to sectionalize the tail end of the feeder and the front end of the feeder. So, you could have different configurations you could also have chain of sectionalizers you could have sectionalizer 1, sectionalizer 2 depending on how you are connecting your laterals. There are other simple protective devices that are used in the distribution system you can have fused disconnects jumpers etcetera essentially they are isolation devices which are open before lineman comes and works on the particular feeder or before the person does any repair work on the distribution system. So, if you now look at more closely at what is the characteristic that one would need when you are looking at protection in terms of a fuse or a circuit breaker you are looking at the time over current characteristic of your protective device. And you are looking at fuses circuit breakers relays etcetera and so with the fuse you are looking at the fuse of the appropriate voltage rating at which it would interrupt the current. And you are also looking at your current rating of the fuse the nominal current at which the fuse would be expected to operate depending on the downstream loads connected to it and also the interrupt capacity of the fuse. So, you have fuses of different interrupt capacities you have some fuses which might need to interrupt high currents like HRC fuses high rupture capacity fuses etcetera. So, depending on the type of requirement you would need to use appropriate type of fuse and aspects of it that are important is what is your minimum melt time. So, the time required for the fuse to melt depends on couple of things one is what is the temperature at which it was nominally operating. So, if it was initially operating at a elevated temperature it can actually melt more quickly. Another aspect which is important is how much current level is there because it is the I square R losses in the fuse which dissipates energy into the fuse and causes the fuse to melt. If you think of it as a adiabatic process which means that energy is going in it is not dissipating outside then essentially you would have be looking at what is the minimum melt time. Similarly, you would have a characteristic of what is the maximum clearing time how much would be the maximum time before which the fuse can actually be considered open. Another aspect of the fuse which is important is suppose you have a fuse and you have some over current flowing through that particular fuse and the over current is for a short duration and before it melts the over current went away then how does the fuse return back to the normal condition. So, you also have the cooling time constant where the fuse heated up to some extent then it could cools down depending on your thermal time constant of the particular fuse. So, essentially you can think about the cooling time constant as some sort of a reset mechanism of the fuse where it got exposed to over current and when the current went away it cools down and resets back to normal operation. If you look at circuit breakers you are looking at now something people refer to as the IDMT characteristics inverse definite mean time characteristic. Essentially it means that larger the current you will take a short duration for your circuit breaker to operate if your current level is small then it would take a longer duration to operate. But even at very high current levels there is some fixed delay before which your circuit breaker will not operate. So, if you look at it from your tripping characteristics of your circuit breaker you can think of a critical level as a pickup current level. If your current is greater than the pickup current level then your you would be initiating tripping action in the breaker. If your current is below your pickup current level you will be having reset action going on in the breaker and you can define a ratio between your actual current and your pickup current and depending on this ratio m your circuit breaker would operate with a given speed. So, for tripping the your value of m has to be greater than 1 and your time to trip can be expressed as an expression say a divided by m to the power of p minus 1 plus b. So, this would could emulate the IDMT type of characteristics. Similarly, for when m is less than 1 you would have a reset time can be again expressed as some t r e divided by m to the power of p minus 1 at the absolute value of it. And if you are operating close to your nominal current level and if your nominal current level is much smaller than your pickup current level then m can be considered close to 0. So, you could take your reset time to be approximately given by your capital t r e. So, you could take up take consider your reset time to be roughly constant just from to simplify your analysis for m close to 0 your t r e is roughly constant. And in these expressions your a p b etcetera are constants your t r e these are constants depending on the type of characteristic you are trying to emulate in your circuit breaker. So, depending on the value of your a b p etcetera you can have different definitions of what would be your inverse current characteristics. So, I see defines circuit breakers which are moderately inverse, very inverse, extremely inverse etcetera for the time current characteristic. So, a good reference for this would be IEEE standard C 37 dash 1 1 2 which is the inverse time current characteristics for over current relays. So, the type of curves are essentially if you have very large value for the multiplier essentially the time required to trip is quite small. So, if your value of the multiplier which is m which is the ratio of your actual current by your pickup current is a smaller number closer to 1 it would take a longer time to trip. So, if you now plot it on a log log scale it would have look as curves which are shown over here. So, for your extreme and very inverse type of characteristics essentially you could consider p approximately 2 and the expression for your trip time can be written as assuming your b is small essentially the definite time is small and for again for m which is much larger than 1 you could take this as approximately a by. So, if you know that a your m is your ratio of your actual current by your pickup current. So, if you substitute that so at this point what we will do is we will wrap up this particular session.