This study found that patients and providers treated telehealth and in-person visits as substitutes and used either depending on medical needs and availability. Telehealth did not lead to sooner or more follow-up visits than in-person services. This article was offered by Ying, Jessica, Cao, Dandi Chen and Maureen Smith.


So cryptographic techniques are very important for many of the security mechanisms we look at. So we've got to spend some time going through this. If you're a computer science student you would be studying CSS322 where we spend basically the whole semester looking at this topic, cryptography. We get to spend maybe two, three lectures on it. So you see this presentation is maybe 80 or 90 slides. Some of them will have to skip over just to cover within reasonable time. But there's a lot of information here. But we'll go and give an overview of different cryptographic techniques. And as we skip over slides you may want to just make note on the slides that I skip over that usually means it won't be covered. But the ones I skip over may be some examples if you need to know more or some further details that are not necessary but if you want to investigate you can have a look. And at the end of this topic you need to know about the different techniques because we'll use them in the subsequent topics. And there's a document that I've included in your printouts, two pages which summarizes a set of assumptions and principles that we'll use based upon cryptographic techniques. So we'll see these come up in the presentation but there's a document that you have that summarizes them all. And this is good for later topics. Use this if you can't remember everything from cryptography. So let's get started. First looking at the service of confidentiality. A common thing that we want to do is to keep data confidential, keep it secret. And we said yesterday people said, okay how do you keep data secret? Encrypt it. So we need to talk about encryption. The aim is to make sure our confidential information is not made available to unauthorized people. How do we do it? We encrypt the original data. We take the original data, encrypt it. We assume anyone can see that encrypted data but the encryption is such that only the authorized people will be able to decrypt and see the original data. That's how it will work. That is, once it's encrypted, that data can be made available to anyone in the world. But even though you get the encrypted form, the only people who can decrypt and get the original data back should be those which are authorized. Encryption is used for sending data across networks as well as storing files. So it's not just about network security, it's also about security inside computers. You may store data on a computer system encrypted. So a model for encryption, we think when we want to understand encryption techniques, I think we have two normal users, A and B, like our Alice and Bob from our other examples. And A wants to send data to B and they want that data to be confidential. That is, when A sends data to B, no one else except B or A should be able to see the original data. That's the goal. We have some attacker or malicious user C and we assume that C can observe what's being sent from A to B. So the attacker has some way to see what A sends to B. We cannot stop them from doing that. Now, how that happens in practice depends upon what communications network is being used. If it's sent from my laptop through a Wi-Fi network, it's quite easy to monitor Wi-Fi communications from a remote location. If it's sent through a wired network, again, maybe the attacker has physical access to the wiring and they can just intercept and get copies of the signals sent across the wiring. So it's very hard to stop attackers from being able to observe and see what's sent between two entities. So we will assume that they can. So the model for encryption is that user A has a message to send to B. We call that message plain text. It doesn't have to be text, but the name we give it is plain text. It's the original message. Then before sending the data, user A takes the plain text and encrypts it. So encryption is an operation that takes that plain text as input. It takes another input, which is a key. So think of this as a function that takes two inputs, the plain text and a key, and that function produces an output and that output is what we call ciphertext. So the encrypted plain text is called ciphertext. And A does not send the plain text across the network. They send the ciphertext instead. The ciphertext is sent to B. User C, a malicious user can observe and see the ciphertext. So the assumption is that they know what the ciphertext is. When user B receives the ciphertext, they apply a function which is the decryption function. And to decrypt, they use a key. The ciphertext is also an input. And as a result, if everything works correctly, when they decrypt, they get the original plain text out. So that's the model for encryption. Sender encrypts the plain text using a key, sends the ciphertext, the receiver decrypts that ciphertext using a key and gets the original plain text. What is the encryption function? We'll talk about some examples and we'll give some names of some algorithms that are used for encryption and decryption. In this course, we will not go through the details of those algorithms. We'll just mention the names of some. But they need to be such that decryption will be successful. These functions need a related encryption and decryption. And in fact, the keys are important in this case. So the function should be such that if we encrypt plain text to get ciphertext with one key, the key that we use here, if we use the correct key, then we must get the original plain text back when we decrypt. It's no good if I encrypt a file, send it to someone, they decrypt and they don't get the plain text back. It must come back the exact identical plain text. So that depends upon the functions here. And the keys, we'll see they're in fact two different models. The most common model that we think of is that A and B use the same key, the same key to encrypt and decrypt. It's the exact same value, but there's an alternative. So we often think of encryption as just simplified as these steps. So we usually don't show that those users separately. This slide summarizes some of those terms. So the plain text is the original message, ciphertext is the encrypted or coded message. Encryption is the process of converting the plain text to ciphertext, sometimes called encyphering, encypherment. Decryption is restoring the plain text from ciphertext. The key is information used by the encryption decryption and there will be some information or some rules as to who knows the key. A cipher is a particular encryption or decryption algorithm. So we call the algorithm a cipher. Cryptography is the study of those ciphers. So the people who study algorithms to do encryption, that field is called cryptography. The analysis of the decryption to try and defeat it from the attacker's perspective is called cryptanalysis and together cryptography and cryptanalysis is called cryptology. That's just the names or the terminology. We should go back. So we make some assumptions in this case. We need to design encryption algorithms and use them. We make some assumptions and the first one we've said is we assume the user c, the attacker, can observe everything sent between A and B. So they've got some way to see what's sent between them. That's one assumption. Another assumption we'll make is that the keys, if there are two approaches. One is where both entities use the same key. So key one and key two are identical. That's called symmetric key encryption. The keys are symmetric. They are the same. Another one we'll see later is called asymmetric key encryption where key one and key two are different. We'll explain that later. Let's assume that the two keys are the same. So one assumption we make is that if A knows the key, then B also knows the key. So somehow those two users have exchanged that secret key. The key needs to be secret. Secret in that the user c, the attacker, does not know the key. So we're arriving at a set of assumptions. C, the attacker can see the ciphertext. A and B know the key to use. They know the correct key. And user c doesn't know the key. So we assume that they don't know the key. If they did, if user c did know the key, user c knows the ciphertext. If they know the key, then they can do the same as user b does and decrypt. And we want to make it such that user c cannot decrypt. That's the goal. The other thing that we assume is that user c knows the cipher is used by A and B. So this algorithm for encryption, what is user A using? There are many different algorithms. We will assume that the attacker knows them. They know what the users are using to encrypt and decrypt. They don't know the key, but they know the algorithm. So the challenge from the attacker's perspective is given the ciphertext, they know that. Given the algorithms, so they know how they are encrypting and decrypting, but they don't know the key and they don't know the plaintext, they want to find them. That's their challenge. Find the key. If the attacker finds the key, then they can decrypt easily. Because if they know the ciphertext, if they know the key, they apply the algorithm and the algorithm gives us the plaintext. So if they find the key, then the attack is successful. Or if somehow they don't find the key, but they find the plaintext, again, they have been successful in attacking. So the challenge from the attacker, find the key and or plaintext given the ciphertext and the algorithms. At this stage, we're talking about symmetric key encryption where both entities use the same key. We'll talk about an alternative later. So we can say, we need to talk a little bit about what algorithms allow us to do this. That is, a strong or a secure system will be one such that the attacker cannot find the key or plaintext. That's insecure if they can find it. A secure system will be where it's very hard for the attacker to find the key or plaintext. So we talk about strong encryption algorithms. If we're given the algorithm and ciphertext, a strong one is one where the attacker cannot obtain the key or plaintext. It's weak if they can or insecure. So when we use encryption, there are many algorithms to choose from. We should choose one where this property is true or practically true. And many people have designed different algorithms to do that under different conditions. And one of the assumptions we're making is that the send and receive, A and B in our case, know the secret key. So we call it a secret key because that key that A and B use should not be known by anyone else, especially the attacker. If A mistakenly tells everyone else what its key is, then that key is no longer secret and the security of the system fails. So we must keep the key secret. So we assume from the attacker's perspective that they may know the algorithm or the cipher. Somehow they know what A and B is using. That's not kept secret. And that there's some way for A and B to distribute secret keys to each other. A secure communications channel to distribute keys. So again, A and B must know the same key. How does B get the key? Let's say A chooses the key. How does B get it? We need some way for A, if A chooses the key, some random value, and some way A needs to get that key to B because the decryption depends upon the key. If B doesn't have it, then they cannot decrypt. In this case, we're assuming some magic way in which they've done it already. That magic way may have been that user A and B exchanged prior on a piece of paper the key. They said let's use this key for our encryption. They wrote it down, they gave it to each other personally and then later across the network they use that key. Later we will see that there are some automatic ways for exchanging keys across a network that is secure. Of course we cannot send the key across the network because if we try to send the key across the network user C could intercept and see the key and therefore it's no longer secret. If we try to send the key across the network but we encrypt it first, then user B needs the key to decrypt and we have the same problem. We'll see later that there are encryption techniques that we can send an encrypted key across the network without user C seeing it, but not yet. For now let's assume we have some way to do so. So we need to say a little bit about what the algorithms are, what do they do, and again we won't go into many details. We'll just mention a few of the common principles and then mention some of the practical algorithms. That is, what does this block do, encryption? How does it create ciphertext? It's an algorithm that takes two inputs and really transforms the plaintext to get usually the same length ciphertext where that ciphertext should be hard to convert back to the plaintext without having the key. There are different ways to do that. Some of the more common techniques use two basic operations for encryption. Substitution and transposition. That is, to encrypt the plaintext to get ciphertext, substitution operation is given the plaintext you take some characters or elements in that plaintext and replace them with other possible characters. We substitute characters for others. Transposition is that we take some characters in the plaintext and move the positions. We rearrange them. Let's have a look at those basic elements or basic operations but from a very, very simple cipher's perspective. We'll try this one. We'll illustrate those two operations with two very simple ciphers which are not secure but easy to do examples for. One's called the Caesar cipher and to encrypt using the Caesar cipher it's an example of performing a substitution. If we consider the English letters A through to Z then we take our plaintext message and to get ciphertext we shift the plaintext letters K positions to the right where K is the key. Let's see that via an example. I have some different ones to consider. So, for example, if we have the plaintext and we denote the plaintext in short as P we're not right plaintext, P is the plaintext then if we have the message hello and we have a key and the key says that think of it as a number or a letter if it's the number B sorry, the number B the letter B is equivalent to the number one that is for the English letters we number them from 0 to 25 A is 0, B is 1 then the Caesar cipher to encrypt what we do is we take each plaintext letter and substitute that with the letter which is one position to the right in the alphabet one because our key is B or one so H becomes what? H becomes I think of one position to the right E we substitute the letter E with F you need to remember your alphabet L, L both are substituted with M and O so very simple cipher one of the first ciphers Caesar cipher named after Julius Caesar one of the Romans a long time ago we substitute one element with another the set of elements in this case there are 26 possible elements A through to Z to decrypt what do you do? you shift back you shift to the left that is if you have the ciphertext and if you know the key we know the key was B or one then we take I and shift it to the left back one position and I goes back to H and so on we get hello when we decrypt what if so this is using the Caesar cipher another example let's say C equals the ciphertext I think I have one that's our ciphertext you're the attacker you know the ciphertext you know the algorithm you know it's the Caesar cipher you don't know the key find the plaintext or find the key so the attackers challenge now is given this ciphertext so this is a different example given this ciphertext they know Caesar cipher was used they need to work back and find the plaintext what would you do? you don't have to try what would you do? find the key wow you're going to come and beat me up and ask me for the key I will not tell you what do you mean by brute force? try every key how many possible keys are there so you don't know the key how many possible keys are there? there are 26 that is the rule is that we shift by X characters or K characters where K is a letter A through to Z or in fact a number 0 through to 25 because if you shift by 26 positions to the right you take the letter A shift it by let's say shift it by one position to the right you get B shift it by 26 positions to the right what do you get? and 27 so it's the same as 1 so shifting by one position to the right is the same as shifting by 27 positions to the right because it wraps around and the same as 53 positions to the right so in fact there are only 26 unique keys that give us a different output so from the attacker's perspective one way to find or to try to find the plain text there are 26 possible keys try them all try key K equal to A what do you get? so as an attacker we may say let's try a key of A or 0 what's the plain text? shift by 0 positions it doesn't change anything it's not a nice key to use if you encrypt don't use A so what the attacker does is the plain text is A, B, M, D, M but the attacker is smart they know that the message is in English and they know it's going to be some word they don't know this they know that A, B, M, D, M is not a word so they assume that this is not the correct key it must be something else so they try another key K equal to B and they try to decrypt a shift of one position to the left what do they get? one position to the left A becomes Z or Z, yes? sorry? is this the word Steve? so the attackers have two approaches one is a brute force which we're trying to do the other is called cryptanalysis which is to use some knowledge of the algorithm and the knowledge of what may be communicated and try and more intelligently work out the plain text and some people have done some cryptanalysis to work it out yes they know the answer already but let's continue with our brute force before we do the smarter way let's decrypt at least a couple of this one A becomes Z B going back a position so we need to go back we get this and the attacker says Z, A, L, C, L that's not a word that cannot be the key so they try the next key and we'll not do that but I think you see the approach try another key and they'll keep going until they get a plain text that makes sense so this approach assumes that the attacker can recognize the correct plain text which is normally the case normally the attacker can understand the format of what the plain text would be they'll keep going and what do they get to those people who broke the cipher before what key will they get to what's the letter or number of the key that's going to work I think it's I or 8 is that right? this is decryption we shift to the left this is decryption the attacker has the cipher text and they try to decrypt it the encryption is shift to the right and because maybe we didn't say when we encrypt something when we encrypt our plain text we get cipher text the decryption algorithm must be such that when we take the cipher text we must get the original plain text so our Caesar cipher algorithm the encryption is shift to the right k positions therefore even the plain text that is output from the Caesar cipher to decrypt the algorithm must be shift to the left k positions otherwise we won't get the same plain text so yes decryption shift to the left and I think you can confirm if you try shift of 8 positions to the left a shift 8 positions to the left I think you end up with s and the attacker is smart enough this is the plain text if you try all 26 keys and don't try it now try it as homework all 26 keys you'll see that only one of them is a word that you'll recognize the others look like jumbled or random characters and that's how the attacker knows the correct key so this has demonstrated several things a brute force attack a brute force attack is an attack where if you don't know the key try all possible keys one of them will produce the correct result and in practice usually all others will produce random or garbage looking results and you'll be able to detect the key so a brute force attack is possible if you have the time to try all possible keys and here it's easy 26 keys easy to try or write software that will do it for you and we've seen an intuition cipher we substitute to encrypt one letter with another in the alphabet don't worry too much about the Caesar cipher okay understand the principles that we're trying to see here any questions you get it so if we have a quiz you'll be okay the purpose right the purpose is here is not so much about the cipher okay there are many different ciphers we're not going to go through many this is just one example to show that okay in a very simple case that we're replacing one letter in the plain text with another letter from our set of possible letters we replaced a with b for example in the first example so this is a substitution it's not very good okay a brute force attack is very easy and in fact even without a brute force attack I think the people who discovered the cipher text didn't try all possible 26 they used some other knowledge to work out the cipher text alright you could guess in this case maybe so it's not very secure but it demonstrates a substitution it also demonstrated brute force so that's a common operation still used in encryption algorithms today not the Caesar cipher this concept of take some characters and replace them with other characters in the set of possible characters substitution another operation is transposition rearrange characters don't replace them but rearrange and I guess we can go through the example a transposition cipher is the rail fence cipher a different cipher and the encryption operation is we take our plain text a game on English characters we have a sequence of letters we write them in diagonals over k rows so instead of writing it is one long row our plain text we write the plain text but the first letter is on the first row the second letter of the plain text is on the second row and we do that for k rows and then we come back to the top row and then to get the cipher text we read row by row let's show that by our example here's my pango let's stick with some simple plain text and let's use a key of 3 in this case in this cipher the key specifies the number of rows so to generate the cipher text we write the plain text but across 3 rows so H E L there's our 3 rows L come back here O S come back to the first row T E V E that's not the cipher text I shouldn't have wrote that the final cipher text we now read row by row E L S V so this is an example of a transposition cipher all we've done is taken the plain text characters and rearranged them we didn't replace them with any other letters so the the same set of letters are still in the cipher text there's 1 H 3 E's 2 L's in both the plain text and the cipher text we rearranged them transposed them we were not trying to decrypt again it's quite easy given cipher text and we're at the key it's not so hard to decrypt as well there are many of the ciphers used today the symmetric key encryption ciphers the practical ones which are secure use these 2 concepts they use transpositions rearranging characters and they use substitutions replacing one character with another character in the character set the characters are not necessarily letters A through to Z usually ciphers today operate on binary values sequences of bits but the same principles are applied but to add security what they do is they don't just do a substitution or just transposition they combine those operations and that's what product systems are for example we take the plain text we do a substitution like the Caesar cipher the output of that is then fed into a transposition like the second cipher the rail fence cipher and then the output of that is then fed back into the substitution part and then transposition so we don't just do one substitution in real ciphers we usually use a combination of substitution and transposition and repeat them multiple times and the final output is the cipher text and the algorithms are designed such that given that cipher text it's very hard to go back and get the plain text and that will be a strong cipher so the point here isn't how Caesar and the rail fence work it's the point that very simple operations are used to build very complex and secure ciphers I've already hinted that there are two different types of ciphers where so far I've mentioned something called symmetric key ciphers back to our picture sorry in general there are two keys key one and key two but there are two different types of encryption symmetric key encryption and asymmetric key encryption symmetric key encryption they're the same they're identical values they're called a shared key or a secret key the other approach is called asymmetric encryption or called public key encryption where key one and key two are different they're related but they're different values most of the ciphers up until the last maybe 40 or 50 years were symmetric key encryption but then a new approach called public key encryption or asymmetric key encryption was developed so we'll start looking at symmetric key where the sender and receiver use the same key a single key or sometimes called secret key encryption or conventional encryption and then later we'll look at public key encryption where the sender and receiver use different keys the keys are asymmetric we saw two examples where talk inputs of plain text were on letters today computers don't operate on English letters they operate on bits when they encrypt so we have a sequence of bits and there are two different approaches really to classify ciphers when they operate on bits it's how much plain text do they process at a time a block cipher encrypts a sequence of bits usually 64 bits or 128 bits at a time it takes 64 bits encrypts and gets 64 bits of cipher text if we have a large file you can think that file is broken into chunks of 64 bits at a time and it encrypts each chunk at a time a stream cipher usually operates on one bit or 8 bits at a time that's the main difference and it becomes a difference some of the algorithms are different and really the speed differs it's generally slower than stream ciphers in implementation block ciphers are okay and good for encrypting files stream ciphers because they're usually faster are good for encrypting data in real time maybe you're having a voice call over the internet and as you speak you want your voice the bits that represent your voice to be encrypted so the encryption process must be quite fast as you speak data is generated and needs to be sent quickly so stream ciphers may be used there most of the examples we'll look at are actually block ciphers we'll mention one or two stream ciphers a product system we will not go through is really apply a substitution operation like Caesar cipher but more complex apply a transposition operation and then repeat that use the same operations but keep repeating until you have your output so the goal of the attacker is to find the plaintext that's usually a good result if the attacker can find the plaintext but even better find the key because if you can find the key you can get the plaintext easily you just encrypt using that key finding the key means in practice you can not just find the current plaintext but all future plaintext which were encrypted using the same key so if you know that I am communicating with Tanarak over a period of a month and we're using the same key to encrypt our data then you monitor some communications and today you find the plaintext that I sent to Tanarak but you don't find the key and it may be possible that you can find the plaintext but not the key then that's good for you you found that current message but the next message I sent to Tanarak you again you don't know that plaintext you need to go through the same steps to try and attack but if you find the key that we're using to communicate then you can easily decrypt today's message and you can decrypt tomorrow's message and the future messages because if we use the same key and you have the key it's easy to get the plaintext knowing the key is better but if the attacker finds either then we can say they've defeated the security of the system we assume the attacker knows the ciphertext they know the algorithms in use and they may know pairs of plaintext and ciphertext that have been sent previously this is some extra information they may know so in practice attacks will always have the ciphertext the current ciphertext in the algorithm but they may also know past or other ciphertext messages which have been sent and also the plaintext from other related to those ciphertext for example that concept the attacker let's say we have A sends a message to B or A is communicating with B so they send ciphertext I'll say CI they may send many ciphertext messages with encrypted using the same key to B and the attacker knows the algorithm the cipher used they know the current ciphertext say C10 that is the tenth they know C10 they may know previous ciphertext so their aim is to find from that ciphertext the plaintext P10 and or the key that was used so what A does is takes their plaintext maybe the tenth plaintext P10 encrypts it with key K gets ciphertext C10 and sends it we assume the attacker knows the ciphertext and the key but the attacker may know other ciphertext as well they may know C9 and C8 and so on so they may monitor multiple ciphertext and that may help them in finding the key in the plaintext for the current ciphertext in fact they may know previous pairs and that's even better for the attacker that means let's say the attacker knows the algorithm they know the current ciphertext their aim is to find the current plaintext or the key that's what they want to find if the attacker has monitored past communications then they know the previous ciphertext messages C9, C8 and so on in some cases the attacker may know past plaintext messages they know that C9 in fact the encrypted form of P9 but they don't know the key that was used to go from plaintext P9 to ciphertext C9 how could they know that an example is that let's say A is some some military operation A and B are some military entities and they send messages to each other encrypted about the time in which they're going to drop bombs somewhere the time and location so the plaintext is some time and location and the attacker is trying to work out so A sends a message to B saying drop a bomb at this location at this time and the attacker is trying to work out and know in advance where they're going to drop the bomb and at what time so they can avoid it so the attacker is monitoring the communications it's encrypted but the attacker knows for the past messages they've saw the encrypted form the ciphertext C9 they didn't see they didn't get the plaintext they couldn't decrypt but later when the bomb was dropped at a particular location at a particular time they learned what the plaintext was so there are ways that the attacker can learn the plaintext of old messages of the key in that case the attacker learns the plaintext because they know a bomb was dropped at that location yesterday and therefore they know what the plaintext P9 was so there are ways for the attacker to find plaintext ciphertext pairs without knowing the key their aim is still to find the key or to find the current plaintext in many attacks on ciphers knowing more information about past communications makes it easier for the attacker so a lot of the theoretical attacks usually assume that the attacker knows past information about old plaintext and ciphertext pairs maybe that's going too far but it will come up when we talk about realistic attacks so you know already one attack method brute force you got the ciphertext you want to find the key or the plaintext easy take the ciphertext try all possible keys decrypt that and of all the plaintext messages which are generated one of them should make sense if that one makes sense that's the plaintext and therefore you found the key then crypt analysis is the more intelligent approach is to try and think given the algorithm that's being used try and exploit the characteristics of that algorithm to try and work out what the plaintext or key is without having to try all possible values so brute force is the dumb approach try all possible values crypt analysis is the smart approach which is harder because it requires knowledge of the algorithm and finding some weaknesses or some relationship between ciphertext and plaintext let's just let's not go through there let's go to brute force just to finish today we'll come back to those slides brute force attack try all possible keys so with our c's a cipher we knew that there were 26 possible keys therefore a brute force attack because there are 26 letters a brute force attack involved try letter A C, C, D until you find the right letter in the worst case you need to try all possible keys before you get the right the right key in the best case you try one on average you try half depends on what the key was in general in ciphers when we talk about keys they're usually not letters but they are binary values so we have a k-bit key so if we have a k-bit key a key which is k-bits long then a brute force attack in the worst case requires 2 to the power of k decryption operations to find the right key as an example I have chosen a 3-bit key and you need to decrypt some ciphertext to find the plaintext so with a 3-bit key you need to try in a brute force attack all possible keys what key do you try first how many possible keys are there there are 8 so you can try them anyone first in fact so maybe the obvious one is to try the first one in the sequence first 000 so what you would do if you know the ciphertext you would try and decrypt the ciphertext C first using the first key and you get some plaintext if that plaintext makes sense then you found the key if it's random or doesn't make sense you assume you haven't found the key so then you try the second key and you check do we find the plaintext and we keep going until we find the key when you know that I used a 3-bit key you only need to try 8 possible values so there are 2 to the power of k or 2 to the power of 3 possible keys you try them all in a brute force attack well you try them in practice you try them until you find a plaintext that you understand in the best case you try the first key 000 and you get a plaintext which makes sense maybe you decrypt and you get the word Steve okay you've been successful you're very lucky but maybe the key was 011 so you'd had to try 4 times and then you get the plaintext or maybe you were very unlucky and the last key you try is the correct one so assuming that I choose a key randomly the worst case is that you need to try them all and the average case is you need to try half of them sometimes you'll find it quickly sometimes you'll try them all on average we say that you'd need to try at least half of the keys to find the correct one so the worst case performance for you you need 8 operations to find the key the average performance would be 4 sometimes you'd find it as the first sometimes as the 6th and sometimes as the 8th on average it would be 4 so a brute force attack takes the worst case 2 to the power of k decryption operations so how long should a key be such that you cannot do a brute force attack if a key is 10 bits then it takes 2 to the power of 10 or around 1024 decryption operations if a key is 30 bits and it's about 10 to the power of 9 1 billion possible keys so to do a brute force attack you need to decrypt 1 billion times if you do 100 bits and 128 bits here a key length of 128 bits you need to do 2 to the power of 128 different keys in a brute force attack and what we'll start on next week as we'll talk about given the number of keys that you can try per second which depends upon your computer speed let's say that your computer could try 10 to the power of 15 keys per second it would take 10 to the power of 16 years to do a brute force attack so a brute force attack is very easy to prevent just make the key large enough large enough normally means more than 100 bits today we'll return to that next week we'll look at some key ciphers and then come back to those numbers and see whether these are realistic or not