مروري برالگوريتمهاي رمز متقارن(كليد پنهان)

Slides:



Advertisements
Similar presentations
DES The Data Encryption Standard (DES) is a classic symmetric block cipher algorithm. DES was developed in the 1970’s as a US government standard The block.
Advertisements

“Advanced Encryption Standard” & “Modes of Operation”
Encipherment Using Modern Symmetric-Key Ciphers. 8.2 Objectives ❏ To show how modern standard ciphers, such as DES or AES, can be used to encipher long.
Modern Symmetric-Key Ciphers
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Computer Science CSC 474By Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.1 Introduction to Cryptography.
Data Encryption Standard (DES)
Chapter 5 Cryptography Protecting principals communication in systems.
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
Introduction to Symmetric Block Cipher Jing Deng Based on Prof. Rick Han’s Lecture Slides Dr. Andreas Steffen’s Security Tutorial.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering.
Computer Networking Lecture 21: Security and Cryptography Thanks to various folks from , semester’s past and others.
CS Network Security Lecture 2 Prof. Katz. 9/7/2000Lecture 2 - Data Encryption2 DES – Data Encryption Standard Private key. Encrypts by series of.
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
Lecture 23 Symmetric Encryption
8: Network Security8-1 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key: K r e.g., key is knowing substitution.
Encryption Schemes Second Pass Brice Toth 21 November 2001.
8. Cryptography part 21 Rotor Machines Combine Substitution and Transposition Methods produce ciphers that are very difficult to break Rotor Machines in.
The Data Encryption Standard - see Susan Landau’s paper: “Standing the test of time: the data encryption standard.” DES - adopted in 1977 as a standard.
Chapter 20 Symmetric Encryption and Message Confidentiality.
TE/CS 536 Network Security Spring 2006 – Lectures 6&7 Secret Key Cryptography.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Network Security Lecture 11 Presented by: Dr. Munam Ali Shah.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Cryptography Chapter 7 Part 2 Pages 781 to 812. Symmetric Cryptography Secret Key Figure 7-10 on page 782 Key distribution problem – Secure courier Many.
Data Encryption Standard (DES) © 2000 Gregory Kesden.
BLOCK CIPHER SYSTEMS OPERATION MODES OF DATA ENCRYPTION STANDARD (DES)
Dr. Reuven Aviv, Nov 2008 Conventional Encryption 1 Conventional Encryption & Message Confidentiality Acknowledgements for slides Henric Johnson Blekinge.
Lecture 23 Symmetric Encryption
K. Salah1 Cryptography Module I. K. Salah2 Cryptographic Protocols  Messages should be transmitted to destination  Only the recipient should see it.
Intro to Cryptography Lesson Introduction
5.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 5 Introduction to Modern Symmetric-key Ciphers.
1 The Data Encryption Standard. 2 Outline 4.1 Introduction 4.4 DES 4.5 Modes of Operation 4.6 Breaking DES 4.7 Meet-in-the-Middle Attacks.
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
1 CPCS425: Information Security (Topic 5) Topic 5  Symmetrical Cryptography  Understand the principles of modern symmetric (conventional) cryptography.
1 Introduction to Cryptography Chapter-4. Definitions  Cryptography = the science (art) of encryption  Cryptanalysis = the science (art) of breaking.
CS480 Cryptography and Information Security
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
CS480 Cryptography and Information Security
Symmetric Cryptography
Provides Confidentiality
Data Security B. R. Chandavarkar Asst. Prof., CSE Dept., NITK, Surathkal. brc.nitk.ac.in.
6b. Practical Constructions of Symmetric-Key Primitives.
Symmetric Algorithm of Cryptography
Cryptography.
Chapter 30 Cryptography Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Part 1 By Dr. Shadi Masadeh
Outline Desirable characteristics of ciphers Uses of cryptography
Lecture 3: Symmetric Key Encryption
Block Cipher Modes CS 465 Make a chart for the mode comparisons
رمزنگاري متقارن بهروز ترك‏لاداني 1.
Cryptography Basics and Symmetric Cryptography
امنيت در شبکه هاي کامپوتري (1386)
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
EEC 688/788 Secure and Dependable Computing
PART VII Security.
Algorithm Types & Algorithm Modes
Rotors and Secret-Key Encryption
Block vs Stream Ciphers
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Chapter -3 ADVANCED ENCRYPTION STANDARD & BLOCK CIPHER OPERATION
SYMMETRIC ENCRYPTION.
Block Ciphers (Crypto 2)
Security of Wireless Sensor Networks
Encryption Basics Types of ciphers Algorithms Modes Key Length
Cryptanalysis Network Security.
Elect. Codebook, Cipher Block Chaining
Presentation transcript:

