0% found this document useful (0 votes)
23 views21 pages

Module 1

Uploaded by

hemantpatil2405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views21 pages

Module 1

Uploaded by

hemantpatil2405
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Module 1

Introduction to Network Security & cryptography


____________________________________________________________________

MUSA Notes
Computer security and Network Security(Definition)
Computer security deals with securing a standalone computer’s hardware and
software. Keeping standalone machines updated and properly patched is one of the
most important keys of this type of security.

Network security is the security provided to a network from unauthorized access and
risks. It is the duty of network administrators to adopt preventive measures to protect
their networks from potential security threats.
Computer networks that are involved in regular transactions and communication
within the government, individuals, or business require security. The most common
and simple way of protecting a network resource is by assigning it a unique name and a
corresponding password.

Computer network security consists of measures taken by business or some


organizations to monitor and prevent unauthorized access from the outside attackers.

Different approaches to computer network security management have different


requirements depending on the size of the computer network. For example, a home
office requires basic network security while large businesses require high maintenance
to prevent the network from malicious attacks.

CIA

The objective of Cybersecurity is to protect information from being stolen, compromised


or attacked. Cybersecurity can be measured by at least one of three goals-

1. Protect the confidentiality of data.


2. Preserve the integrity of data.
3. Promote the availability of data for authorized users.

These goals form the confidentiality, integrity, availability (CIA) triad, the basis of all
security programs. The CIA triad is a security model that is designed to guide policies
for information security within the premises of an organization or company. This model
is also referred to as the AIC (Availability, Integrity, and Confidentiality) triad to

1|Module No: 1
avoid the confusion with the Central Intelligence Agency. The elements of the triad are
considered the three most crucial components of security.

1. Confidentiality

Confidentiality is roughly equivalent to privacy and avoids the unauthorized disclosure


of information. It involves the protection of data, providing access for those who are
allowed to see it while disallowing others from learning anything about its content. It
prevents essential information from reaching the wrong people while making sure that
the right people can get it. Data encryption is a good example to ensure confidentiality.

2. Integrity

Integrity refers to the methods for ensuring that data is real, accurate and safeguarded
from unauthorized user modification. It is the property that information has not be
altered in an unauthorized way, and that source of the information is genuine.

3. Availability

Availability is the property in which information is accessible and modifiable in a


timely fashion by those authorized to do so. It is the guarantee of reliable and constant
access to our sensitive data by authorized people.

Security Services, Mechanisms and attacks

2|Module No: 1
Security services

• Authentication: assures recipient that the message is from the source that it claims
to be from.
• Access Control: controls who can have access to resource under what condition
• Availability: available to authorized entities for 24/7.
• Confidentiality: information is not made available to unauthorized individual
• Integrity: assurance that the message is unaltered
• Non-Repudiation: protection against denial of sending or receiving in the
communication

Security Mechanisms

Types of Security Mechanism are :


1. Encipherment :
This security mechanism deals with hiding and covering of data which helps data
to become confidential. It is achieved by applying mathematical calculations or
algorithms which reconstruct information into not readable form. It is achieved by
two famous techniques named Cryptography and Encipherment. Level of data
encryption is dependent on the algorithm used for encipherment.

3|Module No: 1
2. Access Control :
This mechanism is used to stop unattended access to data which you are sending.
It can be achieved by various techniques such as applying passwords, using
firewall, or just by adding PIN to data.
3. Notarization :
This security mechanism involves use of trusted third party in communication. It
acts as mediator between sender and receiver so that if any chance of conflict is
reduced. This mediator keeps record of requests made by sender to receiver for
later denied.
4. Data Integrity :
This security mechanism is used by appending value to data to which is created by
data itself. It is similar to sending packet of information known to both sending
and receiving parties and checked before and after data is received. When this
packet or data which is appended is checked and is the same while sending and
receiving data integrity is maintained.
5. Authentication exchange :
This security mechanism deals with identity to be known in communication. This
is achieved at the TCP/IP layer where two-way handshaking mechanism is used to
ensure data is sent or not
6. Bit stuffing :
This security mechanism is used to add some extra bits into data which is being
transmitted. It helps data to be checked at the receiving end and is achieved by
Even parity or Odd Parity.
7. Digital Signature :
This security mechanism is achieved by adding digital data that is not visible to
eyes. It is form of electronic signature which is added by sender which is checked
by receiver electronically. This mechanism is used to preserve data which is not
more confidential but sender’s identity is to be notified.

