A* Güvenl*** 2012 Bahar - Dr. Mustafa Cem Kasapbasi

Download Report

Transcript A* Güvenl*** 2012 Bahar - Dr. Mustafa Cem Kasapbasi

AĞ GÜVENLİĞİ
2012 BAHAR
Yrd. Doç. Dr. Mustafa Cem Kasapbaşı
Computer Networks
Tanenbaum/Wetherall 5th edition
Geçmiş
• İlk Zamanlar
• Printer ve email gibi akademik amaçlı kullanım
• Şimdi
• Online banka, vergi ödeme, facebook,
• Neyle ilgilinir
• Yetkili kişilerin yetkli oldukları kaynaklara erişimini,
• Verilerin güvenliğini
• En fazla tehlike dışarıda değil içeride
• Ağ güvenliği Problemi 4 ana gruba bölünebilir.
• Gizlilik (secrecy, confidentiality) yetkisiz kişilerin bilgilere erişimini
engelleme
• Yetkilendirme (authorization) kiminle iletişime geçildiğinin anlaşılması
• inkar edilmemesi (non repudiation), imzalarla ilgilenir,
• İçerik Kontrolü (integrity control) gönderilen mesajın değişmediği
OSI katmanları
• Uygulama
Uygulama
• Sunum
• Oturum
• Transport
• Ağ
• Data link
• Fiziksel
Transport
Internet
Link
Recap
• Fiziksel Katman:
• Bitlerin iletişim kanalından gönderilmesi ile ilgilenir. Bir tarafa 1 bit
bönderdiğinden diğer taraf bunu 0 bit değil 1 bit olarak almasını
sağlamaktır.
• Data Link Layer
• “data frames” leri sıralı bir şekilde gönderir. Karşı taraf bilgileri
aldım ack frame gönderir.
• Hızlı ve yavaş gönderen alan dengesini kuran mekanizma içerir.
• Network Layer
• Ağ katmanı alt ağları kontrolünü sağlar. “packet” lerin kaynaktan
hedefe nasıl gitmesin gerektiğini belirlemek ana problemi.
• Tıkanıklık, bottlenecks.
• Qos (delay, transit time, jitter)
Recap
• Transport Layer
• Ust katmanlardan bilgiyi alıp network katmanına parçalar hhalinde
doğru şekilde iletilmesi ile ilgilenir. Zamanla değişen donanım alt
yapısından bağımsız olarak gerçekleştirilmelidir.
• Oturum katmanına ne gibi bir hizmet sunacağını belirler
• Session Layer
• Farklı makinalardaki kimselerin birbirleri arasında ourum
oluşturmasını sağlar. Dialog control (iz tutma), Token management(
aynı işi işlemeyi önleme), sycnronization
• Presentation Layer
• Syntax and semantic of the transmitted data rather then bits
• Application Layer
• Kullanıcı tarafından gerekli bir çok protokol içerir HTTP, FTP, SMTP
NNTP
Her katmanın bir güvenlik katkısı olabilir
• Fiziksel Katman
• Fiziksel katmanda dışardan manyetik olarak bilgilerin okunmasını
engellemek için foil kullanılabilir yada optik hatlar kullanıbilir.
Wiretapping.
• Data Link Katamanı
• Noktadan noktaya giden bir paketler Data Link Katmanında
makineden makineye şifrelenebilir. Routerlar zayıf noktası olur.
Session kullanımı problem olabilir (online alışveriş). Link Encryption
• Network Katmanın
• Firewalls, IP security
• Transport Katmanı
• Tüm iletişim uçtan uca şifrelenebilir.
• Application Katmanı
• Kimlik denetimi, ve inkar edilememe sadece uygulama katmanında
yapılabilir.
Hangi katmanda uygulanmalı
• Owing to what? Neye göre?
• Fiziksel katman hariç neredeyse tüm ağ güvenliği
kriptografik prensiplere dayanmaktadır. Bu yüzden ağ
güvenliği konusuna kriptografi ile başlayarak devam
edilecektir.
Application
Transport
Network
Link
Physical
Kriptography
• Kriptografi güvenlik mekanizmaları için temel bir yapı
taşıdır.
• Giriş
• Greek word “secret writing”
• II. Dünya savaşı
• Oyuncu şifreleri »
• Transpozisyonu şifrelere »
• Bir seferlik pedleri »
• Temel kriptografik ilkeler »
Some Basic Terminology
• plaintext - original message
• ciphertext - coded message
• cipher - algorithm for transforming plaintext to ciphertext
• key - info used in cipher known only to sender/receiver
• encipher (encrypt) - converting plaintext to ciphertext
• decipher (decrypt) - recovering ciphertext from plaintext
• cryptography - study of encryption principles/methods
• cryptanalysis (codebreaking) - study of principles/
methods of deciphering ciphertext without knowing key
• cryptology - field of both cryptography and cryptanalysis
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
Introduction
The encryption model (for a symmetric-key cipher)
• Kerckhoff’s principle: Algorithms (E, D) are public; only the keys
(K) are secret
• Security by obscurity, bilinmezlik ile güvenlik
Trudy
Alice
Bob
Security by obscurity, bilinmezlik ile
güvenlik neden işe yaramaz
• Bu şekilde olmayacağı ,ispat edildi
• Ayrıca algoritma açılırsa, hevesli akademisyenler onu
ne kadar akıllı olduklarını yayınlarda östermek için
kırmaya çalışacak ve sonuç:
•
•
Bedava/ ucuz danışmanlık
Ne kadar çok kişi kırmaya çalışırsa ve çok uzun süre
kırılamayan algoritma muhemelen daha sağlam bir
algoritmadır.
• Asıl güvenlik KEY anahtar olduğu için onun
büyüklüğü önemli
•
•
•
2 basamaklı anahtar için 100
3 basamaklı anahar için 1000 ihtimal
Üstsel bir artım sözkonusu
Cryptography
• can characterize cryptographic system by:
• type of encryption operations used
• substitution
• transposition
• product
• number of keys used
• single-key or private
• two-key or public
• way in which plaintext is processed
• block
• stream
Cryptanalysis
• objective to recover key not just message
• general approaches:
• cryptanalytic attack
• brute-force attack
• if either succeed all key use compromised
Cryptanalytic Attacks
ciphertext only
 only know algorithm & ciphertext, is statistical, know or can identify
