24
Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Presentation Layer

NetworkFormat

LocalFormat

InformationTransformation

“few standards, but a lot of ideas”

Page 2: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Presentation Functions

These are examples!

• Syntax (format) conversion

• Compression

• Encryption– Sub-issue: Does it belong here?

Page 3: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Presentation Layer, cont.

• Providing a way to specify complex data structures

• Managing the set of data structures required

• Converting data between internal and external form

Page 4: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Data Representation

• ASCII vs. EBCDIC

• two’s complement vs. one’s complement

• FFF0 hex is -15 1’s complement; -16 2’s complement

• byte order right left vs. left right

• Text File formats

Page 5: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Abstract Syntax Notation 1 (ASN.1)

• Data Structures• Abstract Syntax• Transfer Syntax• International Standard 8825• Notation used to encode, transfer and decode data

structures across a wide range of applications• Both connection-oriented and connectionless

primitives

Page 6: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Data Compression

• Encoding a Finite Set of Equally Likely Symbols– Finiteness of the set of symbols.

• Frequency Dependent Coding– The relative frequencies with which the

symbols are used.

• Context Dependent Encoding– The context in which a symbol appears.

Page 7: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Compression

• Elimination of Redundancy– (increased susceptibility to error)

• Examples– Run Length Encoding– Predictive Codes– Huffman– LZW

Page 8: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Frequency Dependent Coding

• In English, “E” occurs ~100 times more than the letter “Q”

• So give common symbols short codes and longer symbols longer codes.

• Theoretical minimum encoding often requires fractional bits, but close approximations available.

Page 9: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Huffman Coding

• 1. Write down all symbols and associated probability of each. Eventually a binary tree is built on these nodes, with the symbols representing terminal nodes.

• 2. Find the two smallest nodes and mark them. Add a new node with arcs to each of the nodes just marked. Set the probability of the new node to the sum of the probabilities of the two nodes connected to the new node.

• 3. Repeat until all symbols are marked except one. The probability of the unmarked node will always be 1.0.

• 4. The encoding for each symbol is found by tracing the path from the unmarked symbol to that symbol, recording the sequence of left and right branches taken. The code is the path, left = 0, right = 1.

Page 10: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Context Dependent Encoding

• Uses conditional probability instead of independent probability.

• What is P(u|q)?

• So determine the conditional probability for each possible predecessor and store in a table.

• For k symbols this requires k2 entries.

Page 11: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Network Security and Privacy

• Protecting data from being read by unauthorized persons.

• Preventing unauthorized persons from inserting and deleting messages.

• Verifying the sender of each message.

• Allowing electronic signatures on documents.

Page 12: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Cryptography

• Traditional Cryptography– Substitution Ciphers– Codes– Transposition Ciphers

• Data Encryption Standard• Key Distribution• Public Key Crytography

– MIT Algorithm

• Authentication & Digital Signatures– Federal Standards

Page 13: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Cryptography Users

• Military

• Diplomatic

• Diarists

• Lovers

• Curmugdeons

Page 14: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Cyptography Terms

• Ciphertext or Cryptogram -- encrypted message

• Cryptanalysis -- breaking ciphers

• Cryptography -- devising ciphers

• Cryptology := Cryptanalysis and Cryptography

Page 15: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Encryption Model

Plaintext Plaintext

Key-1Key-2

Ciphertext

Passive Listener

Active Intruder

Page 16: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Keys

• If Key-1 is the same as Key-2, then it has to be a secret key process. They can differ, making it a Public Key Process.

• Big Problems: key distribution and key security

Page 17: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Fundamental Truths of Cryptology

• Potential intruders know the general encryption method.

• Message contents may be guessed.

• Cryptographic systems may be changed, but rarely are.

• Non-technical compromises always outnumber successful cryptanalysis.

Page 18: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Ciphers

• Substitution (preserve order, disquise)– Caesar code = “shift 4”– Alphabet shifted by k letters --”enigma”– Exhaustive search infeasible– Words and phrases may be guessed

• Codes– Purple code, Japanese translated into Latin– Navajo talkers

• Transposition Ciphers (reorder, do not disguise)– Game is up when key length is guessed– Once close, easy to guess

Page 19: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Data Encryption Standard

• Developed by IBM in 1977

• Implemented in hardware

• Widely used

• 128 bit key proposed, 56 bit key specifiedAny guesses why?

Page 20: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Public Key Encryption

• Applying the decryption key to an encrypted message must return the plaintext message.

• The decryption key can’t be guessed from an encyption key.

• The encryption key cannot be broken by a plaintext attack.

• Key Point: the decryption key must be privately held.

Page 21: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

RSA Algorithm

• 1. Choose two large primes, p and q, each greater than 10100

.

• 2. Compute n = p * q and z = (p - 1) * (q - 1).

• 3. Choose a number relatively prime to z and call it d.

• 4. Find e such that e * d = 1 mod z.

Page 22: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Implementation of the MIT Algorithm

• To encrypt– divide plaintext P into k bits where k is the largest integer for

2k < n.

– compute C = Pe(mod n)

• To decrypt– P = Cd

(mod n)

• Encryption requires e and n (public key)• Decryption requires d and n (private key)• If n can be factored, then this yields p an q, then z.• Euclid’s Algorithm will derive e and d from z.

Page 23: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Digital Signatures

• A’s secret key must remain secret

• B has A’s public key and A has B’s public key

• B received a encypted message from A that he decypts with A’s public key

• B can later show that lacking A’s private key that he could not have produced the encrypted message

Page 24: Presentation Layer Network Format Local Format Information Transformation “few standards, but a lot of ideas”

Politics of Cryptography

• Software as Munition

• “Clipper” Chip

• Digital Telephony Bill

• Digital Signature Standard

• Other Countries

• Current Legislation