1 of 73

Cryptography

Jay M Joshi

Assistant Prof.

Department of Electronics & Telecomm.

Shri S’ad Vidya Mandal Inst. Of Tech.,

Bharuch-392 001

​

2 of 73

Why Information Security ?

  • Information is a strategic resource

- Traditionally security was provided by physical & administrative means

- Spread of IT requires automated tools to protect files and other stored information

  • Significant portion of organizational budget is spent on managing information
  • There are many types of information

- both stored and processed within a computer

- and transferred between computers

  • Use of networks and communications links requires measures to protect data during transmission

Jay M Joshi

3 of 73

The Need for Security

  • Prior to this “computer era”, information felt to be valuable was protected by physical

and administrative means

Jay M Joshi

4 of 73

Jay M Joshi

Information Systems

  • Have to be available to the people for use
  • Have to be protected (secured) from misuse
  • A balance between availability and protection

5 of 73

Jay M Joshi

Information Systems

  • Information Systems Security is crucial for

- Maintaining the proper balance

  • Allowing proper people to use the system and preventing others from misusing the system

6 of 73

What makes Cyber crime easy

  • Anonymity bestowed by the Internet and the applications
  • The ability to store enormous amounts of data in compact media (CDs) facilitates data theft
  • The difficulty in distinguishing an “original” electronic document from a “copy”

Jay M Joshi

7 of 73

What makes Cyber crime easy

  • The difficulty in ensuring the integrity of an electronic document
  • There is no “physical” characteristic (such as an embossed seal or watermark) to verify authenticity

Jay M Joshi

8 of 73

Definitions

  • Computer Security
    • Collection of tools designed to protect data and to prevent hackers
  • Network Security
    • make sure to protect data during their transmission
  • Internet Security
    • measures to protect data during their transmission over a collection of interconnected networks

​

Jay M Joshi

9 of 73

Jay M Joshi

Message security including cryptography

10 of 73

Goals of Security

  • Provide confidentiality of sensitive information – only intended persons can see the information
  • Authenticate legitimate entities – make sure they are who they claim to be
  • Provide access control - prevent unauthorized entry to information systems

Jay M Joshi

11 of 73

Goals of Security

  • Enforce non-repudiation of transactions – an entity cannot later disavow a transaction
  • Ensure availability of systems and services to legitimate users

​

Jay M Joshi

12 of 73

Jay M Joshi

Security Services in Conventional Transactions

  • Identification – Face to face meetings
  • Authentication – Introduction through mutual acquaintances
  • Confidentiality – Sealed covers, locked boxes
  • Access control – Locks, keys, security personnel

13 of 73

Jay M Joshi

Security Services in Conventional Transactions

  • Integrity – Handwriting, signatures, chemical analysis of paper, watermarks
  • Authorization – Signatures
  • Non-repudiation – Witnesses,

signatures, receipts

  • The trend towards paperless transactions calls for electronic analogues of all these services

14 of 73

Electronic Security Services �and Mechanisms

  • Most mechanisms that provide the services of confidentiality, integrity, authentication, access control and non-repudiation are cryptography based
  • Availability of systems and services requires other mechanisms as well

Jay M Joshi

15 of 73

A Classification of Attacks

  • Most security attacks can be classified into one of the following generic types
    • Interruption
    • Interception
    • Modification
    • Fabrication

Jay M Joshi

16 of 73

Interruption

Jay M Joshi

Source

Destination

​

​

​

  • Attack on availability
  • Denial of service attacks
  • Malicious code such as viruses, worms, Trojans
  • Destruction of hardware or communication lines

​

17 of 73

Interception

​

​

Jay M Joshi

Source

Destination

  • Attack on confidentiality
  • Eavesdropping, wiretapping,

keystroke logging

  • Illicitly acquiring data, software,

personal information about entities

18 of 73

Modification

​

​

​

​

​

Jay M Joshi

Source

Destination

  • Attack on integrity
  • Attacker could modify
    • Data
    • Programs
    • Authentication data

19 of 73

