Ppt on Cryptography-5
-
Upload
peeyush-sinha -
Category
Documents
-
view
114 -
download
4
Transcript of Ppt on Cryptography-5
Highlighted areasHighlighted areasDefinitionDefinitionTypesTypesAlgorithmsAlgorithmsAn ExampleAn ExampleText generationText generationReceiverReceiverKey generationKey generationCipher text Cipher text generationgenerationProtocolsProtocolsUsesUsesConclusionConclusion
What is Cryptography?What is Cryptography?
This is the This is the art of art of keeping messages keeping messages secretsecret
There are Two types of There are Two types of cryptographycryptography
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.
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)
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
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
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
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)
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
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
Bijay:Bijay:Hello Alisha.. I’m fineHello Alisha.. I’m fine..
AlishaAlisha BijayBijay
decrypt using same IMAGE as key
encrypt using IMAGE as key
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
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.
Revised Scheme
AlishaAlisha BijayBijay
Sign with IMAGE
check signature using IMAGE
encrypt using IMAGE
decrypt using IMAGE
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(" ");
HI!HOW ARE YOU
01000011 01010010 01011001
01010000 01010100 01001111
01000111 01010010 01000001
01010000 01001000
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.
RECEIVER
Decoder using SYMMETRIC key
1.XOR2.XOR Swap
KEY GENERATION
KEY
IMAGE
MAT LAB
Gray value /intensity value
CIPHER TEXT CONVERSION
Algorithm XOR
AlgorithmSwap (4-bit swap)+X OR operation
Alisha:
Encrypt using Image key
HI! HOW ARE YOU?
HI!HOW ARE YOU
ProtocolsProtocols
Protocols, those are related to Protocols, those are related to cryptography:-cryptography:-
SSLSSLTLSTLSHTTPHTTPPGP……. and many more. and many more
UsesUses
Electronic Electronic commercecommerce
Electronic votingElectronic voting
EmailEmail
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.