Relation between security services and mechanisms

security attacks are classified into two types, passive attack and active attack.
A passive attack attempts to learn or make use of information from the system but

4|Module No: 1
does not affect system resources, whereas active attack attempts to alter system
resources or affect their operation.

Passive Attacks
Passive attacks are in the nature of eavesdropping(spy) on, or monitoring of
transmissions. The goal of the opponent is to obtain information that is being
transmitted. Two types of passive attacks are the 'Release of Message Content' and
'Traffic Analysis'.
1. Release of Message
The 'release of message contents' is easily understood. A telephone
conversation, an electronic mail message, and a transferred file may contain sensitive
or confidential information. We would like to prevent an opponent from learning the
contents of these transmissions.

2. Traffic Analysis

Here, suppose we had a way of making the contents of messages or other


information traffic so that opponents, event if they captured the message, could not
extract the information from the message. The common technique for masking contents
is encryption. If we had encryption protection in place, an opponent could determine
the location and identity of communicating hosts and could observe the frequency and
length of messages being exchanged. This information might be useful in guessing the
nature of the communication that was taking place.

5|Module No: 1
Active Attacks
Active attacks involve some modification of the data stream or the creation of a false
stream and can be subdivided into four categories: Masquerade, Replay, Modification of
Messages, and Denial of Service.
1. Masquerade.
A 'masquerade' takes place when one entity pretends to be a different entity. A
masquerade attack usually includes one of the other forms of active attack. For
example, authentication sequence has taken place, thus enabling few privilege to
obtain extra privilege by pretending an entity that has those privileges.

2. Replay.

Replay involve the passive capture of a data unit and its subsequent
retransmission to produce an authorized effect.

6|Module No: 1
3. Modification of messages.

It simply means that some portion of a authorized message is altered, or that


messages are delayed or reordered, to produce an unauthorized effect. For example, a,
message meaning "Allow Virat to read confidential file accounts" is changed to "Allow
Dhoni to read confidential file accounts".

4. Denial of Service.

It prevents or inhibits the normal use or management of communication


facilities. This attack may have a specific target; for example, an entity may suppress
all messages directed to a particular destination. Another form of service denial is the
disruption of an entire network, either by disabling the network or by overloading it
with messages so as to degrade performance.

7|Module No: 1
The OSI security architecture

The OSI security architecture focuses on security attacks, mechanisms, and


services. These can be defined briefly as follows:

Threats and Attacks (RFC 2828)

Threat

A potential for violation of security, which exists when there is a circumstance,


capability, action, or event that could breach security and cause harm. That is, a
threat is a possible danger that might exploit a vulnerability.

Attack

An assault on system security that derives from an intelligent threat; that is, an
intelligent act that is a deliberate attempt (especially in the sense of a method or
technique) to evade security services and violate the security policy of a system.

Security Attacks, Services And Mechanisms


8|Module No: 1
To assess the security needs of an organization effectively, the manager responsible for
security needs some systematic way of defining the requirements for security and
characterization of approaches to satisfy those requirements. One approach is to
consider three aspects of information security:

Security attack – Any action that compromises the security of information owned
by an organization.

Security mechanism – A mechanism that is designed to detect, prevent or


recover from a security attack.

Security service – A service that enhances the security of the data processing
systems and the information transfers of an organization. The services are intended to
counter security attacks and they make use of one or more security mechanisms to
provide the service.

Network security model

Using this model requires us to:

1. Design a suitable algorithm for the security transformation

2. Generate the secret information (keys) used by the algorithm

3. Develop methods to distribute and share the secret information

9|Module No: 1
4. Specify a protocol enabling the principals to use the transformation and secret
information for a security service

Classical Encryption techniques


What is Encryption?

Encryption, is the process of changing information in such a way as to make it


