Upload
phamdiep
View
223
Download
4
Embed Size (px)
Citation preview
1
Communicating Securely
CRYPTOGRAPHY
2
THE PROBLEM
Encrypt and send the following message to another person utilizing a basic implementation of the RSA cryptosystem:
“This is a secret message.”
Demonstrate how the receiver can decrypt and understand this message.
3
Keep it Secret!
4
Communicating Securely
5
Goal of a Cryptosystem
Relay an information from one place to another without anyone else being able to read it.
6
Encryption and Decryption
● Encryption is the process of using an algorithm to transform information into a format that cannot be read.
● Decryption is the process of using another algorithm to transform encrypted information back into a readable format.
● The original information is referred to as the plain text while the encrypted version is the cipher text.
7
A Cypher System
8
Encryption and Decryption
● Encryption and decryption are processes performed in cryptography, which is essentially about inventing cryptosystems (also called cryptographic systems or cipher systems).
● Breaking cryptoystems, on the other hand, is part of cryptanalysis.
● Cryptography and cryptanalysis make up what we refer to as cryptology.
9
Cryptology
Cryptography Cryptanalysis
Encryption Decryption
10
Objectives of Encryption
1. Confidentiality. The sender (let us call her Alice) and receiver (let us call him Bob) can be assured that no third party can read the message.
2. Integrity. Alice and Bob can be sure that no third party can make changes in the message.
3. Authenticity. Bob can be sure that Alice sent the message.
4. Non-repudiation. Bob can prove to any third party that Alice sent the message.
11
Some Encryption SystemsPIGPEN
12
Some Encryption SystemsPIGPEN
Encrypt the message using the Pigpen Cipher:
KEEPMEUNKNOWN
13
Some Encryption SystemsCAESAR'S CIPHER
Encipher the message “THIS IS A SECRET MESSAGE“
using the following key:
14
Some Encryption SystemsVIGENERE CIPHER● This type of cipher is said to polyalphabetic as
opposed to a monoalphabetic (where the same cipher letter is used for each occurrence of a given letter in the plain text).
15
Some Encryption SystemsVIGENERE CIPHER
● Suppose the message to be sent is “Run now!”
● Using the alphabet A B … Z → 0 1 … 25 and keyword “hush”, we proceed as follows:
16
Some Encryption SystemsVIGENERE CIPHER
To decrypt, we reverse the process (do subtractions instead).
17
Some Encryption SystemsVIGENERE CIPHER
● Do item #24a and #25a on page 120.
● Which is more difficult to decrypt? A monoalphabetic cryptosystem or a polyalphabetic cryptosystem?
18
Symmetric and Asymmetric Cryptography
There are two basic techniques for encrypting information:
● symmetric encryption (also called secret key encryption) and
● asymmetric encryption (also called public key encryption.)
19
Symmetric Cryptography
20
Asymmetric Cryptography
21
Public Key Encryption
● In 1976, W. Diffie and M. Hellman introduced a new method of encryption and key management now referred to as public key cryptography.
● Public key cryptography is a system that uses a pair of keys (a public key and a private key).
22
Public Key Encryption
● Each individual is assigned these keys to encrypt and decrypt information.
● A message encrypted by one of the two keys (the public key) can only be decrypted by the other key in the pair (the private key).
● This method is also referred to as asymmetric cryptography.
23
Public Key Encryption
24
Public Key Encryption
● The public key is available for others to use when encrypting information that will be sent to an individual.
● Similarly, people can use that individual's public key to decrypt information sent by him.
● The private key, on the other hand, is accessible only to the individual.
25
Public Key Encryption
● The individual can use his private key to decrypt any message encrypted with his public key.
● Or he can use his private key to encrypt messages, so that the messages can only be decrypted with his corresponding public key.
26
Modular Arithmetic
The mathematical statement
a ≡ b (mod n)
means that the difference a – b is divisible by the integer n.
For example,
(a) 8 ≡ 2 (mod 3) since the number 8 – 2 = 6 is divisible by 3.
(b) 0 ≡ 24 (mod 6) since 0 – 24 = – 24 is divisible by 6.
27
Modular Arithmetic
When you are given the problem
b ≡ x (mod n)
which means that n divides b – x then there must be an integer t such that b – x = nt or
b = x + nt.
This equation tells us that when b is greater than or equal to n, the number x can be interpreted as the remainder when b is divided by n
28
Modular Arithmetic
Equivalence Properties
● a ≡ a (mod n)
● a ≡ b (mod n) implies b ≡ a (mod n)
● a ≡ b (mod n) and b ≡ c (mod n) implies a ≡ c (mod n)
29
RSA Cryptosystem
Rivest, Shamir, and Adleman
30
RSA Cryptosystem
● RSA (for Rivest, Shamir, and Adleman) is based on the assumption that factoring large integers is computationally hard.
● RSA implemented two important ideas: public key encryption and digital signatures. This is not only useful for electronic mail, but for other electronic transactions and transmissions, such as fund transfers.
31
RSA Cryptosystem
● It was the RSA cryptosystem that first convinced the mathematical community that public key cryptographic systems might be feasible.
● The security of the RSA algorithm has so far been validated, since no known attempts to break it have yet been successful.
32
RSA Key Generation
1) Take two large primes p and q and compute n = pq.
2) Choose a number e less than n and relatively prime to
(p – 1)(q – 1).
3) Find another number d such that ed – 1 is divisible by
(p – 1)(q – 1). A formula for d is
4) The public key is (n, e) and the private key is (n, d).
d=1+k ( p−1)(q−1)
e, for some integer e
33
Illustration
● a) Let p = 43 and q = 59. Then n = pq = 2537.
● b) Choose e = 13 . This number is both less than 2537 and relatively prime to (p – 1)(q – 1) = 42(58) = 2456.
● c) If k = 5, then
.
● d) Hence, the public key is (2537, 13) and the private key is (2537, 937) .
d=1+k (p−1)(q−1)
e=
1+5(2436)13
=937
34
RSA Encryption
1) Translate the message into a sequence of integers.
2) Group integers together to form large integers, each representing a block of letters.
3) Transform the message M to the encrypted version C using
C=M e(mod n)
35
RSA Decryption
● To retrieve the original message M, decrypt the message C using
M=Cd(mod n)
36
Illustration (Encryption)
● Goal: Send the message “STOP.“
● Step 1: Translate this message into a sequence of integers
ABCDEFGHIJKLMNOPQRSTUVWXYZ → 00 01 02 … 25.
● Step 2: We group integers together to form even larger integers, each representing a block of letters.
STOP → 18 19 14 15 → 1819 1415
37
Illustration
● Step 3: Encrypt 1819 and 1415 as follows:
1819 → 181913 (mod 2537) ≡ 2081
1415 → 141513 (mod 2537) ≡ 2182
Therefore, the message STOP is equivalent to the ciphertext 2081 2182.
38
Illustration (Decryption)
● Goal: Decrypt “ 2081 2182“ will perform the following decryption:
2081 → 2081937 (mod 2537) ≡ 1819
2182 → 2182937 (mod 2537) ≡ 1415
The receiver will conclude that 2081 2182 is 1819 1415 or ST OP or STOP.
39
FIRMING UP
Do each of the following items:
● Item #1, 3 on page 117
● Item #4, 6 on page 118
● Item #24, 26 on page 120
● Item #31-32, page 121
40
DEEPENING
Do each of the following items:
● Any two items from item #11 to #14 on page 118
● Item #29 on page 121
● Item #42 and 46 on page 122
41
EXPLORING
● Encrypt “This is another secret message.” using the Autokey Cipher (see page 120).
● Do any three of item #s 39, 40, 43, 44, 48, and 49 on page 122.
42
Reading Assignment
● Read the lesson on Authentication and Steganography
● Do each of the following:
1) Explain the meaning and importance of authentication in cryptography.
2) What are the different possible ways of authentication?
3) Explain the meaning of steganography.
4) Why do you think this method of secret handling is developed?
–
43
BLOG YOUR THOUGHTS
● Communicating securely means ______________________
● Encryption is different from decryption since _____________
● Asymmetric cryptography is different from symmetric cryptography since _____________________
● The concepts of cryptography are important since __________________.
● For me, the mathematics behind the study of cryptography is _________________.
● I find this topic ___________________.
44
45
46