Fabrication

  • Happens due to weak authentication of entities
  • Results in spurious records or false message in a network

​

​

Jay M Joshi

Source

Destination

20 of 73

Active and passive attacks

  • Attacks are also classified as:

- Active attacks where in the information is modified or false information is created

- Passive attacks where in the information is only accessed and analyzed

Jay M Joshi

21 of 73

Jay M Joshi

2

Basic Model of Cryptography

22 of 73

Few Concepts

    • Plaintext : Original, readable message or data.
    • Cipher text : Coded unreadable message or data.
    • Encryption : The art of converting plaintext into cipher text (Scrambling data).
    • Decryption : The art of reverting cipher text back to readable, plaintext (Descrambling data).
    • Cryptography : Algorithm for transforming plaintext to cipher text
    • Cryptanalysis (codebreaking) - the study of principles/ methods of deciphering ciphertext without knowing key
    • Cryptology - The field of both cryptography and cryptanalysis

Jay M Joshi

23 of 73

Cryptography

  • What is a key?
  • Size of the key is one of the measure of the strength of the Crypto
  • Life of the key

Jay M Joshi

24 of 73

Classification

  • Secret Key Cryptography: a cryptographic scheme where the same key is used to encrypt and decrypt.
    • Single key used to encrypt and decrypt.
    • Key must be known by both parties.
  • Public Key Cryptography: a cryptographic scheme where different keys are used for encryption and decryption.
    • asymmetric cryptography
    • public key (well known) used for encryption
    • private key (a secret) used for decryption

Jay M Joshi

25 of 73

Jay M Joshi

Privacy using symmetric-key encryption

26 of 73

Jay M Joshi

Privacy using public-key encryption

27 of 73

Symmetric key encryption : Cipher Types

  • Stream ciphers
  • Block ciphers

Jay M Joshi

block ciphers

block

cipher

plaintext

ciphertext

key

padding

pseudo-random

bit stream generator

+

...

...

plaintext

ciphertext

stream ciphers

seed

28 of 73

Secret Key Cryptography Algorithms

  • Substitution cipher
    • Caesar cipher
    • Mono alphabetic cipher
    • Poly alphabetic cipher
  • Transposition cipher
  • One Time Pads

Jay M Joshi

29 of 73

History of Cryptography

  • The first known evidence of the use of cryptography (in some form) was found in an inscription carved around 1900 BC, in the main chamber of the tomb of the nobleman Khnumhotep II, in Egypt.
  • Around 400 B.C., the Spartans used a system of encrypting information by writing a message on a sheet of papyrus.

​

30 of 73

Substitution Ciphers

  • Around 100 B.C., Julius Caesar was known to use a form of encryption to convey secret messages to his army generals posted in the war front.
  • Each letter or group of letters is replaced by another letter or group of letters to disguise it.
  • Caesar cipher: In this method a becomes D, b becomes E etc.. attack become DWWDFN
  • Slightly generation of caesar cipher allows the cipher text alphabet to be shifted by k letters, instead of always 3

​

Jay M Joshi

31 of 73

Mono-alphabetic Substitution

  • Each of the letter in plaintext in simplicity say 26 symbol, map onto some other letter.
  • For example:

Plaintext:

a b c d e f g h I j k l m n o p q r s t u v w x y z

Ciphertext:

QWERTYUIOPASDFGHJKLZXCVBNM

  • Key:26-letter string attack become QZZQEA

​

Jay M Joshi

32 of 73

  • The first glance this might appear to be a safe system because although the cryptanalyst know the general system, he does not know which of 26!=4*1026 possible keys in use.
  • The basic attack take the advantage of the statistical properties of natural languages.
  • In English, for example, e is the most common letter, followed by t, o, a, n, i, etc.

Jay M Joshi

Cryptanalyst Mono-alphabetic Substitution

33 of 73

Cryptanalyst Mono-alphabetic Substitution

  • The most common two letter combination, or diagrams are th, in, er, re and an. The most common three letter combination, or triagrams, are the, ing and and ion
  • Another approach is to guess a probable word or phrase. For example