unreadable by anyone except those possessing special knowledge (usually referred to as
a "key") that allows them to change the information back to its original, readable form.

Basic Terminology and Key words:

• Plaintext: Refers to the original text or message to be encrypted.


• Ciphertext: The encrypted message.
• Enciphering or Encryption: The process of converting plaintext into a
ciphertext.
• Deciphering or Decryption: The process of decoding the ciphertext and
retrieving the original plain text.
• Encryption algorithms: a pseudocode based on mathematical equations to
perform encryption. Usually requires two inputs; the Plaintext and the Secret
Key.
• Decryption algorithm: Used to perform the decryption. Usually requires two
inputs as well; Ciphertext and Secret Key.
• Secret Key: A special key used for encryption and decryption, known as well
as Symmetric Key
• Cipher or Cryptographic system: Refers to the scheme used for encryption
and decryption.
• Cryptography: The science that studies and analyze ciphers.
• Cryptanalysis: Science of studying attacks against cryptographic systems.
• Cryptology: The science that merge both Cryptography and Cryptanalysis.
• Symmetric Cipher: Using the same key for encryption and decryption such
as:  Block Cipher: Encrypts a block of plaintext at a time ( usually 64 or 128
bits).
• Asymmetric Cipher: Using different keys for encryption and decryption
phases.

Substitution techniques:
Substitution technique Substitution technique is a classical encryption technique
where the characters present in the original message are replaced by other characters
or numbers or symbols. If the plain text (original message) is considered as the string of
bits, then the substitution technique would replace bit pattern of plain text with the bit
pattern of cipher text.

The substitution techniques can be explained as follows:


10 | M o d u l e N o : 1
Caesar Cipher
The Caesar Cipher technique is one of the earliest and simplest method of encryption
technique. each letter of a given text is replaced by a letter some fixed number of
positions down the alphabet.

For example with a shift of 1, A would be replaced by B, B would become C, and so on.
• The method is apparently named after Julius Caesar, who apparently used it to
communicate with his officials.

Mono-alphabetic
Monoalphabetic cipher is a substitution cipher in which for a given key, the cipher
alphabet for each plain alphabet is fixed throughout the encryption process.

For example, if ‘A’ is encrypted as ‘D’, for any number of occurrence in that plaintext,
‘A’ will always get encrypted to ‘D’.

• The number of possible shifts is 26!, making it much more complicated than Caesar
Cipher to break

Poly-alphabetic

Vigenere cipher

Two methods perform the vigenere cipher.

Method 1

When the vigenere table is given, the encryption and decryption are done using the
vigenere table (26 * 26 matrix) in this method.
11 | M o d u l e N o : 1
Example: The plaintext is "JAVATPOINT", and the key is "BEST".

To generate a new key, the given key is repeated in a circular manner, as long as the
length of the plain text does not equal to the new key.

Encryption

The first letter of the plaintext is combined with the first letter of the key. The column
of plain text "J" and row of key "B" intersects the alphabet of "K" in the vigenere table,
so the first letter of ciphertext is "K".

Similarly, the second letter of the plaintext is combined with the second letter of the
key. The column of plain text "A" and row of key "E" intersects the alphabet of "E" in
the vigenere table, so the second letter of ciphertext is "E".

This process continues continuously until the plaintext is finished.

Ciphertext = KENTUTGBOX

12 | M o d u l e N o : 1
Decryption

Decryption is done by the row of keys in the vigenere table. First, select the row of the
key letter, find the ciphertext letter's position in that row, and then select the column
label of the corresponding ciphertext as the plaintext.

For example, in the row of the key is "B" and the ciphertext is "K" and this ciphertext
letter appears in the column "J", that means the first plaintext letter is "J".

Next, in the row of the key is "E" and the ciphertext is "E" and this ciphertext letter
appears in the column "A", that means the second plaintext letter is "A".

This process continues continuously until the ciphertext is finished.

Plaintext = JAVATPOINT

Method 2

When the vigenere table is not given, the encryption and decryption are done by
Vigenar algebraically formula in this method (convert the letters (A-Z) into the
numbers (0-25)).

