Professional Documents
Culture Documents
Cryptography
Group Members:
Muhammad Abdullah [FA19-BCS-033]
Abdul Raheem [FA19-BCS-108]
Emaan Asif [FA19-BCS-116]
Emaan Asif
FA19-BCS-116
Secure Communication
Needs and Requirements
• Well established needs for secure communication
– War time communication
– Business transactions
Key A Key B
ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZABC
Key (3)
Decryption
Cipher Text Plain Text
Cipher:
Message: Caesar Cipher Message:
Dwwdfn Dw Gdyq Algorithm Attack at Dawn
Key (3)
Muhammad Abdullah
FA19-BCS-033
Substitution Cipher
Monoalphabetic Cipher
• Any letter can be substituted for any other letter
– Each letter has to have a unique substitute
AB CD EFG H I J K LM N OPQRSTUVWXYZ
Key
Substitution Cipher
Polyalphabetic Caesar Cipher
• Developed by Blaise de Vigenere
– Also called Vigenere cipher
• Uses a sequence of monoalpabetic ciphers in tandem
– e.g. C1, C2, C2, C1, C2
C1(k=6) F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
C2(k=20) T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
• Example
Message:
Cipher:
Encrypted
Message:
Bob, how are you. Monoalphabetic Gnu, n etox dhz.
Alice Cipher tenvj
Key
Substitution Cipher
Using a key to shift alphabet
• Obtain a key to for the algorithm and then shift the alphabets
– For instance if the key is word we will shift all the letters by four and
remove the letters w, o, r, & d from the encryption
• We have to ensure that the mapping is one-to-one
– no single letter in plain text can map to two different letters in cipher text
– no single letter in cipher text can map to two different letters in plain text
Message:
Encrypted
Cipher: Message:
Bob, I love you.
??
Alice
WORD
Transposition Cipher
Columnar Transposition
• This involves rearrangement of characters on the plain text into columns
• The following example shows how letters are transformed
– If the letters are not exact multiples of the transposition size there may be a
few short letters in the last column which can be padded with an infrequent
letter such as x or z
Plain Text Cipher Text
T H I S I T S S O H
S A M E S O A N I W
S A G E T H A A S O
O S H O W L R S T O
H O W A C I M G H W
O L U M N U T P I R
A R T R A S E E O A
N S P O S M R O O K
I T I O N I S T W C
W O R K S N A S N S
Symmetric Encryption
Limitations
• Any exposure to the secret key compromises
secrecy of ciphertext
• A key needs to be delivered to the recipient of the
coded message for it to be deciphered
Asymmetric Encryption
Basics
• Uses a pair of keys for encryption
– Public key for encryption
– Private key for decryption
• Messages encoded using public key can only be decoded by
the private key
– Secret transmission of key for decryption is not required
– Every entity can generate a key pair and release its public key
1. Authentication
A digital signature gives the receiver reason to trust that the message was created and
sent by the desired sender. And It is not been altered between the sender and receiver
by any third person.
2. Non_repudaion
With the help of a digital signal, the sender will be unable to deny the fact that he sent
this message. Organizations used it for the transfer of sensitive data.
3. Integrity
A digital signature makes sure that the receiver receives the file in an original format
having a digital signature. It is helpful in software distribution and financial
transactions.
Digital Signature
Hash Function
Hash Function:
A hash function is a technique or process of converting data of any length to a proper fixed
length. The values that are returned from a hash function are known as hash values, digest
messages or even we can call them hashes. We can use these values to index a fixed-size table
which is also known as Hash Table.
Example:
Full Name: Abdul Raheem
Hash Value(SHA256):
534c6b27548fd6275fdc67b22de3f4bd6449e38c60272dd3a012e661aca17303
Digital Signature
Working
There are two software engineers Bob and Alice living in two different areas and want
to transfer the data with each other.
Bob sends a module having code source to Alice with his digital signature. For digital
signature, Bob used asymmetric cryptography in which Bob generates key pair, public
and private key, and then sent that public key to Alice and kept the private key.
After doing so Bob uses the Hash algorithm to generate the digest of the source code
then he encrypts that digest or hash key with his private key that he generated early and
encrypts the hash key with the private key. This encrypted digest is the digital signature
of the source code that Bob sends to Alice. Then he sends both the source code and
digital signature to Alice. As the source code is not encrypted so Alice does not need to
do anything with the source code rather Alice will focus on digital signature more.
Alice then uses the public key given by Bob to decrypt the digital signature. If she is
able to decrypt that digest, then it means the file is sent by Bob but if she was unable to
decrypt the digital signature with the help of a public key that it clearly tells that the
source code is compromised.
To check the integrity of the source code Alice will try to Hash the source code at her
end and if the digest or hash code matches with the hash codes of Bob then it means
the file is original and has not been altered.
Digital Signature
Visual Representation
Digital Certificate
Identity
Information
Signature
Sender’s Certificate
Algorithm
Public Key
Certificate
Authority’s
Private Key
Digital Certificate
Purpose
While on the other hand in Digital Certificates the information is checked and
validated by a trusted CA, which gives them a key that gives a chain of trust to
the certificate. As a result, this certificate will help in the authenticity of any
document, for client authentication, or to provide proof of a website’s
credential that all the data stores or transfer through this website are totally
secured and authentic
Thank You
for your
Attention!