مروري برالگوريتمهاي رمز متقارن(كليد پنهان) علی فانیان a.fanian@cc.iut.ac.ir

فهرست مطالب معماري لايه اي امنيت اصول الگوريتمهاي رمزنگاري انواع الگوريتمهاي رمز متقارن(كليد پنهان) الگوريتمهاي رمزنگاري قالبي نحوه هاي بکارگيري رمزهاي قطعه اي

فهرست مطالب معماري لايه اي امنيت اصول الگوريتمهاي رمزنگاري انواع الگوريتمهاي رمز متقارن(كليد پنهان) الگوريتمهاي رمزنگاري قالبي نحوه هاي بکارگيري رمزهاي قطعه اي

معماري لايه اي امنيت كاربرد امنيتي پروتكل امنيتي الگوريتم ها

فهرست مطالب معماري لايه اي امنيت اصول الگوريتمهاي رمزنگاري انواع الگوريتمهاي رمز متقارن(كليد پنهان) الگوريتمهاي رمزنگاري قالبي نحوه هاي بکارگيري رمزهاي قطعه اي

Terminology plaintext, cleartext: an “unhidden message” encrypt: transform a message to hide its meaning ciphertext: encrypted message cipher: cryptographic algorithm decrypt: recover meaning from encrypted message cryptography: art/science of keeping message secure cryptanalysis: art/science of breaking ciphertext cryptology: study of both cryptography and cryptanalysis

Encryption and Decryption plaintext, cleartext ciphertext Decryption Method Encryption Method plaintext, cleartext ciphertext

Common Mathematical Symbols P plaintext (here is a binary value) C ciphertext (also binary) E encryption function D decryption function E(P) = C encrypting plaintext yields ciphertext D(C) = P decrypting ciphertext yields plaintext D(E(P)) = P decrypting encrypted plaintext yields plaintext

Restricted Algorithm The security of a restricted algorithm requires keeping the algorithm secret! SECRET

Encryption algorithm Decryption algorithm Simple Restricted Algorithm Encryption algorithm Multiply the plaintext by 2 Decryption algorithm Divide the ciphertext by 2 plaintext = SECRET = 19 5 3 18 5 20 Ciphertext = 38 10 6 35 10 40

Key-Based Algorithm The security of key-based algorithms is based on the secrecy of the algorithm, the key(s), or both

Simple Key-Based Algorithm Encryption algorithm Multiply the plaintext by 2 and add key Decryption algorithm Subtract the key and divide the ciphertext by 2 plaintext = SECRET = 19 5 3 18 5 20 Key = 3 Ciphertext = 41 13 9 39 13 43

Secret (Symmetric) Key Algorithms Decryption key = encryption key Key agreed in advance between parties Key kept secret Like a locked room Need the key to lock up document Need the key to unlock room and get document

Public (Asymmetric) Key Algorithms Encryption and decryption keys are different Encryption key is public (usually) Decryption key is private One key locks, the other unlocks

Exchanging Messages with Symmetric Cryptography Symmetric Key Algorithms Exchanging Messages with Symmetric Cryptography Alice plaintext key Bob key plaintext Agree on cryptosystem Agree on key cipher text CS CS

