Presentation is loading. Please wait.

Presentation is loading. Please wait.

Encryption.

Similar presentations


Presentation on theme: "Encryption."— Presentation transcript:

1 Encryption

2 Learning Objectives 3.4.1 Understand the need for data encryption
3.4.2 Understand how a Caesar cipher algorithm works

3 What is encryption? Any ideas?
Encryption is the process of using a cryptographic algorithm to encrypt a message into a format so that it can not be read by anyone who intercepts it. The intended receiver then can decrypt the message back into a readable / useable format.

4 Why do we need encryption?
The Internet allows data to be sent around the world at phenomenal speeds, in massive quantity. It is likely that some of this data you would want to keep private. Things like online banking Credit card details during a purchase Etc..

5 Symmetric or Asymmetric?
Most encryption algorithms fall into the category of either Symmetric Key Encryption or Asymmetric. Symmetric encryption methods use the same key. The process used to encode the message is often simply reversed to decode the message. Key : method of encryption, cipher, algorithm.

6 The problem? How does the person at the other end know how to decipher the message? They need to know the key How are you going to tell that person the key? That would mean sending it “in the clear” Or meeting up with them in secret – not always possible if they are the other side of the world. You could encrypt the key…. But then how would they know to decode that?

7 Asymmetric Key Encryption
This is often called 2 key Public / Private Key Encryption This uses 2 keys One to encode the message (public key) One to decode the message (private key) You can’t work out one key from the other, and you can’t use the wrong key to decode or encode the message. This solves the problem of having to tell the other person the encryption method you are using. (the Key) Example

8 Caesar Cipher A Caesar Cipher can also be called a shift cipher
It takes a letter of the alphabet and shifts it along a set number of places. For example - A (0) B  (1) C  (2) D A (3) E F G H Explanation Video

9 To decode – you reverse The message D O G  G R J (shift of +3)
What about this message? B O Y  E R B Why does Y become B? It loops round when you hit the end of the alphabet. You are expected to be able to write a pseudo code algorithm for a Caesar shift.

10 Challenge Try to decrypt the following messages using your Caesar wheels Offset 5 JCUJWNJSHJ NX YMJ YJFHMJW TK FQQ YMNSLX. Offset 18 A USEW, A KSO, A UGFIMWJWV. Extension: Try to come up with your own encrypted message using an offset of 3

11

12

13 Dealing with the end of the alphabet.
We need the following steps – For each character in the string find it’s numerical value. E.g. A  1 (you could use ASCII) Add the offset to the value. E.g. 1+3 =4 Deal with numbers greater than 26. Find out what letter is represented by the new number. E.g. – 4  D

14 2 methods… Use an IF function. Use Modulus operation. 7 % 2 = 3.5
IF new_value >26 Then new_value – 26 Use Modulus operation. 7 % 2 = 3.5 7 MOD 2 = 1 Why?

15 Another use of Modulo… Clock face maths…
What about Mod? 14 MOD 12 = 2 Yay! What about 09:00… 9 MOD 12 = 9 Yipee! The time is 14:00. How do you know what that is in 12hrs? You could subtract 12. 14 – 12 = 2 12 That seems to work… 9 3 Let’s try it for 09:00… 9 – 12 = -3 Oops. 6 The advantage of the MOD function is that it works for negative numbers as well!

16 Activity – Plan a Caesar Shift
In your books write Pseudo code or a flow chart for a Caesar Shift.

17 Activity – Make a Caesar Shift
Open Python and implement the algorithm you have designed. Using an IF or MOD.

18 Plenary Why do we need encryption?
What 2 categories do most encryption methods fall into? How does public key encryption work? How does a Caesar shift work? What is a key in cryptography? How does MOD work?


Download ppt "Encryption."

Similar presentations


Ads by Google