CTBMN BYCTC BTJDS QXBNS GSTJC BTSWX CTQTZ CQVUJ QJSGS TJQZZ MNQJS VLNSX VNZUJ JDSTS JQUUS JUBXJ

Common word is financial – repeated character i-4diff, n-1diff, a-3diff

  • XCTQTZCQV

​

Jay M Joshi

34 of 73

Cryptanalyst Mono-alphabetic Substitution

  • X-f, C-i, T-n, Q-a, Z-c, V-l
  • inBMN BYini BnJDS afBNS GSnJi BnSWf inanc ialUJ aJSGS nJacc MNaJS lLNSf lNcUJ JDSnS JaUUS JUBfJ
  • B-t, M-h, N-e
  • inthe tYini tnJDS afteS GSnJi tnSWf inanc ialUJ aJSGS nJacc heaJS lLeSf lecUJ JDSnS JaUUS JUtfJ
  • S-r
  • in the tYini tnJDS after GrnJi tnrW financial UJ aJrGr nJacc heaJr lLerf lecUJ JDrnr JaUUr JUtfJ

Jay M Joshi

35 of 73

Poly-alphabetic Substitution

  • A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets.
  • The first published polyalphabetic cipher was invented by Leon Battista Alberti around 1467. Alberti used a Caesar cipher to encrypt a message, but whenever he wanted to he would switch to a different alphabet, indicating that he had done so by capitalizing the first letter encrypted with the new alphabet.

Jay M Joshi

36 of 73

Poly-alphabetic Substitution

  • The following compact table provides 26 alphabets, each labelled with a letter of the alphabet:

Jay M Joshi

37 of 73

Poly-alphabetic Substitution

  • A progressive-key system, where keys are used one after the other in normal order. The key ABCD...Z was used with regular alphabets in the form depicted therein.
  • The autokey system, where a key starts the choice of alphabet, but the message itself determines the alphabets to use for later parts of the message.

Jay M Joshi

38 of 73

Poly-alphabetic Substitution

The message "Wish you were here" can be encrypted by the three possible methods, using SIAMESE as the keyword:

Straight keyword:

Message: WISHYOUWEREHERE

Key: SIAMESESIAMESES

Cipher: OQSTCGYOMRQLWVW

Progressive key:

Message: WISHYOUWEREHERE

Key: SIAMESETJBNFTFU

Cipher: OQSTCGYPNSRMXWY

Autokey:

Message: WISHYOUWEREHERE

Key: SIAMESEWISHYOUW

Cipher: OQSTCGYSMJLFSLA

Jay M Joshi

39 of 73

Transposition cipher

  • Key is MEGABUCK

Plaintext :pleasetransferonelakhsinmyswissbankaccounttwotwooneoneone

M E G A B U C K

7 4 5 1 2 8 3 6

p l e a s e t r

a n s f e r o n

e l a k h s i n

m y s w i s s b

a n k a c c o u

n t t w o t w o

o n e o n e o n

e

Ciphertext: AFKWAWOSEHICONTOISOWOLNLYNTNESASKTERNNBUONPAEMANOE

Jay M Joshi

40 of 73

Mobile keypad substitution

  • Character replaced by the numerical letter on the mobile key pad, For e.g. A-2, B-22, C-222,D-3.
  • SVMIT,BHARUCH encrypted by
  • £7777 £ 888 £ 6 £ 444 £ 8 £ 11 £ 22 £ 44 £ 2 £ 777 £ 88 £ 222 £ 44

Jay M Joshi

41 of 73

  • Answer: WELCOME

42 of 73

One time pads

  • Choose random bit string as a key, convert the plaintext into a bit string- by using ASCII codes, compute the ex-or of these two strings.
  • The resulting cipher text cannot be broken because every possible candidate is a equally probable candidate.
  • It has number of the practical disadvantages

​

Jay M Joshi

43 of 73