Crypto-Attacks Adversary goal to break cryptosystem Assume adversary knows algorithm, but not key two general approaches to attacking a conventional encryption scheme Cryptanalysis : rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext–ciphertext pairs Brute-force attack : The attacker tries every possible key on a piece of ciphertext until an intelligible translation into plaintext is obtained

Crypto-Attacks 3 types of attacks: ciphertext only: adversary has ciphertext; goal to find plaintext and key known plaintext: adversary has ciphertext, corresponding plaintext; goal to find key Chosen Text Plaintext message chosen by cryptanalyst, together with its corresponding ciphertext generated with the secret key Ciphertext chosen by cryptanalyst, together with its corresponding decrypted plaintext generated with the secret key

Crypto-Attacks Two definitions are worthy of note. unconditionally secure no matter how much ciphertext is available no matter how much time an opponent has it is impossible for opponent to decrypt the ciphertext there is no encryption algorithm that is unconditionally secure exception of a scheme known as the one-time pad computationally secure The cost of breaking the cipher exceeds the value of the encrypted information. The time required to break the cipher exceeds the useful lifetime of the information.

Crypto-Attacks

فهرست مطالب معماري لايه اي امنيت اصول الگوريتمهاي رمزنگاري انواع الگوريتمهاي رمز متقارن(كليد پنهان) الگوريتمهاي رمزنگاري قالبي نحوه هاي بکارگيري رمزهاي قطعه اي

انواع الگوريتمهاي رمز متقارن الگوريتمهاي رمز متقارن بر دو دسته اند: رمزهاي قالبي يا قطعه اي (Block Cipher) پردازش پيغام ها بصورت قطعه به قطعه اندازه متعارف قطعات 64، 128 يا 256 بيت رمزهاي پي در پي يا دنباله اي (Stream Cipher) پردازش پيغام ها بصورت پيوسته (بدون تقطيع)

رمز قطعه اي متن واضح (تقسيم شده به قطعات) قطعات خروجي K K

رمز دنباله اي (ب) (الف) Ci Pi مولد دنباله شبه تصادفي K مولد دنباله + مولد دنباله شبه تصادفي K مولد دنباله شبه تصادفي K Pi Ci + (ب) (الف)

تابع رمزنگاري کامل(One-Time Pad) ايده : براي رمزکردن يک داده به طول n کليدي به طول n هزينه کنيم. يعني داشتن هر تعداد متن نمونه رمزشده کمکي به تحليلگر نمي کند. امنيت اين روش به تصادفي بودن کليد بستگي دارد. در صورت تصادفي بودن کليد امنيت الگوريتم غير قابل شكست است. Ki Pi Ci +

رمز دنباله اي چند الگوريتم نمونه: -Physical processes -LSFR ( Linear Feedback Shift Register ) -BBS( Blum-Blum-Shub)

Linear shift feedback register with 4 bit register Linear Feedback Shift Register Linear shift feedback register with 4 bit register

فهرست مطالب معماري لايه اي امنيت اصول الگوريتمهاي رمزنگاري انواع الگوريتمهاي رمز متقارن(كليد پنهان) الگوريتمهاي رمزنگاري قالبي نحوه هاي بکارگيري رمزهاي قطعه اي

اصول رمزهاي قطعه اي نگاشت قطعات متن واضح به قطعات متن رمزشده بايد برگشت پذير (يك به يك) باشد. الگوريتم قطعات ورودي را در چند مرحله ساده و متوالي پردازش ميکند. به اين مراحل دور ميگوييم. هر دور عموماً مبتني بر تركيب اعمال ساده ايي همچون جايگزيني و جايگشت استوار است.

دو بلوک پايه براي عمليات رمز گذاري جانشيني Substitution جایگیزینی یک سمبل با سمبل دیگر ممکن است هم طول نباشند جابگشت Permutation ترتيب قرار گرفتن حروف در متن اصلي جابجا مي‌شود

استانداردهاي رمزهاي قطعه اي آمريکا : رمزهاي قطعه اي استاندارد استاندارد رمزگذاري داده DES استاندارد رمزگذاري پيشرفته AES تحت نظارت National Institute of Science and Technology (NIST)

