The document discusses various topics related to cryptography including:
- Introduction to cryptography including definitions of encryption, decryption and cryptanalysis.
- Types of cryptography including private key cryptography, public key cryptography and hash functions. Comparisons are made between private and public key cryptography.
- Examples of cryptography techniques like Caesar cipher, rail fence cipher, steganography, and the one time pad cipher.
- The overall document provides an overview of cryptography concepts, types and examples to explain the field of cryptography.
4. Copyright IntelliPaat, All rights reserved
Agenda
02 Types of Cryptography
01 Introduction to Cryptography
5. Copyright IntelliPaat, All rights reserved
Agenda
02 Types of Cryptography
01 Introduction to Cryptography
03 Examples of Cryptography
6. Copyright IntelliPaat, All rights reserved
Agenda
02 Types of Cryptography
01 Introduction to Cryptography
03 Examples of Cryptography
04 Ethical Hacking Cryptography: Hands-on
9. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Cryptography?
Cryptography is the study of the various processes which are
implemented to protect information and communications, through the
use of mathematical concepts and rule-based calculations
10. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Cryptography?
Cryptography is the study of the various processes which are
implemented to protect information and communications, through the
use of mathematical concepts and rule-based calculations
Data Mathematics Protected Data
12. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender
13. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender
14. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
15. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
16. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
Intruder
17. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
Intruder
18. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
Intruder
Intruder is able to read
your data
19. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
Intruder
We need some method
to make this data
unreadable by the
intruder
20. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
Why do we need
Cryptography?
Sender Recipient
Email
We do this with
‘Encryption’
22. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Encryption?
Encryption (enciphering) is a cryptographic process where we convert
plaintext or raw data to unintelligible information (cipher) by processing
the data with an algorithm
23. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Encryption?
Encryption (enciphering) is a cryptographic process where we convert
plaintext or raw data to unintelligible information (cipher) by processing
the data with an algorithm
Sender Recipient
Email
plaintext
24. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Encryption?
Encryption (enciphering) is a cryptographic process where we convert
plaintext or raw data to unintelligible information (cipher) by processing
the data with an algorithm
Sender Recipient
Email
cipher
25. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Encryption?
Encryption (enciphering) is a cryptographic process where we convert
plaintext or raw data to unintelligible information (cipher) by processing
the data with an algorithm
Sender Recipient
Email
cipher
26. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Decryption?
Decryption (deciphering) is a cryptographic process where we convert
cipher back to plaintext by processing the data with an algorithm
Sender Recipient
Email
plaintext
28. Copyright IntelliPaat, All rights reserved
Introduction to Cryptography
What is
Cryptanalysis?
Cryptanalysis is the study of deciphering ciphers without knowledge of
the encryption technique
cipher plaintext
35. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Private Key
Cryptography
Private Key Cryptography (Symmetric Key Cryptography) uses a single
common key on the receiving and sending end
36. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Private Key
Cryptography
Private Key Cryptography (Symmetric Key Cryptography) uses a single
common key on the receiving and sending end
Sender Recipient
Email
37. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Private Key
Cryptography
Private Key Cryptography (Symmetric Key Cryptography) uses a single
common key on the receiving and sending end
Sender Recipient
Email
38. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Private Key
Cryptography
Private Key Cryptography (Symmetric Key Cryptography) uses a single
common key on the receiving and sending end
Sender Recipient
Email
39. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Private Key
Cryptography
Private Key Cryptography (Symmetric Key Cryptography) uses a single
common key on the receiving and sending end
Sender Recipient
Email
41. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Cryptography
Public Key Cryptography (Asymmetric Key Cryptography) uses a non
secretive public key for encryption, and a secretive private key for
decryption
Sender Recipient
Email
Public Key Private Key
42. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Cryptography
Public Key Cryptography (Asymmetric Key Cryptography) uses a non
secretive public key for encryption, and a secretive private key for
decryption
Sender Recipient
Email
Private Key
43. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Cryptography
Public Key Cryptography (Asymmetric Key Cryptography) uses a non
secretive public key for encryption, and a secretive private key for
decryption
Sender Recipient
Email
Private Key
44. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Cryptography
Public Key Cryptography (Asymmetric Key Cryptography) uses a non
secretive public key for encryption, and a secretive private key for
decryption
Sender Recipient
Email
45. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
46. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
Single Key Required Two Keys Required
47. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
Single Key Required Two Keys Required
Size of the cipher text is less
than equal to plaintext
Size of the cipher text is
greater than equal to plaintext
48. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
Single Key Required Two Keys Required
Size of the cipher text is less
than equal to plaintext
Size of the cipher text is
greater than equal to plaintext
Fast Encryption, less resources Slow Encryption, high resources
49. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
Single Key Required Two Keys Required
Size of the cipher text is less
than equal to plaintext
Size of the cipher text is
greater than equal to plaintext
Fast Encryption, less resources Slow Encryption, high resources
Used for large data Used for small data
50. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
Single Key Required Two Keys Required
Size of the cipher text is less
than equal to plaintext
Size of the cipher text is
greater than equal to plaintext
Fast Encryption, less resources Slow Encryption, high resources
Used for large data Used for small data
Confidentiality
Confidentiality, Authenticity
and Non-Repudiation
51. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Public Key
Encryption
Vs
Private Key
Encryption
Public Key CryptographyPrivate Key Cryptography
Single Key Required Two Keys Required
Size of the cipher text is less
than equal to plaintext
Size of the cipher text is
greater than equal to plaintext
Fast Encryption, less resources Slow Encryption, high resources
Used for large data Used for small data
Confidentiality
Confidentiality, Authenticity
and Non-Repudiation
Eg: 3DES, AES, DES and RC4
Eg: Diffie-Hellman, ECC, El
Gamal, DSA and RSA
53. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Hash Functions
Functions that convert plaintext into encrypted text are called hash
functions
54. Copyright IntelliPaat, All rights reserved
Types of Cryptography
Hash Functions
Functions that convert plaintext into encrypted text are called hash
functions
f( )=Plaintext Cipher
57. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Substitution:
Caesar Cipher
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
58. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Substitution:
Caesar Cipher
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
FUN
59. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Substitution:
Caesar Cipher
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
FUN N = 3
60. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Substitution:
Caesar Cipher
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
FUN N = 3
61. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Substitution:
Caesar Cipher
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
FUN -> IXQ N = 3
62. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Substitution:
Caesar Cipher
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
FUN -> IXQ N = 3
By shifting the position of each alphabet forward by 3, we are able
to hide the original meaning of the word
63. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
64. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
65. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
66. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
H
67. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
H
E
68. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
H L
E
69. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
H L O F O I T L I A T
E L R M N E L P A
70. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
H L O F O I T L I A T
E L R M N E L P A
HLOFOITLIATELRMNELPA
71. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Transposition
Technique:
Rail-Fence Cipher
HELLO FROM INTELLIPAAT
H L O F O I T L I A T
E L R M N E L P A
HLOFOITLIATELRMNELPA
Since the position of the letters have been changed, this is called a
Transpositional Technique
73. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Steganography
Steganography is the technique of hiding secret data within ordinary
files or messages
74. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Steganography
Steganography is the technique of hiding secret data within ordinary
files or messages
Data
75. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Steganography
Steganography is the technique of hiding secret data within ordinary
files or messages
Data
Image file
76. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Steganography
Steganography is the technique of hiding secret data within ordinary
files or messages
Data
Image file
78. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
79. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
80. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
8 5 12 12 15
81. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
8 5 12 12 15
b x l k d
2 24 12 11 4
82. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
8 5 12 12 15
b x l k d
2 24 12 11 4
83. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
8 5 12 12 15
b x l k d
2 24 12 11 4
10 29 24 23 19
84. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
b x l k d
( 10 29 24 23 19 ) % 26
10 3 24 23 19
85. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
b x l k d
( 10 29 24 23 19 ) % 26
10 3 24 23 19
J C X W S
86. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
b x l k d
( 10 29 24 23 19 ) % 26
10 3 24 23 19
J C X W S
87. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
One Time Pad
(Vernam Cipher)
This is called the ‘One Time’ Pad because the key is uniquely generated
for each new data transfer or communication instance, and is only valid
once
H E L L O
b x l k d
( 10 29 24 23 19 ) % 26
10 3 24 23 19
J C X W S
Cipher
88. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Symmetric:
DES
(Data Encryption
Standard)
89. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Symmetric:
DES
(Data Encryption
Standard)
The Data Encryption Standard (DES) is a symmetric-key block cipher
published by the National Institute of Standards and Technology (NIST)
90. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Symmetric:
DES
(Data Encryption
Standard)
Initial Permutation
Round 1
Round 2
Round 16
Final Permutation
RoundKeyGenerator
64 bit Plaintext
64 bit Cipher
.
.
.
56 bit cipher key
91. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
DES
(Data Encryption
Standard)
Advantages
92. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
DES
(Data Encryption
Standard)
Advantages
Each small change in plaintext drastically affects the cipher
93. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
DES
(Data Encryption
Standard)
Advantages
Each small change in plaintext drastically affects the cipher
Each cipher bit depends on several bits of plaintext
94. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Asymmetric:
RSA
(Rivest–Shamir–
Adleman)
95. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Asymmetric:
RSA
(Rivest–Shamir–
Adleman)
RSA is an asymmetric cryptography algorithm which requires two keys,
private, and public
Any two prime numbers : p & q
N = p * q
e is a derived number greater than 1 and less than
(q-1)(p-1). There should be no common factor for e and (q-
1)(p-1)
The public key is (N,e)
96. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Asymmetric:
RSA
(Rivest–Shamir–
Adleman)
RSA is an asymmetric cryptography algorithm which requires two keys,
private, and public
The private key is d
Calculate d when: ed = 1 mod (p-1)(q-1)
Encryption formula is Cipher = Plaintext * e mod N
Decryption formula is Plaintext = Cipher * d mod N
98. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You create an account on a website
99. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You create an account on a website
(username, password)
100. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You create an account on a website
(username, password)
f(password) =
Encrypted Password
101. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You create an account on a website
(username, password)
f(password) =
Encrypted Password
Encrypted Password stored in
website user database!
102. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You create an account on a website
(username, password)
f(password) =
Encrypted Password
Encrypted Password stored in
website user database!
103. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You log into the website later
104. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You log into the website later
(username, password)
105. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You log into the website later
(username, password)
f(password) =
Encrypted Password
106. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You log into the website later
(username, password)
f(password) =
Encrypted Password
Encrypted Password compared
with the one in the database for
your username
107. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
You log into the website later
(username, password)
f(password) =
Encrypted Password
Encrypted Password compared
with the one in the database for
your username
If it’s a match, you successfully
log into your account!
108. Copyright IntelliPaat, All rights reserved
Examples of Cryptography
Password Storage
Method
Even if an attacker gains access to the user database, the attacker can’t
gain access to your account as the password in the database isn’t in
plaintext format!
f(Encrypted Password) =
Something Entirely Different
f(password) =
Encrypted Password