Formula of encryption is,

Ei = (Pi + Ki) mod 26

Formula of decryption is,

Di = (Ei - Ki) mod 26

Playfair cipher
Playfair Cipher Encryption Rules

1. First, split the plaintext into digraphs (pair of two letters). If the plaintext has the
odd number of letters, append the letter Z at the end of the plaintext. It makes the
plaintext of even For example, the plaintext MANGO has five letters. So, it is not

13 | M o d u l e N o : 1
possible to make a digraph. Since, we will append a letter Z at the end of the plaintext,
i.e. MANGOZ.

2. After that, break the plaintext into digraphs (pair of two letters). If any letter
appears twice (side by side), put X at the place of the second occurrence. Suppose, the
plaintext is COMMUNICATE then its digraph becomes CO MX MU NI CA TE.
Similarly, the digraph for the plaintext JAZZ will be JA ZX ZX, and for
plaintext GREET, the digraph will be GR EX ET.

3. To determine the cipher (encryption) text, first, build a 5*5 key-matrix or key-table
and filled it with the letters of alphabets, as directed below:

o Fill the first row (left to right) with the letters of the given keyword (ATHENS).
If the keyword has duplicate letters (if any) avoid them. It means a letter will be
considered only once. After that, fill the remaining letters in alphabetical order.
Let's create a 5*5 key-matrix for the keyword ATHENS.

Note that in the above matrix any letter is not repeated. The letters in the first row (in
green color) represent the keyword and the remaining letters sets in alphabetical order.

4. There may be the following three conditions:

i) If a pair of letters (digraph) appears in the same row

In this case, replace each letter of the digraph with the letters immediately to their
right. If there is no letter to the right, consider the first letter of the same row as the
right letter. Suppose, Z is a letter whose right letter is required, in such case, T will be
right to Z.

14 | M o d u l e N o : 1
ii) If a pair of letters (digraph) appears in the same column

In this case, replace each letter of the digraph with the letters immediately below them.
If there is no letter below, wrap around to the top of the same column. Suppose, W is a
letter whose below letter is required, in such case, V will be below W.

iii) If a pair of letters (digraph) appears in a different row and different


column

In this case, select a 3*3 matrix from a 5*5 matrix such that pair of letters appear in
the 3*3 matrix. Since they occupy two opposite corners of a square within the matrix.
The other corner will be a cipher for the given digraph.

In other words, we can also say that intersection of H and Y will be the cipher for the
first letter and

15 | M o d u l e N o : 1
Suppose, a digraph is HY and we have to find a cipher for it. We observe that both H
and Y are placed in different rows and different columns. In such cases, we have to
select a 3*3 matrix in such a way that both H and Y appear in the 3*3 matrix
(highlighted with yellow color). Now, we will consider only the selected matrix to find
the cipher.

Now to find the cipher for HY, we will consider the diagonal opposite to HY,
i.e. LU. Therefore, the cipher for H will be L, and the cipher for Y will be U.

Note: The order of the letters within the digraph is not important.
Playfair Cipher Decryption

The decryption procedure is the same as encryption but the steps are applied
in reverse order. For decryption cipher is symmetric (move left along rows and up
along columns). The receiver of the plain text has the same key and can create the
same key-table that is used to decrypt the message.

16 | M o d u l e N o : 1
Let's see an example of Playfair cipher.

Example of Playfair Cipher

Suppose, the plaintext is COMMUNICATE and the key that we will use to encipher
the plaintext is COMPUTER. The key can be any word or phrase. Let's encipher the
message COMMUNICATE.

1. First, split the plaintext into digraphs (by rule 2) i.e. CO MX MU NI CA TE.

2. Construct a 5*5 key-matrix (by rule 3). In our case, the key is COMPUTER.

3. Now, we will traverse in key-matrix pair by pair and find the corresponding encipher
for the pair.