استاندارد رمزگذاري داده DES مرور در سال 1974 توسط IBM توليد شد پس از انجام تغييراتي توسط NSA (National Security Agency) ، در سال 1976NIST آن را پذيرفت. اساس الگوريتم تركيبي از عمليات جانشيني و جايگشتي مي‌باشد. مشخصات: طول كليد 56 بيت طول قالبهاي ورودي و خروجي : 64 بيت تعداد دورها: 16 دور الگوريتمهاي رمزگذاري و رمزگشايي عمومي هستند, ولي مباني رياضي و اصول طراحي آنها فاش نشد. در گذشته بسيار پر استفاده بود و هنوز هم از رده خارج نشده است. National Institute of Standards and Technology (NIST) موسسه ملي استاندارد و فناوري‌ NSA National Security Agency

استاندارد رمزگذاري داده DES

Initial and final permutation steps in DES

DES uses 16 rounds. A round in DES (encryption site)

DES Function The heart of DES is the DES function. The DES function applies a 48-bit key to the rightmost 32 bits to produce a 32-bit output. DES function

Expansion P-box Since RI−1 is a 32-bit input and KI is a 48-bit key, we first need to expand RI−1 to 48 bits. Expansion permutation

S-Boxes The S-boxes do the real mixing (confusion). DES uses 8 S-boxes, each with a 6-bit input and a 4-bit output. S-boxes

S-box rule

DES cipher and reverse cipher for the first approach

به الگوريتمهاي امن تر با طول کليد بالاتر نياز داريم. DES بايد از رده خارج شود در ژانويه 1999 اين الگوريتم توسط حمله جستجوي جامع فضاي کليد در 23 ساعت شکسته شد! بيش از 1000 کامپيوتر بر روي اينترنت هر يک بخش کوچکي از کار جستجو را انجام دادند. به الگوريتمهاي امن تر با طول کليد بالاتر نياز داريم. DES طراحي شفاف و روشن ندارد.

2DES and 3DES مسئله : راه حل : استفاده از الگوريتم هاي رمزنگاري ديگر پيچيده كردن الگوريتم DES از طريق اضافه كردن مراحل رمزنگاري و افزايش طول كليد

2DES A pair of semi-weak keys in encryption and decryption

Meet-in-the-Middle Attack However, using a known-plaintext attack called meet-in-the-middle attack proves that double DES improves this vulnerability slightly (to 257 tests), but not tremendously (to 2112).

Continued Tables for meet-in-the-middle attack

3DES استفاده از الگوريتم 3DES از دو مرحله رمزنگاري و يك مرحله رمزگشايي با سه كليد مجزا استفاده مي شود فضاي كليد به 168 بيت گسترش مي يابد در صورت استفاده از يك كليد يكسان،3DES با DES مطابقت مي كند نسبت به الگوريتمهاي ديگر مانند Blowfish و RC5 سرعت كمتري دارد تا كنون حمله اي عليه آن گزارش نشده است

Triple DES with two keys

استاندارد رمزگذاري پيشرفته AES NIST در سال 1997 مسابقه اي دو مرحله اي براي طراحي استاندارد جديد برگزار کرد. تمام طراحي ها بايد بر اساس اصول کاملاً روشن انجام شوند. در سال 2000 رايندال(Rijndael) به عنوان برنده اعلام شد استاندارد رمزگذاري پيشرفته AES

فيناليست هاي مسابقه AES MARS RC6 Rijndael Serpent Twofish مقاله زير اطلاعات بيشتر درباره مقايسه فيناليست ها ارائه مي دهد: A Performance Comparison of the Five AES Finalists B. Schneier and D. Whiting منتخب!

فهرست مطالب معماري لايه اي امنيت اصول الگوريتمهاي رمزنگاري انواع الگوريتمهاي رمز متقارن(كليد پنهان) الگوريتمهاي رمزنگاري قالبي نحوه هاي بکارگيري رمزهاي قطعه اي

