Cryptography 3.4
Cryptography 3.4
Cryptography
Presented By:
Iris Levari
GSECTRA
History of cryptography
Attacks on Cryptography
1. Substitution Cipher
2. Transposition Cipher
3. Running Cipher
4. Concealment Cipher
• The key determines the positions that the characters are moved to.
• Such as (1,2,3,4,5)=(3,4,5,2,1).
• For example:
• “DAVID” “VIDAD”
D A V I D
1 2 3 4 5
3 4 5 2 1
Copyright © 2009 by GSECTRA Ltd.
V All RightsIReserved D A D
Transposition Cipher
Symmetric
Cryptography
DES DES
Encryption Decryption
Same key
(shared secret)
DES
•Developed by IBM in 1972
•Never approved for national security applications
3DES
• Is an interim solution from NIST to provide a stronger
solution than DES…while a stronger, more efficient
algorithm was approved
3DES
3DES works in 4 different modes:
• DES-EEE3
– Uses 3 different keys for encryption
• DES-EDE3
– Uses 3 different keys and it encrypts:
decrypts:encrypts
• DES-EEE2
– Uses 2 different keys and the first and last encryption
use the same key
• DES-EDE2
– Uses 2 different keys and the first and last encryption
use the same key
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
DEMO-DES
AES
Advanced Encryption Standard = Rijndeal
Specified in FIPS 197 (Federal Information Processing
AES - Standard),2001
Symmetric block-cipher (128, 192 or 256 bits) with
variable keys (128, 192 or 256 bits, too)
•Asymmetric Basics
•RSA
•Diffie-Hellman
•ElGamal
Encrypted Message
A Encrypt Decrypt
B
Eavesdropper
• Problems:
– Alice and Bob must agree on the secret key without anyone else
finding out
– Anyone who intercepts the key in transit can later read, modify,
and forge all messages encrypted using that key
Bob Alice
Bob Alice
• Slower…than symmetric
– 100 to 1000 times slower
– Due to the mathematical complexity
associated with asymmetric cryptography
• Key sizes must be relatively large
•RSA is much slower than AES and other symmetric key algorithms
•It has an unlimited adjustable key size
•1024-bit are considered baseline for security, although larger key sizes
(2048-bit and 4096-bit) are recommended.
•As key size increases, computing cost increases.
Preventive – Administrative
Preventive – Technical
Calculat
Calculat Sends Public Secret
Secret Public es
es
a b
p, g p,g
a p, g, A ga mod p, g b
A
p=A
gb mod p, g, A,
a p, g, A B b
p=B B
p, g, A, Ba mod Ab mod p, g, A,
a, s B p=s p=s B b, s
•Merkle-Hellman Knapsack
•Was one of the earliest public key cryptosystems invented by Ralph Merkle and Martin
Hellman in 1978.
Preventive – Technical
•Simpler than RSA but has been broken.
= Symmetric Key
Alice
Bob
Generate
Encrypt Encrypted
Sym Key
Message Message
Encrypt Encrypted
Sym Key Sym Key
= Public Key
Encrypted Decrypt
Message Message
Encrypted Decrypt
Sym Key Sym Key
Small Difference
Large Difference
Preventive
•RIPED – Race Integrity Primitives Evaluation Message– Digest
Technical
•Developed in Belgium in 1990’s.
•Like HAVAL, it’s available in a variety of hash lengths (128 bits, 160 bits, 256 bits, 320
bits) Copyright © 2009 by GSECTRA Ltd.
•Still not widely used like SHA. All Rights Reserved
MIC & MAC
Integrity Control
•Message Integrity Controls (MIC):
•Detect alterations (whether intentional or unintentional) to a message during
transmission.
•MIC = special value that is calculated based on the message contents and added to
the message to be sent.
Integrity & Data Origin Or System Authentication
•PKI Components
•Digital Certificate
•Digital Signatures
•PKI Implementations
•ECC
Digital Certificate
• A digital form of identification
• Similar to a passport or driver’s
licence
• Binds subject’s public key (a
mathematical value) to one or
more attributes relating to their
identity
• A certificate is valid for a period of
time, (often one, three or ten years)
• Certificates can do different things.
• For example:
• Encrypt a document
• Sign a document – for non-
repudiation
• Secure a WWW server
• Provide authentication - Enable the
holder to access a corporate
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
Public-Key Certification
User Certificate
Serial No.
Certificate
User
User Name Database
Name &
other
credentials User’s Email
Signed Address
by using
Certificate CA’s
License issued
User’s Publis by CCA
Request private
Public Key h
User’s key User 1 certificate
Public CA’s Name
key User 2 certificate
Certificate .
Class
Public
Public
Private Validity Web site of CA
Digital
Signature
Key pair of CA
Generation
Dr. Jane
User’s Name
Issuer’s Name
Serial Number
Validity Dates
Extensions
CA’s digital
signature
Alice
Bob
Encrypt Encrypted
Sym Key Sym Key
• Clients
– Software that includes the mechanisms necessary to:
– Properly enforce the trust model of the CA or
– Negotiate a session key
• Certificate Revocation Lists (CRL)
– Certificates revoked by issuing CA are placed into a CRL
– Revoked for several reasons
• Private key lost or compromised
• Certificate owner leaves organization or changes name
• Certificate owner information changes
– CRL is in the open so it can be checked when certificates need to
be validated
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
Certificate Policy Statement
מדיניות הנפקת תעודות
• מסמך עקרונות המתאר את מדיניות אבטחת המידע
הנהוגה בתהליך הנפקת התעודות ותחזוקת המידע
על מצב התעודות.
• מתארת את תחומי פעילות ה.CA -
• מגדירה את אחריות המשתמשים לבקשה ,שימוש
ואחזקה של תעודות ומפתחות.
Digital Signature
Signed Message
Hash Algorithm
Makes “Digest”
Private Key
PIFERQ DIGEST
(%*#%(^%&#*($% Decrypt PP(%@$)C$WEQ%#
“”:EJD*^%()#&#($$ (%*^&#$$%@$@#($$
Make
Public Key
New “Digest”
DIGEST
PP(%@$)C$WEQ%#
=?
(%*^&#$$%@$@#($$
Document
PIFERQ
(%*#%(^%&#*($%
“”:EJD*^%()#&#($$
Encrypted Digest
Sender’s Certificate
Compare
Signed
document
Unique digest
Dr. Jane
Encrypted Digest
Internet Secure
Authentication E-mail
Certificate Services
Software
Software Code Signing
Restriction Policy
… IP Security
•HTTPS
•S-HTTP
•SSL/TLS
•IPSEC
•S/MIME
•PGP
•SSH
• Application independent
• TLS goals are cryptographic security, interoperability, and
extensibility via future security features
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
IPSEC
• A “complex” protocol suite used to set-up a
secure channel between 2 devices
• IPSEC uses 2 basic security protocols:
– AH – Authentication Header
• Authentication protocol
• Protects against malicious modification without protecting
privacy
• Provides integrity and data origin authentication
– ESP – Encapsulating Security Payload
• Authentication and Encryption protocol
• Provides integrity and data origin authentication
• Provides confidentiality using encryption
• Confidentiality
– Protection of data from unauthorized
disclosure
• Key Management
– Generation, exchange, storage,
safeguarding, etc. of keys in a public key
cryptosystem.
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
Internet Security
• SSH – Secure Shell
– Is a protocol that’s currently being standardized by the
IETF
– Allows secure remote access over a network
– A variety of methods can be used to authenticate the
client and server and to establish an encrypted
communication channel between SSH enabled systems
– Connection can then be used to, for example, create a
secure remote login on a server to replace the likes of
Telnet, rlogin, or rsh.
– SSH provides mutual authentication through the use of
public key certificate exchange. (Digital certificate exchange
using RSA)
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
Internet Security
• SET – Secure Electronic Transmission
– Security technology proposed by VISA and MasterCard
for secure credit card transactions
– SET is a cryptographic protocol and infrastructure
developed to send encrypted credit card numbers over
the internet
– Involves the Issuer (cardholder bank), Cardholder,
Merchant (providing goods), Acquirer, and Payment
Gateway
– All entities involved would have to upgrade
hardware/software infrastructure
• תפקידו הוא:
– שמירה על סודיות ההודעות
– שמירה על שלמות ההודעות
– לשמש בקרת גישה )אימות משתמש( – לא לאפשר לתוקף
להשתמש ברשת תוך התחזות למשתמש מורשה
• בפועל – WEP ,אינו ממלא אף אחד מתפקידיו !!!
plaintext ciphertext
Alice Encrypt Decrypt Bob
Mallory Enemy or
Oscar
Eve Adversary
More Reading:
History of Cryptography
David Kahn, “The Codebreakers”
The Science of Secrecy from Ancient Egypt to Quantum
Simon Singh, “The Code Book”
ECB
• The regular DES algorithm
Plaintext Plaintext Plaintext
• Simply encrypts each block of plaintext…one after Plaintext
Block 1 Block 2 Block 3 Block 4
another under the same key
• Message is broken into independent blocks which
are encrypted (64-bit blocks and each block is encrypted one
at a time)
• Each block is a value which is substituted , like a
code-book, hence the name.
• Each block is encoded independently of the other
blocks Ciphertext Ciphertext Ciphertext Ciphertext
Block 2 Block 3 Block 4
• Main use: sending a few blocks of data (terminal) Block 1
• Implementation: ATM PIN encryption & Challenge
•Advantages: •Disadvantages:
•Fast •Repetitions in message may show in ciphertext
•Easy to implement •Weakness due to encrypted message block is
•Each operation can independent
be run in parallel •Identical plaintext blocks result in identical ciphertext
with the same key.
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
DES Operating Modes Cipher Block Chaining mode
CBC
•It XORs each plaintext block with the previous cipher-text block, and then the result is
encrypted with the DES key.
•The first block to be encrypted has no previous ciphertext, so the plaintext is XORed
with a 64-bit Initialization Vector
Plaintext Plaintext Plaintext Plaintext
• This makes all the blocks dependent on all Block 2 Block 3 Block 4
Block 1
the previous blocks
– …though does not reveal a pattern as ECB
does IV
– In order to find the plaintext of a particular
block, you need to know:
• The ciphertext, the key, and the ciphertext for
the previous block
Ciphertext Ciphertext Ciphertext Ciphertext
• More secure than ECB because the extra Block 2 Block 3 Block 4
Block 1
XOR step adds one more layer to the
encryption process.
•Advantages: •Disadvantages:
•Suitable for long messages with •Can only operate on full-sized blocks
many blocks •Each operation must be run in serial
•Identical plaintexts result in different
Copyright © 2009 by GSECTRA Ltd.
ciphertexts All Rights Reserved
DES Operating Modes Cipher Feedback mode
CFB
• Similar to CBC
• IV is encrypted and then XOR’ed with the first plaintext block
• Blocks of plaintext that are less than 64 bit long can be encrypted
• Similar to CBC and is very secure, but it is slower than ECB due to the
added complexity
Plaintext Plaintext Plaintext Plaintext
• CFB mode emulates a Stream Cipher
Block 1 Block 2 Block 3 Block 4
IV
•Advantages:
•Because it is a stream
mode, it can operate on
smaller blocks
•Disadvantages:
Ciphertext Ciphertext Ciphertext Ciphertext
•Each operation must be run Block 1 Block 2 Block 3 Block 4
in serial.
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
DES Operating Modes Output Feedback mode
OFB
• Similar to CFB mode, except that result of encrypting the IV is fed back to the next
operation
– Does not chain the ciphertext
• It means that OFB is operating like a Stream cipher.
• Less secure than CFB mode because only the real ciphertext and DES ciphertext
output is needed to find the plaintext of the most recent block
– Knowledge of the key is not required.
Plaintext Plaintext Plaintext Plaintext
Block 1 Block 2 Block 3 Block 4
2 3 4
1
IV 1 2 3
CTR
• Similar to OFB mode, except a counter value is used instead of an IV
• Like OFB, CTR is operating like a Stream Cipher.
• To allow random access to encrypted data
– The IV plus a constant is encrypted, and the resulting cipher-text XOR’ed with
the plaintext.
– By stepping the IV by 1 for each new block, it is easy to decrypt a block
anywhere in the file without first having to decrypt all of its predecessors.
Plaintext Plaintext Plaintext Plaintext
Block 1 Block 2 Block 3 Block 4
Signature
To the Wire
Reassemble the
Packet with the Signature
Signature
IP HDR Route Update Data
A document can be
digitally signed by
encrypting the hash
value of this
document with a
private key. Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
Common PKI Applications
• Secure E-mail:
– Usage of PKI in e-mail transactions protects the message against someone attempting to read
or change the content of the message.
– With a PKI application, your e-mail is digitally signed by your 'private key' and will be
guaranteed to be unchanged at the recipient side.
• Secure Data Transaction:
– Many companies need a secure way of transferring confidential data. With PKI architecture, the
data is digitally signed and encrypted so that it can be securely transferred via Internet or any
other digital communication platform.
• Secure Web Applications:
– Secure web transaction is a must for companies using Internet or Intranet to distribute data or
services.
– Web services are highly used for communicating with employees, vendors or customers and
security of these transactions has become an important aspect.
– PKI applications provide employees a security ID for getting or sending data via Web.
• Secure Logging On Computer:
– In some cases default user name/password can be non-satisfying and user may need a more
secure way to log on his computer.
– PKI applications enable users to log on their computers with their digital ID's in order to
decrease the risk of attacks.
174
Copyright © 2009 by GSECTRA Ltd.
All Rights Reserved
Transport Mode
Encrypted Tunnel
Gateway 1 Gateway 2
Encrypted
A B