plaintext
known plaintext
 know/suspect plaintext & ciphertext
chosen plaintext
 select plaintext and obtain ciphertext
chosen ciphertext
 select ciphertext and obtain plaintext
chosen text
 select plaintext or ciphertext to en/decrypt
Brute Force Search
• always possible to simply try every key
• most basic attack, proportional to key size
• assume either know / recognise plaintext
Key Size (bits)
Number of Alternative
Keys
Time required at 1
decryption/µs
Time required at 106
decryptions/µs
32
232 = 4.3  109
231 µs
= 35.8 minutes
2.15 milliseconds
56
256 = 7.2  1016
255 µs
= 1142 years
10.01 hours
128
2128 = 3.4  1038
2127 µs
= 5.4  1024 years
5.4  1018 years
168
2168 = 3.7  1050
2167 µs
= 5.9  1036 years
5.9  1030 years
26! = 4  1026
2  1026 µs = 6.4  1012 years
26 characters
(permutation)
6.4  106 years
Kripto analiz Criptoanalysis
Three principle variation
• Chiphertext-only
•
Bir çok şifrelenmiş metin var ama çözülmüşü yok
• Known plain text
• Bazı Şifresiz metinlerin ve şifreli karşılıkları var
• Chosen plain text
• Kendi seçimi ile belirlediği açık metinlerin, şifreli karşılığı
varsa
Yeterli güvenlik sistemi olması için bazı metinler
çözülebilse bile genede sistem kırılmamalı
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
Substitution Ciphers
Substitution ciphers replace each group of letters in the
message with another group of letters to disguise it
• Monoalphabetic substittion chipher
Simple single-letter substitution cipher
Kripto analizi
• Yeterince Güvenli mi?
• 26!= 4*1026 muhtemel anahtar
• Temel saldırı kullanılan dilin istatistiksel özellikleri
• Ingilizcede e en sık kullanılan t,o,a,n,I monogram
• Diagrams th, in, er, re, an
• Trigrams the, ing, and ion
•
•
e ve t ya bak tahmin olarj tXe de X için aday H olur. thYt Y=a
aZW=and olur….
Soru
Bu metini çözün içinde istanbul kelimesi var
Bu kriptoyu kırınız (yani tüm alfabede karşılık gelen
yerleri bulunuz) tüm harflerin karşılıkları olmasada bu
Ç ö ş ü harflerinin kullanılmadığını ve kriptoyu yapan
adamın belirli bir sistematik kullandığını biliyorsunuz.
umocferb ougckjo rfutjkmuojmu
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
Transposition Ciphers
Transposition ciphers reorder letters to disguise them
Key gives column order
Column 5
6
Simple column transposition cipher
7
8
Kripto analizi
Kripto analizci bir transportation chiper kullanıldığını
bilmeli
One Time Pad
• Tek seferlik Eklenti,
• Kripto gradfide eğer doğru şekilde uygulanırsa
•
•
•
•
•
kırılması imkansız olan sistemdir.
Açık metrşndeki her bir bit, en az kendisi kadar uzun
gizli bir anahtar aracılığı ile modüler toplanır (EXOR).
Çünkü her bir şifreli metin içinde her metin eşit
sıklıkta meydana gelecektir.
Information theory: muhtemel tüm açık anahtarlar eşit
oranda ihtimal dahilindedir.
Kullanılan anahtar tek bir kez kullanışlır.
Pratik problemleri olduğu için uygulanmamıştır.
Quantum crytogrophy
• Photoms davranışları polarize
• Alice polorize 2 küme filter seçer (HF- VF basis)
• Ikincisi 45 derece farklıdır
• Bir cristal aracılığı ile bu yapılı
• Alice 1 ve 0 ın hangi basis olacagına karar verir
rectiLiner basis Vertical 0 horizontal 1
• Diagonal basis
1
0
• Rastgele bir one time pad seçer
• Bit bit veriyi her seferinde rasgtele bir 2 basis bir
tanesini seçer qubits.
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
One-Time Pads (2)
Alice sending Bob a one-time pad with quantum crypto.
• Bob’s guesses yield bits; Trudy misses some
• Bob can detect Trudy since error rate increases
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
Fundamental Cryptographic Principles
1. Messages must contain some redundancy
• All encrypted messages decrypt to something
• Redundancy lets receiver recognize a valid message
• But redundancy helps attackers break the design
2. Some method is needed to foil replay attacks
• Without a way to check if messages are fresh then old
messages can be copied and resent
• For example, add a date stamp to messages
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
Symmetric-Key Algorithms
Encryption in which the parties share a secret key
• DES – Data Encryption Standard »
• AES – Advanced Encryption Standard »
• Cipher modes »
• Other ciphers »
• Cryptanalysis »
CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D.
Wetherall, 2011
Symmetric-Key Algorithms (1)
Use the same secret key to encrypt and decrypt;
block ciphers operate a block at a time
• Product cipher combines transpositions/substitutions
Permutation
(transposition)
box
Substitution
box
Product with multiple P- and S-boxes
Feistel Cipher Structure
• Horst Feistel devised the feistel cipher
• based on concept of invertible product cipher
• partitions input block into two halves
• process through multiple rounds which
• perform a substitution on left data half
• based on round function of right half & subkey
• then have permutation swapping halves
• implements Shannon’s S-P net concept
Feistel Cipher Structure
Feistel Cipher Design Elements
block size
key size
number of rounds
subkey generation algorithm
round function
fast software en/decryption
ease of analysis
Data Encryption Standard (DES)
• most widely used block cipher in world
• adopted in 1977 by NBS (now NIST)
• as FIPS PUB 46
• encrypts 64-bit data using 56-bit key
• has widespread use
• has been considerable controversy over its security
The Data Encryption Standard. (a)General outline. (b)Detail
of one iteration. The circled + means exclusive OR.
DES History
• IBM developed Lucifer cipher
• by team led by Feistel in late 60’s
• used 64-bit data blocks with 128-bit key
• then redeveloped as a commercial cipher with input from
NSA and others
• in 1973 NBS issued request for proposals for a national
cipher standard
• IBM submitted their revised Lucifer which was eventually
accepted as the DES
DES Design Controversy
• although DES standard is public
• was considerable controversy over design
• in choice of 56-bit key (vs Lucifer 128-bit)
• and because design criteria were classified
• subsequent events and public analysis show in fact
design was appropriate
• use of DES has flourished
• especially in financial applications
• still standardised for legacy application use
• Differential or Linear Cryptanalysis
Multiple Encryption & DES
• clear a replacement for DES was needed
• theoretical attacks that can break it
• demonstrated exhaustive key search attacks
• AES is a new cipher alternative
• prior to this alternative was to use multiple encryption with
DES implementations
• Triple-DES is the chosen form
Double-DES?
• could use 2 DES encrypts on each block
• C = EK2(EK1(P))
• issue of reduction to single stage
• and have “meet-in-the-middle” attack
• works whenever use a cipher twice
• since X = EK1(P) = DK2(C)
• attack by encrypting P with all keys and store
• then decrypt C with keys and match X value
• can show takes O(256) steps
Triple-DES with Two-Keys
• hence must use 3 encryptions
• would seem to need 3 distinct keys
• but can use 2 keys with E-D-E sequence
• C = EK1(DK2(EK1(P)))
• nb encrypt & decrypt equivalent in security
• if K1=K2 then can work with single DES
• standardized in ANSI X9.17 & ISO8732
• no current known practical attacks
• several proposed impractical attacks might become basis of future
attacks
Triple-DES with Three-Keys
• although are no practical attacks on two-key Triple-DES
have some indications
• can use Triple-DES with Three-Keys to avoid even these
• C = EK3(DK2(EK1(P)))
• has been adopted by some Internet applications, eg PGP,
S/MIME
(a) Triple encryption using DES. (b) Decryption.