Cryptography and Network Security Cryptography and Network Security
Third Edition Third Edition by William Stallings by William Stallings
Chapter 7
Chapter 7 – – Confidentiality Using Confidentiality Using Symmetric Encryption
Symmetric Encryption
John wrote the letters of the alphabet under the John wrote the letters of the alphabet under the letters in its first lines and tried it against the letters in its first lines and tried it against the message. Immediately he knew that once more he message. Immediately he knew that once more he had broken the code. It was extraordinary the feeling had broken the code. It was extraordinary the feeling of triumph he had. He felt on top of the world. For of triumph he had. He felt on top of the world. For not only had he done it, had he broken the July code, not only had he done it, had he broken the July code, but he now had the key to every future coded
but he now had the key to every future coded message, since instructions as to the source of the message, since instructions as to the source of the next one must of necessity appear in the current one next one must of necessity appear in the current one at the end of each month.
at the end of each month.
—
—Talking to Strange Men, Talking to Strange Men, Talking to Strange Men, Talking to Strange Men, Talking to Strange Men, Talking to Strange Men, Talking to Strange Men, Talking to Strange Men, Ruth RendellRuth RendellRuth RendellRuth RendellRuth RendellRuth RendellRuth RendellRuth Rendell
Confidentiality using Symmetric Confidentiality using Symmetric Encryption
Encryption
• •
traditionally symmetric encryption is used to provtraditionally symmetric encryption is used to prov ide message confidentialityide message confidentiality
• •
consider typical scenarioconsider typical scenario–– workstations on LANs access other workstations & serworkstations on LANs access other workstations & ser vers on LAN
vers on LAN
–– LANs interconnected using switches/routersLANs interconnected using switches/routers –
– with external lines or radio/satellite linkswith external lines or radio/satellite links
• •
consider attacks and placement in this scenarioconsider attacks and placement in this scenario–
– snooping from another workstationsnooping from another workstation –– use dial-use dial-in to LAN or server to snoopin to LAN or server to snoop –
– use external router link to enter & snoopuse external router link to enter & snoop
–– monitor and/or modify traffic one external linksmonitor and/or modify traffic one external links
Confidentiality using Symmetric Confidentiality using Symmetric Encryption
Encryption
• • have two major placement alternatives have two major placement alternatives
• • link encryption link encryption link encryption link encryption link encryption link encryption link encryption link encryption
––encryption occurs independently on every linkencryption occurs independently on every link –
– implies must decrypt traffic between linksimplies must decrypt traffic between links ––requires many devices, but paired keysrequires many devices, but paired keys
• • end end- end end end end end end - - - - - - - to to to to- to to to to - - - - - - - end encryption end encryption end encryption end encryption end encryption end encryption end encryption end encryption
––encryption occurs between original source and encryption occurs between original source and final destination
final destination
Traffic Analysis Traffic Analysis
• • when using end- when using end - to- to - end encryption must le end encryption must le ave headers in clear
ave headers in clear
––so network can correctly route informationso network can correctly route information
• • hence although contents protected, traffic hence although contents protected, traffic pattern flows are not
pattern flows are not
• • ideally want both at once ideally want both at once
––end-end-to-to-end protects data contents over entire end protects data contents over entire path and provides authentication
path and provides authentication
––link protects traffic flows from monitoringlink protects traffic flows from monitoring
Placement of Encryption Placement of Encryption
• • can place encryption function at various can place encryption function at various layers in OSI Reference Model
layers in OSI Reference Model
––link encryption occurs at layers 1 or 2link encryption occurs at layers 1 or 2 ––end-end-to-to-end can occur at layers 3, 4, 6, 7end can occur at layers 3, 4, 6, 7 –– as move higher less information is encryptas move higher less information is encrypt
ed but it is more secure though more comp ed but it is more secure though more comp lex with more entities and keys
lex with more entities and keys
Traffic Analysis Traffic Analysis
• • is monitoring of communications flows is monitoring of communications flows between parties
between parties
––useful both in military & commercial spheresuseful both in military & commercial spheres –
– can also be used to create a covert channelcan also be used to create a covert channel
• • link encryption obscures header details link encryption obscures header details
––but overall traffic volumes in networks and at ebut overall traffic volumes in networks and at end-nd-points is still visiblepoints is still visible
• • traffic padding can further obscure flows traffic padding can further obscure flows
––but at cost of continuous trafficbut at cost of continuous trafficKey Distribution Key Distribution
• • symmetric schemes require both parties symmetric schemes require both parties to share a common secret key
to share a common secret key
• • issue is how to securely distribute this issue is how to securely distribute this key key
• • often secure system failure due to a often secure system failure due to a
break in the key distribution scheme
break in the key distribution scheme
Key Distribution Key Distribution
• • given parties A and B have various key di given parties A and B have various key di key di key di key di key di key di key di stribution
stribution stribution stribution stribution stribution stribution
stribution alternatives: alternatives:
1.1. A can select key and physically deliver to BA can select key and physically deliver to B 2.2. third party can select & deliver key to A & Bthird party can select & deliver key to A & B 3.3. if A & B have communicated previously can uif A & B have communicated previously can u
se previous key to encrypt a new key se previous key to encrypt a new key
4.4. if A & B have secure communications with a tif A & B have secure communications with a t hird party C, C can relay key between A & B hird party C, C can relay key between A & B
Key Distribution Scenario
Key Distribution Scenario
Key Distribution Issues Key Distribution Issues
• • hierarchies of KDC hierarchies of KDC’
’s s required for large net required for large net works, but must trust each other
works, but must trust each other
• • session key lifetimes should be limited for session key lifetimes should be limited for greater security
greater security
• • use of automatic key distribution on behalf use of automatic key distribution on behalf of users, but must trust system
of users, but must trust system
• • use of decentralized key distribution use of decentralized key distribution
• • controlling purposes keys are used for controlling purposes keys are used for
Random Numbers Random Numbers
• •
many uses of random numbersmany uses of random numbersrandom numbersrandom numbersrandom numbersrandom numbersrandom numbersrandom numbers in cryptography in cryptography–– noncesnoncesin authentication protocols to prevent replayin authentication protocols to prevent replay –– session keyssession keys
–
– public key generationpublic key generation –
– keystreamkeystreamfor a one-for a one-time padtime pad
• •
in all cases its critical that these values be in all cases its critical that these values be–– statistically randomstatistically random
•• with uniform distribution, independentwith uniform distribution, independent
Natural Random Noise Natural Random Noise
• •
best source is natural randomness in real world best source is natural randomness in real world• •
find a regular but random event and monitor find a regular but random event and monitor• •
do generally need special h/w to do this do generally need special h/w to do this–– eg. radiation counters, radio noise, audio noise, eg. radiation counters, radio noise, audio noise, thermal noise in diodes, leaky capacitors, mercury thermal noise in diodes, leaky capacitors, mercury discharge tubes etc
discharge tubes etc
• •
starting to see such h/w in new CPU's starting to see such h/w in new CPU's•
•
problems of problems of biasbiasbiasbiasbiasbiasbiasbiasor uneven distribution in signal or uneven distribution in signal–– have to compensate for this when sample and use have to compensate for this when sample and use –– best to only use a few noisiest bits from each sample best to only use a few noisiest bits from each sample
Published Sources Published Sources
• •
a few published collections of random numbers a few published collections of random numbers• •
Rand Co, in 1955, published 1 million numbers Rand Co, in 1955, published 1 million numbers–– generated using an electronic roulette wheel generated using an electronic roulette wheel –– has been used in some cipher designs cfhas been used in some cipher designs cf KhafreKhafre
• •
earlier earlier TippettTippett in 1927 published a collection in 1927 published a collection• •
issues are that:issues are that:–
– these are limitedthese are limited –
– too well-too well-known for most uses known for most uses
Pseudorandom Number Pseudorandom Number Generators (
Generators (PRNGs PRNGs) )
• • algorithmic technique to create “ algorithmic technique to create
“random random numbers
numbers”
”––although not truly randomalthough not truly random
––can pass many tests of “can pass many tests of “randomnessrandomness””
Linear
Linear Congruential Congruential Generator
Generator
• •
common iterative technique using:common iterative technique using:XXn+1n+1 = (= (aXaXnn + + cc) mod ) mod mm
• •
given suitable values of parameters can prodgiven suitable values of parameters can prod uce a long randomuce a long random--like sequencelike sequence
• •
suitable criteria to have are:suitable criteria to have are:–
– function generates a full-function generates a full-periodperiod
–– generated sequence should appear randomgenerated sequence should appear random –– efficient implementation with 32-efficient implementation with 32-bit arithmeticbit arithmetic
• •
note that an attacker can reconstruct sequennote that an attacker can reconstruct sequenUsing Block Ciphers as Stream Using Block Ciphers as Stream Ciphers
Ciphers
• • can use block cipher to generate numbers can use block cipher to generate numbers
• • use Counter Mode use Counter Mode
XXii = = EEKmKm[i][i]• • use Output Feedback Mode use Output Feedback Mode
XXii = E= EKmKm[[XXii--11]]• • ANSI X9.17 PRNG ANSI X9.17 PRNG
––uses date-uses date-time + seed inputs and 3 triple-time + seed inputs and 3 triple-DES DES encryptions to generate new seed & random encryptions to generate new seed & random
Blum Blum
Blum Blum Shub Shub Generator Generator
• •
based on public key algorithmsbased on public key algorithms• •
use least significant bit from iterative equation:use least significant bit from iterative equation:–– xxi+1i+1 = x= xii22 mod n mod n –
– where n=where n=p.qp.q, and primes p,q, and primes p,q=3 mod 4=3 mod 4
• •
unpredictable, passes unpredictable, passes nextnext-nextnextnextnextnextnext---bitbitbitbitbitbitbitbit testtest• •
security rests on difficulty of factoring N security rests on difficulty of factoring N• •
is unpredictable given any run of bits is unpredictable given any run of bits• •
slow, since very large numbers must be usedslow, since very large numbers must be used• •
too slow for cipher use, good for key generation too slow for cipher use, good for key generationSummary Summary
• • have considered: have considered:
––use of symmetric encryption to protect conuse of symmetric encryption to protect con fidentiality
fidentiality
––need for good key distributionneed for good key distribution ––use of trusted third party KDCuse of trusted third party KDC’’ss ––random number generationrandom number generation