Upload
maurice-patterson
View
214
Download
1
Embed Size (px)
Citation preview
COMP3123 COMP3123 Internet SecurityInternet Security
Richard HensonRichard Henson
University of WorcesterUniversity of Worcester
October 2011October 2011
Week 2: CryptographyWeek 2: Cryptography Objectives:Objectives:
Describe a simple mathematical Describe a simple mathematical operation that could encrypt a text operation that could encrypt a text messagemessage
Explain the differences between Explain the differences between symmetric and asymmetric encryptionsymmetric and asymmetric encryption
Apply public-private key encryption to Apply public-private key encryption to the sending of Internet emailthe sending of Internet email
Explain why digital signatures are Explain why digital signatures are necessary in the real world, and how necessary in the real world, and how they can be implementedthey can be implemented
Cryptography: an Answer Cryptography: an Answer to the problem of Data to the problem of Data
BreachesBreaches Objective: make it impossible for Objective: make it impossible for
the information to be read by the information to be read by “outsiders”…“outsiders”…
Nothing new!Nothing new!been happening for millennia…been happening for millennia…many clever techniques devisedmany clever techniques devised
Technique of changing digital data in a Technique of changing digital data in a mathematical reversible way known as mathematical reversible way known as ENCRYPTIONENCRYPTIONstudies involving encryption - cryptographystudies involving encryption - cryptography
What is Cryptography?What is Cryptography? Cryptography is the science concerned with Cryptography is the science concerned with
the protocols, practices, procedures to build the protocols, practices, procedures to build components that make up a components that make up a cryptosystemcryptosystem
The practical (intended) result… safely The practical (intended) result… safely securing, storing, transmitting sensitive securing, storing, transmitting sensitive informationinformation to conceal it from unauthorised personsto conceal it from unauthorised persons also applies to personal and financial data…also applies to personal and financial data…
Associated concepts:Associated concepts: authenticity (proof of ownership)authenticity (proof of ownership) integrity (ensuring that data is not tampered integrity (ensuring that data is not tampered
with)with)
OSI layers and the OSI layers and the cryptosystemcryptosystem
All layers, and communications between All layers, and communications between them, are potential weaknessesthem, are potential weaknesses
Hacking could occur:Hacking could occur:at layer 1at layer 1
» e.g. electronically, in communications equipmente.g. electronically, in communications equipment
or at layer 7…or at layer 7…» Screen displayScreen display
In both cases, encryption will be a good In both cases, encryption will be a good defencedefence
How to focus security How to focus security resources?resources?
Depends on:Depends on: Circumstances – how much data Circumstances – how much data
has to be stored/processed in a has to be stored/processed in a given timegiven time
Risk – what is the likelihood of Risk – what is the likelihood of being hacked, losing business, being hacked, losing business, and being fined…and being fined…
Value of information – financial Value of information – financial data obviously valuable, but so data obviously valuable, but so are e.g. commercial secretsare e.g. commercial secrets
Message AuthenticationMessage Authentication Objective: ensuring that the Objective: ensuring that the
message arrives:message arrives:intact & unmodified (integrity)intact & unmodified (integrity)original authorship established original authorship established
(authenticity)(authenticity)
Authentication scheme:Authentication scheme:inputs: secret key, messageinputs: secret key, messageoutput: message & authentication codeoutput: message & authentication code
Encryption and Data Encryption and Data ProtectionProtection
Principle 7 of the 1984 (updated 1998) Principle 7 of the 1984 (updated 1998) UK Data Protection Act:UK Data Protection Act: ““Appropriate technical and organisational Appropriate technical and organisational
measures shall be taken against measures shall be taken against unauthorised or unlawful processing of unauthorised or unlawful processing of personal data and against accidental loss or personal data and against accidental loss or destruction of, or damage to, personal destruction of, or damage to, personal data.”data.”
No better technical measure to take No better technical measure to take than than encryptingencrypting that data that data
Key Escrow and Key Escrow and Key RecoveryKey Recovery
EscrowEscrow: a system of checks and : a system of checks and balances to ensure that privacy rights balances to ensure that privacy rights are not infringed where agencies need are not infringed where agencies need to get hold of encrypted informationto get hold of encrypted information separate agencies keep complementary separate agencies keep complementary
components of the key system so no entity components of the key system so no entity possesses a usable keypossesses a usable key
law enforcement agencies can only law enforcement agencies can only intervene to get all components:intervene to get all components:» under a court order in pursuit of criminal evidence under a court order in pursuit of criminal evidence
or activityor activity
What about HTML What about HTML “Forms” type data“Forms” type data
Anything from Facebook messages to Anything from Facebook messages to personal details to get car insurancepersonal details to get car insurance
As discussed last week…As discussed last week… Internet was Internet was designeddesigned to be an “open” system to be an “open” system IDs of devices based on IP addressIDs of devices based on IP address Screen data converted via TCP/IP to signals and Screen data converted via TCP/IP to signals and
sent in packets - easily be intercepted by:sent in packets - easily be intercepted by:» someone with a good knowledge of TCP/IPsomeone with a good knowledge of TCP/IP» any IT literate person with the appropriate softwareany IT literate person with the appropriate software
this someone could be anywhere in the this someone could be anywhere in the world!world!
What about email data?What about email data? As with HTML forms…As with HTML forms… That email data at rest or moving That email data at rest or moving
round the Internet started on round the Internet started on someone's computer (application someone's computer (application layer)layer)once it has become TCP/IP packets on once it has become TCP/IP packets on
the Internet it is fair game for “man in the Internet it is fair game for “man in the middle” attacksthe middle” attacks
at each end of the communication it is at each end of the communication it is also vulnerable to copyingalso vulnerable to copying
How does Encryption How does Encryption work?work?
Unencrypted data (or PLAIN text) sent Unencrypted data (or PLAIN text) sent over the Internet usually a sequence over the Internet usually a sequence of ASCII codesof ASCII codesASCII code generated at keyboard by ASCII code generated at keyboard by
converting a selected keyboard character converting a selected keyboard character into a particular binary numberinto a particular binary number
This puts further coding onto each This puts further coding onto each ASCII character in some reversible ASCII character in some reversible way before it is sent (as CIPHER text) way before it is sent (as CIPHER text)
An Encryption systemAn Encryption system
Requirements…Requirements…a coding method (often a a coding method (often a
mathematical operation)mathematical operation)a numerical value used with the a numerical value used with the
coding methodcoding method The ASCII codes can always be The ASCII codes can always be
recovered by someone who knows recovered by someone who knows the encryption methodthe encryption method
Simple Encryption Simple Encryption ExampleExample
Coding Method Coding Method (or Algorithm) based on (or Algorithm) based on a mathematical operation a mathematical operation e.g. ADDe.g. ADD
KeyKey based on a numerical digit based on a numerical digit e.g 5 e.g 5
Data represented by an ASCII code…Data represented by an ASCII code… not secure… very widely knownnot secure… very widely known
ASCII code -> via algorithm + key -> ASCII code -> via algorithm + key -> encrypted data encrypted data
Example encryption in Example encryption in practice on ASCII codes…practice on ASCII codes…
Method of encryption – add 5 to each ASCII Method of encryption – add 5 to each ASCII code (this would be the key)code (this would be the key) e.g. plain text = HELLO (ASCII codes 48 45 4B e.g. plain text = HELLO (ASCII codes 48 45 4B
4B 4F)4B 4F) e.g. cipher text = MJQQT (ASCII codes 4D 4A e.g. cipher text = MJQQT (ASCII codes 4D 4A
50 50 54)50 50 54) Getting the original data back would mean Getting the original data back would mean
subtracting 5 from each ASCII character – subtracting 5 from each ASCII character – very easy to anyone with access to the keyvery easy to anyone with access to the key
Managing a single Managing a single Encryption KeyEncryption Key
The coding method and the key used The coding method and the key used to produce cipher text must be known to produce cipher text must be known in order to get back the plain textin order to get back the plain text
However, theseHowever, these must must be kept secret be kept secret – anyone with access to the key and – anyone with access to the key and the algorithm can readily decrypt the the algorithm can readily decrypt the encrypted data for themselvesencrypted data for themselves
DiagramDiagram – single key – single key encryptionencryption
User sends message
via server
server
key
Data is transmitted to
another server
key
Message is coded
Message is decoded
Message is received
Effectiveness of Effectiveness of EncryptionEncryption
Only effective if:Only effective if: either the key remains secreteither the key remains secret or the algorithm remains secretor the algorithm remains secret
During WWII, the Germans thought they During WWII, the Germans thought they had an encryption method that was had an encryption method that was impossible to decipherimpossible to decipher
With the efforts of the Mathematicians With the efforts of the Mathematicians at Bletchley Park, the key and algorithm at Bletchley Park, the key and algorithm were were bothboth deciphered deciphered
Encryption TechniquesEncryption Techniques Many techniques have been developed to Many techniques have been developed to
enable digital data to be efficiently enable digital data to be efficiently encrypted and decryptedencrypted and decrypted
Examples:Examples: DES (Data Encryption Standard)DES (Data Encryption Standard) IDEA (ID Encryption Algorithm)IDEA (ID Encryption Algorithm) RSA (Rivest, Shamir, Adleman)RSA (Rivest, Shamir, Adleman) Diffie-HellmannDiffie-Hellmann
These can be classified into two types:These can be classified into two types: Symmetric KeySymmetric Key Asymmetric KeyAsymmetric Key
Symmetric EncryptionSymmetric Encryption TheThe single, common key single, common key used by used by
both sender and receiver is known both sender and receiver is known as a as a symmetric keysymmetric keyencrypts and decrypts the messageencrypts and decrypts the message
Advantages: Advantages: simple and fastsimple and fast Disadvantages:Disadvantages:
the two parties must the two parties must need toneed to exchange exchange the key in a secure waythe key in a secure way
the sender cannot easily be the sender cannot easily be authenticatedauthenticated
Asymmetric?Asymmetric?
Asymmetric Key (two keys…)Asymmetric Key (two keys…)Encryption: shared public keyEncryption: shared public keyDecryption: unshared private Decryption: unshared private
keykeyOne way functionOne way function
DES – an example of DES – an example of symmetric encryptionsymmetric encryption
IBM/US gov, 1974-7; IBM/US gov, 1974-7; still popularstill popular 56-bit encryption working on 64-bit blocks of 56-bit encryption working on 64-bit blocks of
datadata However, in view of recent research, clearly However, in view of recent research, clearly
inadequate for really secure encryptioninadequate for really secure encryption“Using P2P architecture and over 100,000
participants (using only idle CPU time), distributed.net was able to test 245 billion keys per second to break the 56 bit DES encryption algorithm in less than 24 hours (22 hours and 15 minutes).”
What levels of single key What levels of single key encryption are available?encryption are available?
The more complex the key, the more difficult The more complex the key, the more difficult the encryption method is to decipherthe encryption method is to deciphera single 40-digit key can be a single 40-digit key can be
mathematically deduced very quickly using mathematically deduced very quickly using a computera computer» known as WEAK encryptionknown as WEAK encryption
an equivalent 128-digit key would take an equivalent 128-digit key would take much longer to “crack”much longer to “crack”» known as STRONG encryptionknown as STRONG encryption
It makes sense to use 128-digit key It makes sense to use 128-digit key encryption if at all possible….encryption if at all possible….
Making Encryption as Making Encryption as Effective as PossibleEffective as Possible
Commercial products may offer trade offs… Commercial products may offer trade offs… Strong encryption may cost a little moreStrong encryption may cost a little more
Is the extra expense going to be justified?Is the extra expense going to be justified? e.g. Verisign 40-bit SSLe.g. Verisign 40-bit SSL
» actually 128-bit within USactually 128-bit within US» 40-bit for any communications that go outside US 40-bit for any communications that go outside US
borders…borders… e.g.e.g. Verisign Global Server SSLVerisign Global Server SSL
» ““the world’s strongest encryption”the world’s strongest encryption”» standard for large-scale online merchants, banks, standard for large-scale online merchants, banks,
brokerages, health care organisations and insurance brokerages, health care organisations and insurance companies worldwidecompanies worldwide
Verisign product will Verisign product will run on serverrun on servers s fromfrom::» any non-U.S. software vendorany non-U.S. software vendor» a U.S. software vendor properly classified by the U.S. a U.S. software vendor properly classified by the U.S.
Department of CommerceDepartment of Commerce
Breaking an Breaking an Encryption TechniqueEncryption Technique
Usually achieved with the aid of very Usually achieved with the aid of very powerful computerspowerful computers
The more powerful the computer, the The more powerful the computer, the more likely that the key can be more likely that the key can be mathematically deducedmathematically deduced
Until fairly recently, a 128-bit encryption Until fairly recently, a 128-bit encryption key would have been considered to be key would have been considered to be secure secure
However, a research team have now However, a research team have now succeeded in breaking 128 bit encryption succeeded in breaking 128 bit encryption in seconds, using a supercomputer…in seconds, using a supercomputer…
Secure Keys for Secure Keys for Today and Tomorrow…Today and Tomorrow…
256-bit encryption is probably now a 256-bit encryption is probably now a minimum for single key encryptionminimum for single key encryption but only a matter of time…but only a matter of time…
512-bit encryption is currently used by 512-bit encryption is currently used by financial institutions to transfer funds financial institutions to transfer funds electronically via the Internetelectronically via the Internet again, only a matter of time before even again, only a matter of time before even
this can be cracked…this can be cracked… Solution - 1024 bit keys?Solution - 1024 bit keys?
Authentication – encryption alone Authentication – encryption alone may not be enough, or even helpfulmay not be enough, or even helpful
When data is on the move to a computer or When data is on the move to a computer or device OUTSIDE a particular domain, there device OUTSIDE a particular domain, there must be a technique for verifyingmust be a technique for verifying that that thethe user user reallyreally who he or she claims to be who he or she claims to be
In paper correspondence, authentication is In paper correspondence, authentication is provided by a signatureprovided by a signature
A number of digital methods of signature are A number of digital methods of signature are now availablenow available
Windows 2000 provides SIGVER (file signing)Windows 2000 provides SIGVER (file signing) a method of checking incoming files to ensure a method of checking incoming files to ensure
that they are from a Microsoft approved sourcethat they are from a Microsoft approved source
Asymmetric (Asymmetric (twotwo key) encryptionkey) encryption
Announced in 1976 byAnnounced in 1976 by Diffie andDiffie and Hellman (US), but Hellman (US), but British scientists were secretly working on it much British scientists were secretly working on it much earlier and Ellis, at GCHQ made the first earlier and Ellis, at GCHQ made the first breakthrough in 1970breakthrough in 1970
UUses two keysses two keys:: public keypublic key - - known to everyoneknown to everyone private orprivate or secret keysecret key - - known only to the recipient of the known only to the recipient of the
messagemessage Example: Example: John wants to send a secure message to John wants to send a secure message to
JaneJane…… HHe uses Jane's public key to encrypt thee uses Jane's public key to encrypt the messagemessage Jane then uses her private key to decrypt itJane then uses her private key to decrypt it
Original method did not support either encryption or Original method did not support either encryption or digital signatures, and therefore was vulnerable to digital signatures, and therefore was vulnerable to third party in the middle eavesdroppersthird party in the middle eavesdroppers
Public Key Encryption Public Key Encryption (PKE)(PKE)
Unencrypted data
Decrypted dataEncrypted data
Encrypted data
can work in two ways:• private key encryption, public key decryption• public key encryption, private key decryption
Private key on sender’s computer
Data sent through the Internet
Received byrecipient’s computer
Public key on recipient computer
TThe public and private keys he public and private keys must bemust be related in such a way that related in such a way that only the public key can be used to encrypt only the public key can be used to encrypt
messages messages only the corresponding private key can be only the corresponding private key can be
used to decrypt them.used to decrypt them. In theory it is virtually impossible to In theory it is virtually impossible to
deduce the private key if you know the deduce the private key if you know the public keypublic key
PKE is also called PKE is also called asymmetricasymmetric encryption encryption because it uses two keys instead of onebecause it uses two keys instead of one
Public Key Encryption Public Key Encryption (PKE)(PKE)
Authentication of sender is ALSO Authentication of sender is ALSO needed for securely transmitting needed for securely transmitting information via the Internetinformation via the Internet
A variety of techniques have been A variety of techniques have been developed to achieve this:developed to achieve this:Pretty Good Privacy (PGP)Pretty Good Privacy (PGP)Digital Certificates & Public Key Digital Certificates & Public Key
Infrastructure (PKI)Infrastructure (PKI)
Practical Public Key Practical Public Key EncryptionEncryption
PGPPGP (Pretty Good Privacy) (Pretty Good Privacy) Developed by Philip ZimmermanDeveloped by Philip Zimmerman
official repository official repository held held at the Massachusetts Institute at the Massachusetts Institute of Technologyof Technology
OOne of the most common ways to protect ne of the most common ways to protect messages on the Internmessages on the Internet:et: EffectiveEffective easy to useeasy to use freefree
based on the public-key methodbased on the public-key method with authentication using a “web of trust”with authentication using a “web of trust”
To encrypt a message using PGP, the receiver To encrypt a message using PGP, the receiver needs the PGPneeds the PGP encryption packageencryption package made available for free made available for free download download from a number of from a number of
Internet Internet sourcessources
PGPPGP SSuch an effective encryption tool that uch an effective encryption tool that
the U.S. government actually brought a the U.S. government actually brought a lawsuit against Zimmermanlawsuit against Zimmerman
Case:Case: he he mmade PGPade PGP public public hence mahence madede it available to enemies of the it available to enemies of the
U.S.U.S. After a public outcry, U.S. lawsuit was After a public outcry, U.S. lawsuit was
droppeddropped still illegal to use PGP in many other still illegal to use PGP in many other
countriescountries
Digital Signatures/Digital-Digital Signatures/Digital-IDsIDs
AA unique 'security code' appended to an unique 'security code' appended to an electronic documentelectronic document the digital equivalent of a signature on a the digital equivalent of a signature on a
paper documentpaper document» authenticates the sender authenticates the sender » permits the authenticity of the document to be permits the authenticity of the document to be
provenproven also used the ensure the integrity of the also used the ensure the integrity of the
message sentmessage sent Digital Signatures are supplied Digital Signatures are supplied
packaged within a digital certificate packaged within a digital certificate
Digital CertificateDigital Certificate
A randomly generated number:A randomly generated number:used to create the public-private key used to create the public-private key
pairpairCreates the attachment to an electronic Creates the attachment to an electronic
message known as a digital signaturemessage known as a digital signature An individual wishing to send an An individual wishing to send an
encrypted email message applies for encrypted email message applies for a digital certificate from a Certificate a digital certificate from a Certificate Authority (CA)Authority (CA)
Certificate AuthoritiesCertificate Authorities
Example: verisign Example: verisign www.verisign.comwww.verisign.com
TTrusted third-party organizationrusted third-party organizationss that that issues issues the the digital certificates used to digital certificates used to create public-private key pairscreate public-private key pairs
The role of the CA is to guarantee that the The role of the CA is to guarantee that the individual granted the unique certificate individual granted the unique certificate is, in fact, who he or she claims to be.is, in fact, who he or she claims to be.
Usually, this means that the CA has an Usually, this means that the CA has an arrangement with a financial institution, arrangement with a financial institution, such as a credit card companysuch as a credit card company
The finance company The finance company provides it with provides it with information to confirm an individual's information to confirm an individual's claimed identityclaimed identity
CAs are a critical component in data CAs are a critical component in data security and esecurity and e--commerce because they commerce because they guarantee that the two parties exchanging guarantee that the two parties exchanging information really information really are are who they claim to bewho they claim to be
Certificate AuthoritiesCertificate Authorities
On request, a On request, a CA CA can produce can produce an encrypted an encrypted digital certificate digital certificate for any applicantfor any applicant
Digital certificates Digital certificates containcontain:: the applicant's pthe applicant's privaterivate key key a a digital signaturedigital signature
The CA makes its own public key readily The CA makes its own public key readily availableavailable on the Interneton the Internet
The recipient of the encrypted message The recipient of the encrypted message can can use the CA's public key to decode the use the CA's public key to decode the digital certificate attached to the messagedigital certificate attached to the message
Supplying Supplying Digital Digital CertificateCertificatess
TheThe recipient: recipient:verifverifies the digital signatureies the digital signature as issued as issued
by the CA by the CA obtains the sender's public key andobtains the sender's public key and
digital signaturedigital signature held within the held within the certificatecertificate
With this information, theWith this information, the recipient recipient can send an encrypted replycan send an encrypted reply
TThis procedure relies on the his procedure relies on the integrity integrity of the CA, of the CA, and the userand the user must be able tomust be able to trust trust thethemm
Digital CertificateDigital Certificate (continued)(continued)
Digital Signatures: an Digital Signatures: an increasing role in society…increasing role in society…
DDigital signatureigital signaturess allow online delivery of allow online delivery of traditionally paper based correspondencetraditionally paper based correspondence ContractsContracts Government forms such as tax returnsGovernment forms such as tax returns anything else that would require a hand-written anything else that would require a hand-written
signature for authentication…signature for authentication… The flip side of this is that information The flip side of this is that information
submitted WITHOUT a digital signature has submitted WITHOUT a digital signature has NOT been authenticated, and a further means NOT been authenticated, and a further means of proof of identity of sender should be soughtof proof of identity of sender should be sought
Authentication, Identity, and Authentication, Identity, and Identity TheftIdentity Theft
Authentication alone is not enoughAuthentication alone is not enoughusername/password may be stolen (or username/password may be stolen (or
even borrowed with permission!)even borrowed with permission!) Need proof:Need proof:
something only that person would know…something only that person would know…something unique to that person Biometric something unique to that person Biometric
data) data) More on this later…More on this later…