Disadvantage of one time pads

  • Key cannot be memorized, so that both the sender and receiver must carry a written copy with them.
  • The total number of data that can be transmitted can be limited by the amount of key available.
  • If the sender and the receiver get out of synchronization, all data from then on will appear garbled.

Jay M Joshi

44 of 73

Design of Cryptography

​

​

  • The Encryption - Decryption mechanism
  • MUST NOT
    • Add significant overhead
    • Increase bandwidth of the channel
    • Increase error rate
    • Add expensive complexity to the system
  • MUST
    • Cost effective scheme
  • Define security procedures
    • Generation and distribution of keys
    • Exchange information between operators
    • Confidentiality of algorithms

Jay M Joshi

45 of 73

Basic element of ciphers

Jay M Joshi

P-box

3-8 decoder

8-3 encoder

S-box

Permutation

Substitution

46 of 73

Product cipher

Jay M Joshi

P1

P2

P3

P4

S1

S2

S3

S4

S5

S6

S7

S8

S9

S10

S11

S12

47 of 73

Modes of block cipher

  • Modes: Encrypt plaintext of varying length
  • Modes of block cipher
    • ECB (Electronics code book)
    • CBC (Cipher block chaining)
    • CFB (Cipher feedback)
    • OFB (Output feedback)
    • CTR (Counter)
  • Modes of the block cipher should not compromise the security of the underlying algorithm.

48 of 73

Issues

  • Security
    • Concealment of plaintext pattern
    • Input to the cipher should be randomized
    • Manipulation of plaintext
  • Efficiency
    • Size of ciphertext is same as the size of plaintext
    • Pre-processing is possible before plaintext is seen
    • Parallel encryption and/or decryption
  • Fault-tolerance
    • Ciphertext error
    • Synchronization error

49 of 73

ECB- Electronic Codebook

  • Plaintext patterns are not concealed.
  • Input to the block cipher is not randomized;
  • Plaintext is easy to manipulate;
  • Processing is parallelizable.
  • Ciphertext is up to one block longer than the plaintext, due to padding.
  • No preprocessing is possible.
  • A ciphertext error affects one full block of plaintext.
  • Synchronization error is unrecoverable.

50 of 73

CBC- Cipher Block Chaining

  • Ciphertext is up to one block longer than the plaintext,
  • No preprocessing is possible.
  • Processing is not parallelizable; decryption is parallelizable.
  • A ciphertext error affects one full block of plaintext and the corresponding bit in the next
  • block.
  • Synchronization error is unrecoverable.
  • Plaintext patterns are concealed
  • Input to the block cipher is randomized
  • Plaintext is somewhat difficult to manipulate

51 of 73

CFB-Cipher Feedback Mode

  • Plaintext patterns are concealed
  • Input to the block cipher is randomized.
  • Plaintext is somewhat difficult to manipulate
  • Ciphertext is same size as plaintext.
  • Some preprocessing is possible.
  • Encryption is not parallelizable; decryption is parallelizable.
  • Synchronization error is recoverable.

52 of 73

OFB- Output Feedback Mode

  • Plaintext patterns are concealed.
  • Input to the block cipher is randomized.
  • Plaintext is very easy to manipulate
  • Ciphertext is same size as plaintext.
  • Preprocessing is possible before plaintext is seen.
  • Processing is not parallelizable.
  • A ciphertext error affects corresponding bit in the plaintext.
  • Synchronization error is recoverable.

53 of 73

CTR- Counter Mode

  • Plaintext patterns are concealed.
  • Input to the block cipher is randomized.
  • Plaintext is very easy to manipulate
  • Ciphertext is same size as plaintext.
  • Preprocessing is possible before plaintext is seen.
  • Encryption and decryption processes are parallelizable.
  • A ciphertext error affects corresponding bit in the plaintext.
  • Synchronization error is unrecoverable.

54 of 73

Summary

55 of 73

Digital Signature

  • The authenticity of many legal, financial, and other documents is determined by the presence or absence of an authorized handwritten signature.

Jay M Joshi

56 of 73

