CSCL Report
CSCL Report
1.1 Introduction
Cryptography refers to the science and art of transforming messages to make them secure and
immune to attacks. It is a method of storing and transmitting data in a particular form so that
only those for whom it is intended can read and process it. Cryptography not only protects data
from theft or alteration but can also be used for user authentication.
1.2 Components
There are various components of cryptography which are as follows:
Cipher
We refer to encryption and decryption algorithms as ciphers. The term cipher is also used to
refer to different categories of algorithms in cryptography. This is not to say that every sender-
receiver pair needs their very own unique cipher for secure communication. On the contrary,
one cipher can serve millions of communicating pairs.
Key
A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on. To encrypt
a message, we need an encryption algorithm, an encryption key, and plaintext. These create the
ciphertext. To decrypt a message, we need a decryption algorithm, a decryption key, and the
ciphertext. These reveal the original plaintext.
1
Fig.1.2: Types of cryptography key
2
Fig.1.5: Asymmetric key cryptography
Thus, to cipher a given text we need an integer value, known as shift which indicates the
number of positions each letter of the text has been moved down.
Input:
• A String of lower-case letters, called Text.
• An Integer between 0-25 denoting the required shift.
Procedure:
• Traverse the given text one character at a time.
• For each character, transform the given character as per the rule, depending on whether
we’re encrypting or decrypting the text.
• Return the new string generated.
3
2.1.2 Code Implementation for Caesor Cipher
1. #Message to encrypt
2. message = list(input('message: '))
3. l=len(message)
4. for i in range(l):
5. if ord(message[i])<ord('a') and
ord(message[i])>ord('z'):
6. print('Out of range')
7. exit()
8.
9. p1= 'abcdefghijklmnopqrstuvwxyz'
10. k=int(input('Enter value of key: '))
11.
12. #encryption
13. newMessage = []
14. letter=[]
15. for i in range(l):
16. c=(ord(message[i])-ord('a')+k)%26 #c=99--
>99-97=2-->2+3=5
17. letter=p1[c] #5-->f
18. newMessage.append(letter)
19.
20. Ciphertext=' '.join(newMessage)
21. print('Encrypted text: ',ciphertext)
22.
23. #decryption
24. newMessage = []
25. letter=[]
26. for i in range(l):
27. c=(ord(ciphertext[i])-ord('a')-k)%26
28. letter=p1[c]
29. newMessage.append(letter)
30.
31. Plaintext = ' '.join(newMessage)
32. print('Decrypted text: ',plaintext)
33.
34.
Output:
Discussion:
Caesor Cipher is a mono-alphabetic cipher wherein each letter of the plain text is substituted
by another letter to form the cipher text. It is a simplest form of substitution cipher scheme.
This cryptosystem is generally referred to as the Shift Cipher. The concept is to replace each
alphabet by another alphabet which is ‘shifted’ by some fixed number between 0 and 25.
4
2.2 Substitution Cipher
In cryptography, a substitution cipher is a method of encoding by which units of plain text are
replaced with cipher text, according to a regular system; the “units” may be single letters (the
most common), pairs of letters, triplets of letters, mixtures of the above, and so forth. The
receiver deciphers the text by performing an inverse substitution.
There are a number of different types of substitution cipher. If the cipher operates on single
letters, it is termed a simple substitution cipher; a cipher that operates on larger groups of letters
is termed poly-graphic. A mono-alphabetic cipher uses fixed substitution over the entire
message, whereas a poly-alphabetic cipher uses a number of substitutions at different positions
in the message, where a unit from the plain text is mapped to one of several possibilities in the
cipher text and vice versa.
5
16. ciphertext=''.join(newMessage)
17. print('Encrypted text: ',ciphertext)
18.
19.
20. #decryption
21.
22. newMessage = []
23. letter=[]
24.
25. for i in range(l):
26. for j in range(26):
27. if ciphertext[i] == s1[j]:
28. letter = p1[j]
29. newMessage.append(letter)
30.
31. plaintext=''.join(newMessage)
32. print('Decrypted text: ',plaintext)
33.
Output:
Discussion
Simple substitution cipher is the most commonly used cipher and includes an algorithm of
substituting every plain text character for every cipher text character. There are two table one
is for plain text and another is for cipher text in this process, alphabets are jumbled in
comparison with Caesar cipher algorithm
XOR operation uses the same key for both encryption and decryption. That is why it is known
as a symmetric encryption. The concept of implementation is to first define XOR – encryption
key and then to perform XOR operation of the characters in the String with this key which you
want to encrypt. To decrypt the encrypted characters, we have to perform XOR operation again
with the defined key.
6
2.3.1 Algorithm for Simple XOR Cipher:
Input:
• A String of both lower- and upper-case letters, called Plain Text.
• An encryption key.
Procedure:
• Bitwise XOR operation between plain text and key to get cipher text.
i.e., plain text ⊕ key= cipher text
• Bitwise XOR operation between cipher text and key to get plain text.
i.e., cipher text ⊕ key= plain text
Output:
7
Discussion:
XOR cipher is famous for being very resistant to brute force attacks where the attacker
generates random keys and try them until the correct one is found.
In addition, the implementation of XOR is very easy. That is why XOR is used inside most
encryption algorithms or used with various other encryption methods. Yet the most important
feature of the XOR cipher is that it can be “the perfect cipher” with one time pad.
• One time pad refers to an encryption technique where the key is:
• Truly random,
• Kept secret,
• As long as (or longer than) the plain text,
• Never reused in part or in whole.
When XOR cipher has a random key that is as long as the message itself, it is impossible to
crack it. In other words, it offers the highest level of security.
The rail fence cipher (also called a zigzag cipher) is a form of transposition cipher. It derives
its name from the way in which it is encoded.
Input:
• A String of both lower- and upper-case letters, called Plain Text.
• A depth key.
Procedure:
• For encryption, in the rail fence cipher, the plain text is written downwards diagonally
on successive "rails" of an imaginary fence, then moving up when the bottom rail is
reached, down again when the top rail is reached, and so on until the whole plain text
is written out. The cipher text is then read off in rows.
8
• For decryption, as we’ve seen earlier, the number of columns in rail fence cipher
remains equal to the length of plain-text message. And the key corresponds to the
number of rails. Hence, rail matrix can be constructed accordingly. Once we’ve got
the matrix we can figure-out the spots where texts should be placed (using the same
way of moving diagonally up and down alternatively). Then, we fill the cipher-text
row wise. After filling it, we traverse the matrix in zig-zag manner to obtain the
original text.
9
37. #Decryption
38. def decrypt(s,n):
39. fence = [[] for i in range(n)]
40. rail = 0
41. var = 1
42.
43. for char in s:
44. fence[rail].append(char)
45. rail += var
46.
47. if rail == n-1 or rail == 0:
48. var = -var
49.
50. rFence = [[] for i in range(n)]
51.
52. i = 0
53. l = len(s)
54. s = list(s)
55. for r in fence:
56. for j in range(len(r)):
57. rFence[i].append(s[0])
58. s.remove(s[0])
59. i += 1
60.
61. rail = 0
62. var = 1
63. r = ''
64. for i in range(l):
65. r += rFence[rail][0]
66. rFence[rail].remove(rFence[rail][0])
67. rail += var
68.
69. if rail == n-1 or rail == 0:
70. var = -var
71.
72. return r
73.
74. if __name__ == '__main__':
75. main()
76.
Output:
10
Discussion
The term zigzag cipher may refer to the rail fence cipher as described above. However, it may
also refer to a different type of cipher described by Fletcher Pratt in Secret and Urgent. It is
"written by ruling a sheet of paper in vertical columns, with a letter at the head of each column.
A dot is made for each letter of the message in the proper column, reading from top to bottom
of the sheet. The letters at the head of the columns are then cut off, the ruling erased and the
message of dots sent along to the recipient, who, knowing the width of the columns and the
arrangement of the letters at the top, reconstitutes the diagram and reads what it has to say."
11
3.2 Playfair Cipher
In this scheme, pairs of letters are encrypted, instead of single letters as in the case of simple
substitution cipher. The Playfair cipher was the first practical digraph substitution cipher. The
scheme was invented in 1854 by Charles Wheatstone but was named after Lord Playfair who
promoted the use of the cipher. In Playfair cipher unlike traditional cipher we encrypt a pair of
alphabets (digraphs) instead of a single alphabet.
Input
• A String of both lower- or upper-case letters, called Plain Text.
• A keyword.
Procedure
• Generate the key Square (5×5):
o The key square is a 5×5 grid of alphabets that acts as the key for encrypting the
plain text. Each of the 25 alphabets must be unique and one letter of the alphabet
(usually J) is omitted from the table (as the table can hold only 25 alphabets). If the
plain text contains J, then it is replaced by I.
o The initial alphabets in the key square are the unique alphabets of the key in the
order in which they appear followed by the remaining letters of the alphabet in
order.
12
o If both the letters are in the same column: Take the letter above each one (going
back to the bottom if at the top).
o If both the letters are in the same row: Take the letter to the left of each one (going
back to the rightmost if at the leftmost position).
o If neither of the above rules is true: Form a rectangle with the two letters and take
the letters on the horizontal opposite corner of the rectangle.
1. # Playfair Cipher
2.
3. key = input("Enter key")
4. key = key.replace(" ", "")
5. key = key.upper()
6.
7.
8. def matrix(x, y, initial):
9. return [[initial for i in range(x)] for j in range(y)]
10.
11.
12. result = list()
13. for c in key: # storing key
14. if c not in result:
15. if c == 'J':
16. result.append('I')
17. else:
18. result.append(c)
19. flag = 0
20. for i in range(65, 91): # storing other character
21. if chr(i) not in result:
22. if i == 73 and chr(74) not in result:
23. result.append("I")
24. flag = 1
25. elif flag == 0 and i == 73 or i == 74:
26. pass
27. else:
28. result.append(chr(i))
29. k = 0
30. my_matrix = matrix(5, 5, 0) # initialize matrix
31. for i in range(0, 5): # making matrix
32. for j in range(0, 5):
33. my_matrix[i][j] = result[k]
34. k += 1
35.
36.
13
37. def locindex(c): # get location of each character
38. loc = list()
39. if c == 'J':
40. c = 'I'
41. for i, j in enumerate(my_matrix):
42. for k, l in enumerate(j):
43. if c == l:
44. loc.append(i)
45. loc.append(k)
46. return loc
47.
48.
49. def encrypt(): # Encryption
50. msg = str(input("ENTER MSG:"))
51. msg = msg.upper()
52. msg = msg.replace(" ", "")
53. i = 0
54. for s in range(0, len(msg) + 1, 2):
55. if s < len(msg) - 1:
56. if msg[s] == msg[s + 1]:
57. msg = msg[:s + 1] + 'X' + msg[s + 1:]
58. if len(msg) % 2 != 0:
59. msg = msg[:] + 'X'
60. print("CIPHERTEXT:", end=' ')
61. while i < len(msg):
62. loc = list()
63. loc = locindex(msg[i])
64. loc1 = list()
65. loc1 = locindex(msg[i + 1])
66. if loc[1] == loc1[1]:
67. print("{}{}".format(my_matrix[(loc[0] + 1)
% 5][loc[1]], my_matrix[(loc1[0] + 1) % 5][loc1[1]]), end='
')
68. elif loc[0] == loc1[0]:
69.
print("{}{}".format(my_matrix[loc[0]][(loc[1] + 1) % 5],
my_matrix[loc1[0]][(loc1[1] + 1) % 5]), end=' ')
70. else:
71.
print("{}{}".format(my_matrix[loc[0]][loc1[1]],
my_matrix[loc1[0]][loc[1]]), end=' ')
72. i = i + 2
73.
74.
75. def decrypt(): # decryption
76. msg = str(input("ENTER CIPHERTEXT:"))
77. msg = msg.upper()
78. msg = msg.replace(" ", "")
79. 14 end=' ')
print("PLAIN TEXT:",
80. i = 0
81. while i < len(msg):
82. loc = list()
79. print("PLAIN TEXT:", end=' ')
80. i = 0
81. while i < len(msg):
82. loc = list()
83. loc = locindex(msg[i])
84. loc1 = list()
85. loc1 = locindex(msg[i + 1])
86. if loc[1] == loc1[1]:
87. print("{}{}".format(my_matrix[(loc[0] - 1)
% 5][loc[1]], my_matrix[(loc1[0] - 1) % 5][loc1[1]]), end='
')
88. elif loc[0] == loc1[0]:
89.
print("{}{}".format(my_matrix[loc[0]][(loc[1] - 1) % 5],
my_matrix[loc1[0]][(loc1[1] - 1) % 5]), end=' ')
90. else:
91.
print("{}{}".format(my_matrix[loc[0]][loc1[1]],
my_matrix[loc1[0]][loc[1]]), end=' ')
92. i = i + 2
93.
94.
95. while (1):
96. choice = int(input("\n 1.Encryption \n
2.Decryption: \n 3.EXIT"))
97. if choice == 1:
98. encrypt()
99. elif choice == 2:
100. decrypt()
101. elif choice == 3:
102. exit()
103. else:
104. print("Choose correct choice")
Output
15
Conclusion:
Playfair Cipher is significantly harder to break since the frequency analysis technique used to
break simple substitution ciphers is difficult but still can be used on (25*25) = 625 digraphs
rather than 25 monographs which is difficult.
An interesting weakness is the fact that a digraph in the cipher text (AB) and it’s reverse (BA)
will have corresponding plain texts like UR and RU (and also cipher text UR and RU will
correspond to plain text AB and BA, i.e., the substitution is self-inverse). That can easily be
exploited with the aid of frequency analysis, if the language of the plain text is known. Another
disadvantage is that Playfair cipher is a symmetric cipher thus same key is used for both
encryption and decryption
16
Lab No. 3 - Study of Asymmetric Cryptography
RSA involves a public key and private key. The public key can be known to everyone- it is
used to encrypt messages. Messages encrypted using the public key can only be decrypted with
the private key. The private key needs to be kept secret. Calculating the private key from the
public key is very difficult.
Procedure:
• Generating the keys
o Select two large prime numbers, x and y. The prime numbers need to be large so
that they will be difficult for someone to figure out.
o Calculate n = x * y.
o Calculate the totient function; ϕ(n)=(x−1)(y−1).
o Select an integer e, such that e is co-prime to ϕ(n) and 1 < e < ϕ(n). The pair of
numbers (n,e) makes up the public key.
o Calculate d such that e.d=1 mod ϕ(n).
o d can be found using the extended euclidean algorithm. The pair (n,d) makes up the
private key.
• Encryption
o Given a plain text P, represented as a number, the cipher text C is calculated as:
C = Pe mod n.
• Decryption
o Using the private key (n,d), the plain text can be found using:
P = Cd mod n.
17
4.1.2 Code Implementation for RSA Algorithm
1.
2. #................................RSA
Algorithm............................................#
3.
4. from decimal import Decimal
5.
6. def gcd(a,b):
7. if b==0:
8. return a
9. else:
10. return gcd(b,a%b)
11. p = int(input('Enter the value of p = '))
12. q = int(input('Enter the value of q = '))
13. no = int(input('Enter the value of text = '))
14. n = p*q
15. phi = (p-1)*(q-1)
16.
17. for e in range(2,phi):
18. if gcd(e,phi)== 1:
19. break
20.
21.
22. for i in range(1,10):
23. x = 1 + i*phi
24. if x % e == 0:
25. d = int(x/e)
26. break
27. ctt = Decimal(0)
28. ctt =pow(no,e)
29. ct = ctt % n
30.
31. dtt = Decimal(0)
32. dtt = pow(ct,d)
33. dt = dtt % n
34.
35. print('n = '+str(n)+' e = '+str(e)+' phi = '+str(phi)+'
d = '+str(d)+' cipher text = '+str(ct)+' decrypted text =
'+str(dt))
36.
output:
18
Discussion
In RSA cryptography, both the public and the private keys can encrypt a message; the opposite
key from the one used to encrypt a message is used to decrypt it. This attribute is one reason
why RSA has become the most widely used asymmetric algorithm: It provides a method to
assure the confidentiality, integrity, authenticity, and non-repudiation of electronic
communications and data storage.
RSA derives its security from the difficulty of factoring large integers that are the product of
two large prime numbers. Multiplying these two numbers is easy, but determining the original
prime numbers from the total or factoring, is considered infeasible due to the time it would take
using even today's supercomputers
19
Lab No. 4: Study of Symmetric Cryptography
5.1 (Data Encryption Standard – DES)
The Data Encryption Standard (DES) is a symmetric-key block cipher published by the
National Institute of Standards and Technology (NIST).
DES was finally published as FIPS 46 in the Federal Register in January 1977. NIST, however,
defines DES as the standard for use in unclassified applications. DES has been the most widely
used symmetric-key block cipher since its publication. NIST later issued a new standard (FIPS
46-3) that recommends the use of triple DES (repeated DES cipher three times) for future
applications.
5.1.1 Overview
At the encryption site, DES takes a 64-bit plaintext and creates a 64-bit ciphertext; at the
decryption site, DES takes a 64-bit ciphertext and creates a 64-bit block of plaintext. The same
56-bit cipher key is used for both encryption and decryption.
The encryption process is made of two permutations (P-boxes), which we call initial and final
permutations, and sixteen Feistel rounds. Each round uses a different 48-bit round key
generated from the cipher key according to a predefined algorithm
20
Fig. 2.2: General Structure of DES
21
14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4]
#Expand matrix to get a 48bits matrix of datas to apply the xor with Ki
E = [32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
12, 13, 14, 15, 16, 17,
16, 17, 18, 19, 20, 21,
20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1]
#SBOX
S_BOX = [
22
[[2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9],
[14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6],
[4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14],
[11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3],
],
def string_to_bit_array(text):
array = list()
for char in text:
binval = binvalue(char, 8)
23
array.extend([int(x) for x in list(binval)])
return array
def bit_array_to_string(array):
res = ''.join([chr(int(y,2)) for y in [''.join([str(x) for x in _bytes]
) for _bytes in nsplit(array,8)]])
return res
ENCRYPT=1
DECRYPT=0
class des():
def __init__(self):
self.password = None
self.text = None
self.keys = list()
self.password = key
self.text = text
self.generatekeys()
text_blocks = nsplit(self.text, 8)
result = list()
for block in text_blocks:
block = string_to_bit_array(block)
block = self.permut(block,PI)
24
g, d = nsplit(block, 32)
tmp = None
for i in range(16):
d_e = self.expand(d, E)
if action == ENCRYPT:
tmp = self.xor(self.keys[i], d_e)
else:
tmp = self.xor(self.keys[15-i], d_e)
tmp = self.substitute(tmp)
tmp = self.permut(tmp, P)
tmp = self.xor(g, tmp)
g = d
d = tmp
result += self.permut(d+g, PI_1)
final_res = bit_array_to_string(result)
if padding and action==DECRYPT:
return self.removePadding(final_res)
else:
return final_res
def generatekeys(self):
self.keys = []
key = string_to_bit_array(self.password)
key = self.permut(key, CP_1)
g, d = nsplit(key, 28)
for i in range(16):
g, d = self.shift(g, d, SHIFT[i])
25
tmp = g + d
self.keys.append(self.permut(tmp, CP_2))
def addPadding(self):
pad_len = 8 - (len(self.text) % 8)
self.text += pad_len * chr(pad_len)
if __name__ == '__main__':
main()
Output:
Discussion:
The DES satisfies both the desired properties of block cipher. These two properties make
cipher very strong.
• Avalanche effect − A small change in plain text results in the very great change in the
cipher text.
• Completeness − Each bit of cipher text depends on many bits of plain text.
During the last few years, cryptanalysis have found some weaknesses in DES when key
selected are weak keys. These keys shall be avoided. DES has proved to be a very well-
designed block cipher. There have been no significant cryptanalytic attacks on DES other than
exhaustive key search.
26
Lab No.: 5 - Configuration of Firewall
This is possible by configuring domain names and Internet Protocol (IP) addresses to keep
the firewall secure. Firewall policy configuration is based on network type, such as public or
private, and can be set up with security rules that block or allow access to prevent potential
attacks form hackers or malware.
27
Router Configuration:
Router>en
Router#conf t
Router(config)#hostname Internet
Internet(config)#int g0/1
Internet(config-if)#ip address 8.8.8.1 255.255.255.0
Internet(config-if)#no shut
Internet(config-if)#int g0/0
Internet(config-if)#ip address 10.1.1.2 255.255.255.252
Internet(config-if)#no shut
Internet(config-if)#exit
28
ASA(config)#dhcp address 192.168.1.10-192.168.1.20 inside
ASA(config)#dhcp dns 8.8.8.8
ASA(config)#dhcp option 3 ip 192.168.1.1
ASA(config)#dhcp enable inside
ASA(config)#route outside 0.0.0.0 0.0.0.0 10.1.1.2
ASA(config)#object network INSIDE-NET
ASA(config-network-object)#subnet 192.168.1.0 255.255.255.0
ASA(config-network-object)#nat (inside,outside) dynamic interface
ASA(config-network-object)#exit
Test: Ping PC-B from PC-A and server 8.8.8.8 from PC-A or PC-B:
29
ASA#conf t
ASA(config)#class-map inspection_default
ASA(config-cmap)#match default-inspection-traffic
ASA(config-cmap)#exit
ASA(config)#policy-map global_policy
ASA(config-cmap)#class?
ASA(config-cmap)#class inspection_default
ASA(config-cmap-c)#inspect icmp
ASA(config-cmap-c)#exit
ASA(config)#service-policy global_policy global
ASA(config)#show run
ASA(config) #policy-map global_policy
ASA(config-pmap)#class inspection_default
ASA(config-pmap-c)#inspect http
ASA(config-pmap-c)#exit
ASA(config)#show run
Test: Ping server 8.8.8.8 from PC-A or PC-B and ping www.ccnasecurity.com from PC-
A or PC-B:
30
ASA(config)#policy-map global_policy
ASA(config-pmap)#class inspection_default
ASA(config-pmap-c)#?
ASA(config-pmap-c)#inspect dns
ASA(config-pmap-c)#exit
31
Lab No.: 6 - Configuration of IPSec VPN
Internet Protocol Security (IPsec) is a VPN standard that provides Layer 3 security. It's a suite
of protocols that provides confidentiality, integrity and authentication to date.
As shown in the topology below, we will setup a VPN between the Internet Service Provider
(ISP) and customer networks.
Topology
32
Configuration of R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#interface g0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface gigabitEthernet 0/1
R1(config-if)#ip address 10.1.1.2 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.1.0
R1(config-router)#network 10.1.1.0
R1(config-router)#no auto-summary
R1(config-router)#end
R1#write
Configuration of R2:
Router>enable
Router#configure t
Router(config)#hostname R2
R2(config)#interface gigabitEthernet 0/2
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface gigabitEthernet 0/0
R2(config-if)#ip address 10.1.1.1 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface gigabitEthernet 0/1
R2(config-if)#ip address 10.2.2.1 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.2.0
R2(config-router)#network 10.1.1.0
R2(config-router)#network 10.2.2.0
R2(config-router)#no auto-summary
R2(config-router)#end
R2#wr
33
Configuration of R3:
Router>enable
Router#configure t
Router(config)#hostname R3
R3(config)#interface gigabitEthernet 0/1
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface gigabitEthernet 0/0
R3(config-if)#ip address 10.2.2.2 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#network 192.168.3.0
R3(config-router)#network 10.2.2.0
R3(config-router)#no auto-summary
R3(config-router)#end
R3#wr
34
Configuration of R1:
Configuration of R3:
35
Verify IPSec Tunnel on R1:
interface: GigabitEthernet0/1
Crypto map tag: VPN-MAP, local addr 10.1.1.2
interface: GigabitEthernet0/1
Crypto map tag: VPN-MAP, local addr 10.1.1.2
36
8.1 Conclusion
This report is very useful for all those who want to learn fundamental knowledge about
cryptography, configuration of firewall and configuration of VPN IPSec in computer security.
This report helped me to know about the problems difficulties during configuration of network
like firewall and VPN IPSec. I learned lots of things during the preparation of this lab report.
While preparing this report I felt many problems, from those problem I gained the problem-
solving skill. This report will more advantages for those who want to learn about different types
of cryptography, configuration of firewall for the secure connection between local devices and
server also advantage for learning VPN IPSec configuration.
37
References
Visual paradigm online - suite of powerful tools. Visual Paradigm Online - Suite of Powerful
Tools. (n.d.). https://online.visual-paradigm.com/.
Admin. (2020, October 10). Cryptography in computer network. Tutorial And Example.
https://www.tutorialandexample.com/cryptography-in-computer-network/.
38