Top Banner
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Ppt on Cryptography-5
Page 2: Ppt on Cryptography-5

Highlighted areasHighlighted areasDefinitionDefinitionTypesTypesAlgorithmsAlgorithmsAn ExampleAn ExampleText generationText generationReceiverReceiverKey generationKey generationCipher text Cipher text generationgenerationProtocolsProtocolsUsesUsesConclusionConclusion

Page 3: Ppt on Cryptography-5

What is Cryptography?What is Cryptography?

This is the This is the art of art of keeping messages keeping messages secretsecret

Page 4: Ppt on Cryptography-5

There are Two types of There are Two types of cryptographycryptography

Page 5: Ppt on Cryptography-5

Secret Key Cryptography-Secret Key Cryptography-

Follows Follows SYMMETRIC ALGORITHMS.• Single key used to Single key used to encrypt and decrypt.encrypt and decrypt.• Key must be known Key must be known by both parties.by both parties.

Page 6: Ppt on Cryptography-5

Public Key Cryptography-Public Key Cryptography-

• Follows ASYMMETRIC ALGORITHMS.• Each entity has 2 keys:Each entity has 2 keys:

private key (a secret)private key (a secret)public key (well known)public key (well known)

Page 7: Ppt on Cryptography-5

Using Keys• Private keys are used for Private keys are used for decrypting.decrypting.• Public keys are used for Public keys are used for encrypting.encrypting.

encryptionencryptionplaintext -----------------plaintext ----------------- ciphertext ciphertext

public keypublic key

decryptiondecryptionCiphertext -----------------Ciphertext ----------------- plaintext plaintextprivate keyprivate key

Page 8: Ppt on Cryptography-5

Algorithms, those are used in Algorithms, those are used in cryptographycryptography

1.DSA1.DSA2.RSA2.RSA3.3.Diffie-Hellman4.4.ElGamal5. ROT136. DES7. RC2 to RC58. IDEA9. Skipjack

Page 9: Ppt on Cryptography-5

Digital Signature Algorithm (DSA)Digital Signature Algorithm (DSA)

• Public key cryptography is also used to Public key cryptography is also used to provide digital signatures.provide digital signatures.

signingsigningPlaintextPlaintext ------------------------------ signed message signed message private keyprivate key

verificationverificationsigned message -------------------signed message ------------------- plaintextplaintext public keypublic key

Page 10: Ppt on Cryptography-5

RSA algorithmRSA algorithmNamed for its three inventors- Rivest, Shamir, and Adleman.

1. n = p q (p & q are prime no’s of equal length)

2. e randomly chosen integer.

3. f = (p-1)(q-1) 4. d = e^-1 mod f

Encrypting: 5. C = P^e (mod n)

Decrypting:6. P = C^d (mod n)

Page 11: Ppt on Cryptography-5

Diffie-Hellman AlgorithmDiffie-Hellman Algorithm

Designed for key exchange.Designed for key exchange.Both parties create session key K.Both parties create session key K.

(g^x mod p)^y mod p =(g^x mod p)^y mod p = (g^x mod p)^x mod p = (g^x mod p)^x mod p =

g^xy g^xy mod pmod p

Page 12: Ppt on Cryptography-5

Alisha:Alisha:Hi Bijay! How are you?Hi Bijay! How are you?

AlishaAlisha BijayBijay

decrypt using same IMAGE as key

encrypt using IMAGE as key

Page 13: Ppt on Cryptography-5

Bijay:Bijay:Hello Alisha.. I’m fineHello Alisha.. I’m fine..

AlishaAlisha BijayBijay

decrypt using same IMAGE as key

encrypt using IMAGE as key

Page 14: Ppt on Cryptography-5

Message DigestMessage Digest•Also known as “Also known as “hash functionhash function” or “” or “one-way one-way transformationtransformation”.”.

•Transforms a message Transforms a message of any length and of any length and computes a fixed computes a fixed length string.length string.

Need of Digest-Need of Digest-•Alisha could just encrypt her Alisha could just encrypt her name, name, and then and then Bijay could decrypt it with Bijay could decrypt it with IMAGEIMAGE

Page 15: Ppt on Cryptography-5

Alisha’s SignatureAlisha’s Signature

•Alisha feeds her original message through a Alisha feeds her original message through a hash function and encrypts the message digest hash function and encrypts the message digest with with IMAGEIMAGE key key

•Bijay can decrypt the message digest using Bijay can decrypt the message digest using IMAGEIMAGE key key

•Bijay can compute the message digest himself.Bijay can compute the message digest himself.

•If the 2 message digests are identicalIf the 2 message digests are identical, Bijay , Bijay knows Alisha sent the message.knows Alisha sent the message.

Page 16: Ppt on Cryptography-5

Revised Scheme

AlishaAlisha BijayBijay

Sign with IMAGE

check signature using IMAGE

encrypt using IMAGE

decrypt using IMAGE

Page 17: Ppt on Cryptography-5

TEXT GENERATIONValue of ASCII#include <stdio.h>#include<string.h>#include<conio.h>

void ascii(char);void main(){ char b[50],i,temp; printf("Enter the character to find the ascii value"); gets(b); printf("%c \n",b); for (i=0;b[i]!='\0';i++) {

{ temp = b[i]; ascii(temp); } getch();}void ascii(char a){ int temp, temp2[8],i=7;temp = b[i]; ascii(temp); } getch();}void ascii(char a){ int temp, temp2[8],i=7; for(temp=0;temp<8;temp++) { temp2[temp] = 0; }temp = (int) a; while(temp>0) { temp2[i]= temp%2; temp=temp/2; i--; } for (i=0;i<8;i++) { printf("%d", temp2[i]); } printf(" ");

Page 18: Ppt on Cryptography-5

HI!HOW ARE YOU

Page 19: Ppt on Cryptography-5

01000011 01010010 01011001

01010000 01010100 01001111

01000111 01010010 01000001

01010000 01001000

Page 20: Ppt on Cryptography-5

TO ENCRYPT THE MESSAGE USE THE IMAGE AS A KEY

Calculate the each Calculate the each pixel value of the pixel value of the image and then image and then XORXORwith the ASCII value with the ASCII value of the message bit.of the message bit.

Page 21: Ppt on Cryptography-5

RECEIVER

Decoder using SYMMETRIC key

1.XOR2.XOR Swap

Page 22: Ppt on Cryptography-5

KEY GENERATION

KEY

IMAGE

MAT LAB

Gray value /intensity value

Page 23: Ppt on Cryptography-5

CIPHER TEXT CONVERSION

Algorithm XOR

AlgorithmSwap (4-bit swap)+X OR operation

Page 24: Ppt on Cryptography-5

Alisha:

Encrypt using Image key

HI! HOW ARE YOU?

HI!HOW ARE YOU

Page 25: Ppt on Cryptography-5

ProtocolsProtocols

Protocols, those are related to Protocols, those are related to cryptography:-cryptography:-

SSLSSLTLSTLSHTTPHTTPPGP……. and many more. and many more

Page 26: Ppt on Cryptography-5

UsesUses

Electronic Electronic commercecommerce

Electronic votingElectronic voting

EmailEmail

Page 27: Ppt on Cryptography-5

ConclusionConclusion Cryptography has

undergone tremendous development since the days it had come into existence some 4000 years ago. Developments are also taking place in the area of digital steganography, quantum cryptography, chaotic cryptosystems etc.

Page 28: Ppt on Cryptography-5