Message Digest

  • One way hash functions that condense information in a file into a 128/256 bit number
  • Transforms a message of any length and computes a fixed length string.
  • Hard to guess what the message was
  • Properties
    • Every bit of the input influences the function => the smallest change in the input creates a large change in the output.
    • Given an input file and a message digest, it’s computationally infeasible to find another file which will yield the same MD value (avoids collisions)
    • The same MD function will always provide the same digest on a given file (Repeatable)

​

Jay M Joshi

57 of 73

Usage of digests

  • Digital signatures
    • Typically instead of signing the whole document, only the digest is signed.
  • Message Authentication Codes (MACs) – used by most Internet routing protocols.
  • Creation of keys from a textual pass phrase (PGP)
  • Encryption of passwords in a database

​

Jay M Joshi

58 of 73

Common Digest functions

  • MD2 through MD5
    • Developed by Ronald Rivest
    • Produce 128 bit digests
    • Used in SSL

​

  • SHA, SHA1
    • Secure Hash Algorithm
    • Developed by NIST
    • 160 bit digest

​

Jay M Joshi

59 of 73

Email Security

Jay M Joshi

  • PGP (Pretty Good Privacy)
  • PEM (Privacy Enhanced Mail)

60 of 73

Jay M Joshi

MD5-Hash function

RSA algorithm for public key

PGP

61 of 73

PGP (Cont.)

Jay M Joshi

62 of 73

Privacy-Enhanced E-mail

62

  • Encrypted
  • Signed

63 of 73

Cryptography and Digital certificates

  • Cryptography and digital certificates are first appeared in closed commercial, financial network and military systems.
  • We can send/receive secure e-mail, connect to secure website to purchase goods or obtain services.
  • Problem: How do we implement them in this global, open network, Internet?
  • To what level of encryption is sufficient to provide safe and trust services on the Net?

63

64 of 73

Digital Certificates

  • Digital Certificate is a data with digital signature from one trusted Certification Authority (CA).
  • This data contains:
    • Who owns this certificate
    • Who signed this certificate
    • The expired date
    • User name & email address

​

64

65 of 73

Elements of Digital Cert.

  • A Digital ID typically contains the following information:
    • Your public key, Your name and email address
    • Expiration date of the public key, Name of the CA who issued your Digital ID

All copyrights reserved by C.C. Cheung 2003.

65

66 of 73

Certification Authority (CA)

  • A trusted agent who certifies public keys for general use (Corporation or Bank).
    • User has to decide which CAs can be trusted.
  • The model for key certification based on friends and friends of friends is called “Web of Trust”.
    • The public key is passing from friend to friend.
    • Works well in small or high connected worlds.
    • What if you receive a public key from someone you don’t know?

66

67 of 73

CA model (Trust model)

67

  • Root Certificate
  • CA Certificate
  • Browser Cert.
  • CA Certificate
  • Server Cert.

68 of 73

Public Key Infrastructure (PKI)

  • PKI is a system that uses public-key encryption and digital certificates to achieve secure Internet services.
  • There are 4 major parts in PKI.
    • Certification Authority (CA)
    • A directory Service
    • Services, Banks, Web servers
    • Business Users

68

69 of 73

PKI Structure

69

  • Certification Authority
  • Directory services
  • User
  • Services,
  • Banks,
  • Webservers
  • Public/Private Keys

70 of 73

4 key services

  • Authentication – Digital Certificate
    • To identify a user who claim who he/she is, in order to access the resource.
  • Non-repudiation – Digital Signature
    • To make the user becomes unable to deny that he/she has sent the message, signed the document or participated in a transaction.
  • Confidentiality - Encryption
    • To make the transaction secure, no one else is able to read/retrieve the ongoing transaction unless the communicating parties.
  • Integrity - Encryption
    • To ensure the information has not been tampered during transmission.

70

71 of 73

Certificate Signers

CSC1720 – Introduction to Internet

All copyrights reserved by C.C. Cheung 2003.

71

72 of 73

Steganography and watermarking

  • The art of hiding message (“Covered writing”)

​

  • Watermarking

​

73 of 73

Jay M Joshi