27
Lesson Title: Lesson Title: Introduction to Cryptography Copyright © 2008 by Dale R. Thompson {d.r.thompson@ieee.org} Dale R. Thompson Computer Science and Computer Engineering Dept. University of Arkansas This material is based upon work supported by the National Science Foundation under Grant No. DUE-0736741. http://rfidsecurity.uark.edu 1 Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation (NSF).

Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Lesson Title:Lesson Title: Introduction to Cryptography

Copyright © 2008 by Dale R. Thompson {[email protected]}

Dale R. ThompsonComputer Science and Computer Engineering Dept.

py g © y p { p @ g}

University of Arkansas

This material is based upon work supported by the National Science Foundation under Grant No. DUE-0736741.

http://rfidsecurity.uark.edu 1

Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation (NSF).

Page 2: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

CryptographyCryptography

• Cryptography is the study of encryption andCryptography is the study of encryption and decryption schemes.– Used to uphold the security principles of– Used to uphold the security principles of confidentiality and integrity

http://rfidsecurity.uark.edu 2

Page 3: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Symmetric‐key cryptography termsSymmetric key cryptography terms

• Also know as secret‐key or single‐key cryptography

• Plaintext – It is the original message or data

• Encryption algorithm – It scrambles the message by performing substitutions and transformations on the plaintext based upon a key.  The output of the encryption l ith i ll d i h t talgorithm is called ciphertext.

• Ciphertext – It is the scrambled version of the plaintext that the encryption algorithm produces.

• Key It determines the particular type of transformations and substitutions• Key – It determines the particular type of transformations and substitutions performed by the encryption algorithm.  A different key produces a different ciphertext.  The key must be kept secret.  The key is usually a bit string representing a number.  If the algorithm is secure/good, the bigger the length of the key the more secure the data is.

• Decryption algorithm – It is the algorithm that unscrambles the ciphertext to the original plaintext given the correct key.

http://rfidsecurity.uark.edu 3

Page 4: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Symmetric‐key CryptographySymmetric key Cryptography

http://rfidsecurity.uark.edu 4

Page 5: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Exclusive‐OR (XOR) CryptographyExclusive OR (XOR) Cryptography

http://rfidsecurity.uark.edu 5

Page 6: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Block vs. Stream CiphersBlock vs. Stream Ciphers

• Block cipher – It is an encryption/decryptionBlock cipher It is an encryption/decryption algorithm in which data is processed in blocks.  A block of plaintext produces an equal‐lengthA block of plaintext produces an equal length block of ciphertext.

• Stream cipher It is an encryption/decryption• Stream cipher – It is an encryption/decryption algorithm in which the data is processed one bit or byte at a timebit or byte at a time.

http://rfidsecurity.uark.edu 6

Page 7: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Examples of block ciphersExamples of block ciphers

• Data encryption standard (DES)– 1977– NIST– 64‐bit blocks– 56‐bit key

T ll f li i d– Too small for many applications today

• Triple DES (3DES)– Apply DES three times– Two‐key version (2x56 = 112‐bit key)– Three‐key version (3x56 = 168‐bit key)

• Advanced encryption standard (AES)– NIST Standard in 2001 after contest– 128‐bit block size– Key sizes: 128‐, 192‐, or 256‐bit key– Larger block size more efficient and secure– High throughput (fast)– Efficient

http://rfidsecurity.uark.edu 7

Page 8: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Stream cipherStream cipher

http://rfidsecurity.uark.edu 8

Page 9: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

RC4 stream cipherRC4 stream cipher

• Variable key: 1‐256 bytesVariable key: 1 256 bytes

• UsesS k t l (SSL)– Secure sockets layer (SSL)

– Transport layer security (TLS)

( )– Wired equivalent privacy (WEP)

– WiFi protected access (WPA)

http://rfidsecurity.uark.edu 9

Page 10: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Asymmetric‐key cryptographyAsymmetric key cryptography

• Two different related keysTwo different related keys– Public key for encryption– Private key for decryptiony yp

• Based on functions that are easy to calculate one way but computationally difficult to y p ycalculate the other way.

• Two problems are solvedp– Key distribution– Digital signatures

http://rfidsecurity.uark.edu 10

Page 11: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Asymmetric key generationAsymmetric key generation

http://rfidsecurity.uark.edu 11

Page 12: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Asymmetric‐key CryptographyAli f B bAlice encrypts message for Bob

http://rfidsecurity.uark.edu 12

Page 13: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Asymmetric‐key cryptography lexamples

• RSARSA– 1024‐, and 2048‐bit keys are common

Cannot compare length of keys directly to– Cannot compare length of keys directly to symmetric cryptography key lengths

• Elliptic curve cryptography (ECC)• Elliptic curve cryptography (ECC)– For the same key length, ECC is more secure than RSARSA

http://rfidsecurity.uark.edu 13