نحوه هاي بکارگيري رمزهاي قطعه اي ECB: Electronic Code Book CBC: Cipher Block Chaining CFB: Cipher Feed Back OFB: Output Feed Back CTR: CounTeR mode

نحوه بكارگيري ECB رمز نگاري: رمز گشايي: P1 C1 K E P2 C2 K E PN CN K رمز نگاري: رمز گشايي: D C1 P1 K D C2 P2 K D CN PN K اشکال اساسي: هر متن واضح به ازاء کليد ثابت هميشه به يک متن رمز شده نگاشته ميشود. دشمن ميتواند دريابد که پيامهاي يکسان ارسال شده اند.

نحوه بكارگيري CBC رمز نگاري: رمز گشايي: IV IV E E E E … D D D D P1 C1 K + E P2 C2 K + E P3 C3 K + E PN CN-1 K + IV CN-1 … رمز گشايي: D C1 P1 K + D C2 P2 K + D C3 P3 K + D CN PN K + IV CN-1

مد کاري CBC اين مد از يك مقدار دهي اوليه تصادفي (IV) بهره مي گيرد مقدار IV در هر بار رمزگذاري به صورت تصادفي تغيير مي كند بهتر است IV نيز رمز شده ارسال گردد هر متن آشكار به ازاء كليد ثابت هر بار به يك متن رمز شده متفاوت نگاشته مي شود  

نحوه بكارگيري CBC ملزومات امنيتي: رمزنگاري: رمزگشايي: طول پيام: IV بايد کاملاً غير قابل پيش بيني و غير قابل دستكاري باشد رمزنگاري: عمليات رمزنگاري قابل موازي سازي نيست. مقدار IV و متن واضح بايد در دسترس باشند. رمزگشايي: عمليات رمزگشايي قابل موازي سازي است. مقدار IV و متن رمزشده بايد در دسترس باشند. طول پيام: در برخي موارد ممکن است وادار به افزايش طول پيام بشويم. طول پيام بايد مضربي از طول قطعه باشد. پياده سازي: رمز گشايي و رمز نگاري، هر دو بايد پياده سازي شوند.

رمز نگاري رمزگشايي نحوه بكارگيري CFB E E K K Pi Ci + Ci Pi + initialized with IV initialized with IV (s) (s) shift register (n) shift register (n) (n) (n) E E K K (n) (n) select s bits select s bits (s) (s) (s) (s) (s) (s) Pi Ci + Ci Pi +

رمز نگاري رمزگشايي نحوه بكارگيري OFB E E K K Pi Ci + Ci Pi + initialized with IV initialized with IV (s) (s) shift register (n) shift register (n) (n) (n) E E K K (n) (n) select s bits select s bits (s) (s) (s) (s) (s) Pi (s) Ci + Ci Pi +

مقايسه CFB و OFB موارد استفاده CFB و OFB رمز جرياني کاربردهاي بلادرنگ

رمز نگاري رمزگشايي نحوه بكارگيري CTR E E counter + i counter + i K K Pi (n) Ci Ci (n) Pi + +

مقايسه کاربرد انواع مدهاي کاري

لغت نامه Authentication احراز اصالت Brute Force جستجوي كامل AES استاندارد رمزگذاري پيشرفته DES استاندارد رمزگذاري داده Padding افزايش طول پيام Provable Security امنيت قابل اثبات Differential cryptanalysis تحليل تفاضلي linear cryptanalysis تحليل خطي Substitution جانشيني Permutation جايگشت NSA: National Security Agency Timing Attack حمله زماني Meet-in-the-Middle attack حمله ملاقات در ميانه Round دور Symmetric Encryption Scheme رمزنگاري متقارن Stream Cipher رمزهاي پي درپي(دنباله اي) Block Cipher رمزهاي قالبي(قطعه اي( Symmetric Cipher رمزهاي متقارن Key Schedule زمان بندي کليد plaintext متن واضح Confidentiality محرمانگي parallelization موازي سازي MAC: Message authentication code کد احراز اصالت پيام