o The first digraph is CO. The pair appears in the same row. By using Rule 4(i)
CO gets enciphered into OM.
o The second digraph is MX. The pair appears in the same column. By using Rule
4(ii) MX gets enciphered into RM.
o The third digraph is MU. The pair appears in the same row. By using Rule 4(i)
MU gets enciphered into PC.
o The fourth digraph is NI. The pair appears in different rows and different
columns. By using Rule 4(iii) NI gets enciphered into SG.
o The fifth digraph is CA. The pair appears in different rows and different
columns. By using Rule 4(iii) CA gets enciphered into PT.
o The sixth digraph is TE. The pair appears in the same row. By using Rule 4(i)
TE gets enciphered into ER.

Therefore, the plaintext COMMUNICATE gets enciphered (encrypted)


into OMRMPCSGPTER.

17 | M o d u l e N o : 1
Transposition techniques: keyed and keyless transposition ciphers
Transposition Cipher:

• A transposition cipher does not substitute one symbol for another (as in
substitution cipher) but changes the location of these symbols.
• It reorders (jumbles) the given plain text to give the cipher text.
• They are of two types: Keyed and Keyless Transposition Cipher.

Keyless Transposition Cipher:

• In this cipher technique, the message is converted to ciphertext by either of two


permutation techniques:

18 | M o d u l e N o : 1
a. Text is written into a table column-by-column and is then transmitted row-by-
row.

b. Text is written into a table row-by-row and is then transmitted column-by-


column

• The first method (a) is also popularly known as Rail-fence cipher


• E.g. We need to send the message “DEFENDTHEEASTWALL”. Arranging into
tables we get :

Now, the message is sent row by row. So Ciphertext is


“DFNTEATALEEDHESWL”(Note: the no. of rows is 2 by default unless specified)Now,
the message is sent row-by-row. So Ciphertext is “DFNTEATALEEDHESWL”(Note: the
no. of rows is 2 by default, unless specified)

• Similarly for the (b) method, we can arrange the same above message into tables
with four columns.

The Data is then transmitted column-by-column as “DNETLEDEWFTAAEHSL”The


Data is then transmitted column-by-column as “DNETLEDEWFTAAEHSL”
Keyed Transposition cipher:

• In this approach, rather than permuting all the symbols together, we divide the
entire plaintext into blocks of predetermined size and then permute each block
independently.
• Suppose A wants to send a message to B “WE HAVE AN ATTACK”. Both A and
B agreed to had previously agreed oved the blocks size as 5. So the blocks would
be as:

WEHAV EANATEANAT TACKXTACKX

19 | M o d u l e N o : 1
• The last character X is a bogus character so as to complete the block size of 5.

• A and B is using the following key for encryption and decryption:

4 1 3 2 5

1 2 3 4 5

Introduction to steganography
What is Steganography?
Steganography is the art and science of embedding secret messages in a cover message
in such a way that no one, apart from the sender and intended recipient, suspects the
existence of the message

The diagram below depicts a basic steganographic model.

As the image depicts, both the cover file(X) and secret message(M) are fed into the
steganographic encoder as input. The Stenographic Encoder function, f(X,M,K) embeds
the secret message into a cover file. Resulting Stego Object looks very similar to your
cover file, with no visible changes. This completes encoding. To retrieve the secret
message, Stego Object is fed into Steganographic Decoder.

Steganography Tutorial: Historical Background

20 | M o d u l e N o : 1
Steganography is the practice of concealing a secret message behind a normal message.
It stems from two Greek words, which are steganos, which means covered,
and graphic, which means writing. Steganography is an ancient practice, being
practiced in various forms for thousands of years to keep communications private. For
Example:

• The first use of steganography can be traced back to 440 BC when ancient
Greece, people wrote messages on wood and covered it with wax, which acted as
a covering medium
• Romans used various forms of Invisible Inks, to decipher those hidden messages
light or heat was used
• During World War II the Germans introduced microdots, which were complete
documents, pictures, and plans reduced in size to the size of a dot and were
attached to normal paperwork
• Null Ciphers were also used to hide unencrypted secret messages in an innocent
looking normal message

Now, we have a lot of modern stenographic techniques and tools to make sure that
knows our data remains secret. Now you might be wondering if steganography is same
as cryptography. No, they are two different concepts.

21 | M o d u l e N o : 1

You might also like