Page 14: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Hash functionHash function

• Hash function – It accepts a variable‐lengthHash function  It accepts a variable length message and outputs a hash value (hash code, message digest)message digest)

http://rfidsecurity.uark.edu 14

Page 15: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Hash function examplesHash function examples

• MD5MD5– Produces 128‐bit hash value

• Secure hash algorithm (SHA 1)• Secure hash algorithm (SHA‐1)– 160‐bit hash value

• SHA‐256, SHA‐384, SHA‐512– Created after AES

http://rfidsecurity.uark.edu 15

Page 16: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Hash function threatHash function threat

• An attacker can substitute file and recalculateAn attacker can substitute file and recalculate the hash value of the new file.

http://rfidsecurity.uark.edu 16

Page 17: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Message authentication code (MAC)Message authentication code (MAC)

• Also called a cryptographic checksumAlso called a cryptographic checksum

• The MAC is a function of the message and a secret key shared between the sender andsecret key shared between the sender and receiver to authenticate the sender to the receiverreceiver

• An attacker cannot create the correct MAC b h d k h kbecause he does not know the secret key.

http://rfidsecurity.uark.edu 17

Page 18: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

MAC calculation by senderMAC calculation by sender

http://rfidsecurity.uark.edu 18

Page 19: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

MAC verification by receiverMAC verification by receiver

http://rfidsecurity.uark.edu 19

Page 20: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

MAC examplesMAC examples

• Use a block cipherUse a block cipher

• HMACU t d d h h f ti– Use standard hash function

– key

http://rfidsecurity.uark.edu 20

Page 21: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Digital signatureDigital signature

• RequirementsRequirements– Verify author, date, time of signature

Authenticate the message– Authenticate the message

– Verifiable by a third party to resolve disputes

E l• Examples– Any asymmetric‐key cryptography like RSA or ECC

– Digital signature algorithm (DSA)

http://rfidsecurity.uark.edu 21

Page 22: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Asymmetric‐key Cryptography for Digital SignatureAli i d B b ifi itAlice signs message and Bob verifies it

http://rfidsecurity.uark.edu 22

Page 23: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Authentication protocol termsAuthentication protocol terms

• Authentication – It is the process of determining if an entity, whether an individual or an object, is who/what they claim to be.  Some evidence has to be provided to prove the claim such as what they know, what they have, or what they are.  Passwords are the most common form of 

h d l f h kauthentication and are an example of what a user knows.

• Protocols – Protocols define the series of messages exchanged between two or more entities and their meaning.

• Mutual authentication protocol – It permits parties to verify each other’s identity.  This is important before exchanging keys or data.

http://rfidsecurity.uark.edu 23

Page 24: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Authentication protocol threatAuthentication protocol threat

• Replay attackReplay attack

http://rfidsecurity.uark.edu 24

Page 25: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Asymmetric‐key cryptography to establish a session key ( i l th ti ti t l)(simple authentication protocol)

http://rfidsecurity.uark.edu 25

Page 26: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Contact InformationContact Information

Dale R. Thompson, Ph.D., P.E.Associate ProfessorComputer Science and Computer Engineering Dept.JBHT CSCE 504JBHT – CSCE 5041 University of ArkansasFayetteville, Arkansas 72701‐1201y ,

Phone: +1 (479) 575‐5090FAX: +1 (479) 575‐5339E‐mail: [email protected]: http://comp uark edu/~drt/WWW: http://comp.uark.edu/ drt/

http://rfidsecurity.uark.edu 26

Page 27: Introduction to Cryptographyrfidsecurity.uark.edu/downloads/slides/mod02_lesson03... · 2009. 2. 28. · Authentication protocol terms • Authentication –It is the process of determining

Copyright Notice, Acknowledgment, and Liability R lRelease

• Copyright Notice

Thi i l i C i h © 2008 b D l R Th I b f l di ib d i i i– This material is Copyright © 2008 by Dale R. Thompson.  It may be freely redistributed in its entirety provided that this copyright notice is not removed.  It may not be sold for profit or incorporated in commercial documents without the written permission of the copyright holder.

• Acknowledgment

These materials were developed through a grant from the National Science Foundation at the– These materials were developed through a grant from the National Science Foundation at the University of Arkansas.  Any opinions, findings, and recommendations or conclusions expressed in these materials are those of the author(s) and do not necessarily reflect those of the National Science Foundation or the University of Arkansas.

• Liability Releasey

– The curriculum activities and lessons have been designed to be safe and engaging learning experiences and have been field‐tested with university students.  However, due to the numerous variables that exist, the author(s) does not assume any liability for the use of this product.  These curriculum activities and lessons are provided as is without any express or implied warranty.  The 

bl d l bl f f ll ll d d ll d f d l duser is responsible and liable for following all stated and generally accepted safety guidelines and practices.

http://rfidsecurity.uark.edu 27