Professional Documents
Culture Documents
Computer data often travels from one computer to another, leaving the safety of its
protected physical surroundings. Once the data is out of hand, people with bad intention could
modify or forge your data, either for amusement or for their own benefit.
Cryptography can reformat and transform our data, making it safer on its trip between
computers. The technology is based on the essentials of secret codes, augmented by modern
mathematics that protects our data in powerful ways.
• Computer Security - generic name for the collection of tools designed to protect data and to
thwart hackers
• Network Security - measures to protect data during their transmission
• Internet Security - measures to protect data during their transmission over a collection of
interconnected networks
THE NEED FOR SECURITY:
Most previous computer applications had no, or at best, very little security. This continued for a
number of years until the importance of data was truly realized. Until then, computer data was
considered to be useful, but not something to be protected.
Two typical examples of such security mechanisms were as follows:
Provide a user identification and password to every user, and use that information to
authenticate a user.
Encode information stored in the databases in some fashion, so that it is not visible to
users who do not have the right permission
There were many examples of what could happen if there was insufficient security built in
applications developed for the Internet.
1. Automating Attacks: The speed of computers make several attacks worthwhile for
miscreants. They are quite efficient and happy in doing routine, mundane, repetitive tasks. For
example, they would excel in somehow stealing a very low amount (say half a dollar or 20
rupees) from a million bank accounts in a matter of a few minutes.
SECURITY APPROACHES
Trusted Systems: A trusted system is a computer system that can be trusted to a specified extent
to enforce a specified security policy. Trusted systems often use the term reference monitor. This
is an entity that is at the logical heart of the computer system. It is mainly responsible for all the
decisions related to access controls. Naturally, following are the expectations from the reference
monitor:
(a) It should be tamper-proof.
(b) It should always be invoked.
(c) It should be small enough so that it can be tested independently.
Security Models: An organization can take several approaches to implement its security
model.
1. No Security: In this simplest case, the approach could be a decision to implement no security
at all.
2. Security through Obscurity: In this model, a system is secure simply because nobody knows
about its existence and contents. This approach cannot work for too long, as there are many ways
an attacker can come to know about it.
3. Host Security: In this scheme, the security for each host is enforced individually. This is a very
safe approach, but the trouble is that it cannot scale well.
4. Network Security: Host security is tough to achieve as organizations grow and become more
diverse. In this technique, the focus is to control network access to various hosts and their
services, rather than individual host security. This is a very efficient and scalable model.
Security-Management Practices:
Good security-management practices always talk of a security policy being in place.
Putting a security policy in place is actually quite tough. A good security policy and its proper
implementation go a long way in ensuring adequate security-management practices. A good
security policy generally takes care of four key aspects, as follows.
● Affordability: How much money and effort does this security implementation cost?
● Functionality: What is the mechanism of providing security?
● Cultural Issues: Does the policy complement the people’s expectations, working style and
beliefs?
● Legality: Does the policy meet the legal requirements?
PRINCIPLES OF SECURITY
These are the four chief principles of security. There are two more: access control and
availability, which are not related to a particular message, but are linked to the overall system as
a whole.
Confidentiality: The principle of confidentiality specifies that only the sender and the intended
recipient(s) should be able to access the contents of a message. Confidentiality gets compromised
if an unauthorized person is able to access a message.
Loss of confidentiality
Example: The user of computer A sends a message to the user of computer B. Another user C gets
access to this message, which is not desired, and therefore defeats the purpose of confidentiality.
An example of this could be a confidential email message sent by A to B, which is accessed by C
without the permission or knowledge of A and B. This type of attack is called interception.
Authentication: Authentication mechanisms help establish proof of identities. The
authentication process ensures that the origin of an electronic message or document is correctly
identified.
Example:
For instance, suppose that user C sends an electronic document over the Internet to user B.
However, the trouble is that user C had posed as user A when he/she sent this document to
user B
How would user B know that the message has come from user C, who is posing as user A
Absence of authentication
Integrity: When the contents of a message are changed after the sender sends it, but before it
reaches the intended recipient, we say that the integrity of the message is lost.
Loss of integrity
Example:
User C tampers with a message originally sent by user A, which is actually destined for user B.
User C somehow manages to access it, change its contents, and send the changed message to user
B. User B has no way of knowing that the contents of the message were changed after user A had
sent it. User A also does not know about this change. This type of attack is called modification.
Non-repudiation: Non-repudiation does not allow the sender of a message to refute the claim of
not sending that message.
Establishing non-repudiation
Example: User A could send a funds transfer request to bank B over the Internet. After the bank
performs the funds transfer as per A’s instructions, A could claim that he/she never sent the
funds transfer instruction to the bank! Thus, A repudiates, or denies, his/her funds transfer
instruction.
Access Control: The principle of access control determines who should be able to access what.
Example: we should be able to specify that user A can view the records in a database, but cannot
update them. An access-control mechanism can be set up to ensure this. Access control is broadly
related to two areas: role management and rule management. Role management concentrates on
the user side (which user can do what), whereas rule management focuses on the resources side
(which resource is accessible, and under what circumstances).
Availability: The principle of availability states that resources (i.e. information) should be
available to authorized parties at all times.
Attack on availability
Ethical and Legal Issues: Many ethical issues (and legal issues) in computer security systems
seem to be in the area of the individual’s right to privacy versus the greater good of a larger entity
(e.g. a company, society, etc.).
The ethical issues in security systems are classified into the following four categories:
Privacy: This deals with the right of an individual to control personal information.
Accuracy: This talks about the responsibility for the authenticity, fidelity, and accuracy of
information.
Property : Here, we find out the owner of the information. We also talk about who controls
access.
Accessibility: This deals with the issue of what information does an organization have the right
to collect? And in that situation, it also expects to know what the measures are, which will
safeguard against any unforeseen eventualities.
TYPES OF ATTACKS
Attacks: A General View
we can classify attacks into three categories
Passive attacks
Release of message contents is quite simple to understand. When you send a confidential email
message to your friend, you desire that only he/she be able to access it. Otherwise, the contents
of the message are released against our wishes to someone else.
if many such messages are passing through, a passive attacker could try to figure out
similarities between them to come up with some sort of pattern that provides her some clues
regarding the communication that is taking place. Such attempts of analyzing (encoded)
messages to come up with likely patterns are the work of the traffic-analysis attack.
(b) Active Attacks : Unlike passive attacks, the active attacks are based on the modification of
the original message in some manner, or in the creation of a false message. These attacks cannot
be prevented easily. These attacks can be in the form of interruption, modification and
fabrication.
In active attacks, the contents of the original message are modified in some way.
Trying to pose as another entity involves masquerade attacks.
Modification attacks can be classified further into replay attacks and alteration of messages.
Fabrication causes Denial Of Service (DOS) attacks.
Active attacks
The Practical Side of Attacks
They can be classified into two broad categories: application-level attacks and network-level
attacks,
1. Application-level Attacks: These attacks happen at an application level in the sense that the
attacker attempts to access, modify, or prevent access to information of a particular application,
or the application itself. Examples of this are trying to obtain someone’s credit-card information
on the Internet, or changing the contents of a message to change the amount in a transaction, etc.
2. Network-level Attacks: These attacks generally aim at reducing the capabilities of a network
by a number of possible means. These attacks generally make an attempt to either slow down, or
completely bring to halt, a computer network.
Programs that Attack
Virus: One can launch an application-level attack or a network level attack using a virus. In
simple terms, a virus is a piece of program code that attaches itself to legitimate program code,
and runs when the legitimate program runs. Viruses can also be triggered by specific events
Virus
Virus goes through four phases:
(a) Dormant Phase: Here, the virus is idle. It gets activated based on a certain action or event
(e.g. the user typing a certain key or a certain date or time is reached, etc). This is an optional
phase.
(b) Propagation Phase: In this phase, a virus copies itself, and each copy starts creating more
copies of itself, thus propagating the virus.
(c) Triggering Phase: A dormant virus moves into this phase when the action/event for which it
was waiting is initiated.
(d) Execution Phase: This is the actual work of the virus, which could be harmless (display some
message on the screen) or destructive (delete a file on the disk).
Viruses can be classified into the following categories:
(a) Parasitic Virus: This is the most common form of virus. Such a virus attaches itself to
executable files and keeps replicating. Whenever the infected file is executed, the virus looks for
other executable files to attach itself and spread.
(b) Memory-resident Virus: This type of virus first attaches itself to an area of the main
memory and then infects every executable program that is executed.
(c) Boot sector Virus: This type of virus infects the master boot record of the disk and spreads
on the disk when the operating system starts booting the computer.
(d) Stealth Virus: This virus has intelligence built in, which prevents anti-virus software
programs from detecting it.
(e) Polymorphic Virus: A virus that keeps changing its signature (i.e. identity) on every
execution, making it very difficult to detect.
(f) Metamorphic Virus: In addition to changing its signature like a polymorphic virus, this type
of virus keeps rewriting itself every time, making its detection even harder.
2. Worm:
Similar in concept to a virus, a worm is actually different in implementation. A virus modifies a
program (i.e. it attaches itself to the program under attack). A worm, however, does not modify a
program. Instead, it replicates itself again and again. A worm does not perform any destructive
actions, and instead, only consumes system resources to bring it down.
Worm
3. Trojan Horse:
A Trojan horse is a hidden piece of code, like a virus. However, the purpose of a Trojan horse is
different. Whereas the main purpose of a virus is to make some sort of modifications to the target
computer or network, a Trojan horse attempts to reveal confidential information to an attacker.
Trojan horse
Dealing with Viruses:
Preventing viruses is the best option. it is almost impossible to achieve cent per cent security
given that the world is connected to the Internet all the time.
Virus-elimination steps
Detection of viruses involves locating the virus, having known that a virus has attacked.
Then we need to identify the specific virus that has attacked.
Finally, we need to remove it.
For this, we need to remove all traces of the virus and restore the affected programs/files
to their original states.
This is done by anti-virus software.
Plain Text: Any communication in the language that you and I speak—that is the human
language—takes the form of plain text or clear text. plain text, signifies a message that can be
understood by the sender, the recipient, and also by anyone else who gets access to that message.
For instance, they replace each alphabet in their conversation with another character. As
an example, they replace each alphabet with the alphabet that is actually three alphabets down
the order. So, each A will be replaced by D, B will be replaced by E, C will be replaced by F, and so
on. To complete the cycle, each W will be replaced by Z, each X will be replaced by A, each Y will
be replaced by B and each Z will be replaced by C.
A scheme for codifying messages (replacing each alphabet with an alphabet three places
down the line)
Thus, using the scheme of replacing each alphabet with the one that is three places down the line,
a message I love you shall become L ORYH BRX
SUBSTITUTION TECHNIQUES
Caesar Cipher:
In the substitution-cipher technique, the characters of a plain-text message are replaced
by other characters, numbers or symbols.
The Caesar cipher is a special case of substitution technique wherein each alphabet in a
message is replaced by an alphabet three places down the line.
The Caesar cipher is a special case of substitution technique wherein each alphabet in a
message is replaced by an alphabet three places down the line.
All that is required to break the Caesar cipher is to do the reverse of the Caesar cipher
process.
Replace each alphabet in a cipher-text message produced by Caesar cipher with the
alphabet that is three places up the line
Algorithm to break Caesar cipher
Example:
The process shown above will reveal the original plain text. Thus, given a cipher-text
message L ORYH BRX, it is easy to work backwards and obtain the plain text I LOVE YOU
We can see that the cipher text shown in the first row of the figure needs 25 different attempts to
break in, as depicted by the algorithm shown earlier. As it turns out, the 18th attempt reveals the
correct plain text corresponding to the cipher text.
A cryptanalyst is a person who attempts to break a cipher-text message to obtain the original
plain-text message. The process itself is called cryptanalysis. The process of trying to break any
cipher-text message to obtain the original plain-text message itself is called cryptanalysis, and the
person attempting a cryptanalysis is called a cryptanalyst.
Mono-alphabetic Cipher:
The major weakness of the Caesar cipher is its predictability. Now imagine that rather than using
a uniform scheme for all the alphabets in a given plain-text message, we decide to use random
substitution.
This means that in a given plain-text message, each A can be replaced by any other alphabet (B
through Z), each B can also be replaced by any other random alphabet (A or C through Z), and so
on.
Mono-alphabetic ciphers pose a difficult problem for a cryptanalyst because it can be very
difficult to crack, thanks to the high number of possible permutations and combinations.
Playfair Cipher:
The Playfair cipher, also called Playfair square, is a cryptographic technique used for manual
encryption of data. The Playfair encryption scheme uses two main processes.
The simple columnar transposition technique simply arranges the plain text as a sequence of
rows of a rectangle that are read in columns randomly.
Algorithm:
Step1: Write the Plain-text message row by row in a rectangle of a pre-defined size.
Step2: Read the message column by column . However it need not be in the order of columns
1,2,3 etc. It can be any random order such as 2,3,1.
Cipher text produced by the simple columnar transposition technique with multiple rounds is
much more complex to crack as compared to the basic technique.
Algorithm:
Step1: Write the Plain-text message row by row in a rectangle of a pre-defined size.
Step2: Read the message column by column . However it need not be in the order of columns
1,2,3 etc. It can be any random order such as 2,3,1.
Step3: The message thus obtained is the cipher text for round 1
The Vernam cipher, whose specific subset is called one-time pad, is implemented using a random
set of non-repeating characters as the input cipher text.
Algorithm:
Step1: Treat each plain text alphabet as a number in an increasing sequence , ie; A=0, B=1, …Z=25
Step2: Do the same for each character of the input cipher text
Step3: Add each number corresponding to the plain text alphabet to the corresponding input
cipher text alphabet number
Step4: If the sum thus produced is greater than 26, subtract 26 from it
Step5: Translate each number of the sum back to the corresponding alphabet. This gives the
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
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
The process of encoding plaintext messages into cipher text messages is called
encryption.
The reverse process of transforming cipher-text messages back to plain text messages is
called decryption.
The second aspect of performing encryption and encryption of messages is the key
A key is something similar to the one-time pad used in the Vernam cipher.
There are two cryptographic mechanisms, depending on what keys are used.
If the same key is used for encryption and decryption, we call the mechanism symmetric
key cryptography.
If two different keys are used in a cryptographic mechanism we call the mechanism
asymmetric key cryptography.
SYMMETRIC AND ASYMMETRIC CRYPTOGRAPHY
Symmetric Key Cryptography: If the same key is used for encryption and decryption, we
call the mechanism symmetric key cryptography.
Lock-key pairs= n * (n – 1)/2
STEGANOGRAPHY
Steganography is a technique that facilitates hiding of a message that is to be kept
secret inside other messages.
Steganography example
suppose that we have a secret message to send. We can take another image file and we can
replace the last two rightmost bits of each byte of that image with (the next) two bits of our secret
message. The resulting image would not look Cryptography Techniques 65 too different, and yet
carry a secret message inside! The receiver would perform the opposite trick: it would read the
last two bits of each byte of the image file, and reconstruct the secret message.
KEY DISTRIBUTION CENTER(KDC)
In cryptography, a key distribution center (KDC) is part of a cryptosystem intended to
reduce the risks inherent in exchanging keys.
KDCs often operate in systems within which some users may have permission to use
certain services at some times and not at others.
The KDC will use cryptographic techniques to authenticate requesting users as
themselves.
Encryption Process
Decryption Process
The process of decryption in Feistel cipher is almost similar.
Instead of starting with a block of plaintext, the ciphertext block is fed into the start of the
Feistel structure
The only difference is that the subkeys used in encryption are used in the reverse order.
The final swapping of ‘L’ and ‘R’ in last step of the Feistel Cipher is essential.
DATA ENCRYPTION STANDARD(DES)
The Data Encryption Standard (DES), also called the Data Encryption Algorithm (DEA)
DES is a block cipher.
DES has been found vulnerable against very powerful
How does DES Work?:
It encrypts data in blocks of 64 bits each.
That is, 64 bits of plain text goes as the input to DES, which produces 64 bits of cipher text.
The same algorithm and key are used for encryption and decryption, with minor
differences.
Idea of IP
Initial Permutation (IP) table
Round Function:
Next, each 4-bit block of the above step is then expanded to a corresponding 6-bit block.
That is, per 4-bit block, 2 more bits are added.
S-box Substitution:
S-box substitution is a process that accepts the 48-bit input from the XOR operation
involving the compressed key and expanded RPT, and produces a 32-bit output using the
substitution technique.
The substitution is performed by eight substitution boxes
Each of the eight S-boxes has a 6-bit input and a 4-bit output.
The 48-bit input block is divided into 8 sub-blocks
S-box substitution
S-Boxes
P-box Permutation
The output of S-box consists of 32 bits. These 32 bits are permuted using a P-box.
This straightforward permutation mechanism involves simple permutation, without any
expansion or compression.
P-box permutation
XOR and Swap
The left half portion of the initial 64-bit plain text block (i.e. LPT) is XORed with the output
produced by P-box permutation.
The result of this XOR operation becomes the new right half (i.e. RPT). The old right half
(i.e. RPT) becomes the new left half, in a process of swapping.
Final Permutation
At the end of the 16 rounds, the final permutation is performed (only once).
The 40th input bit takes the position of the 1st output bit, and so on.
The output of the final permutation is the 64-bit encrypted block
Final permutation
DES Decryption
The decryption using DES would employ a completely different approach.
The same algorithm used for encryption in DES also works for decryption
The only difference between the encryption and the decryption process is the reversal of
key portions
If the original key K was divided into K1, K2, K3, …, K16 for the 16 encryption rounds, then
for decryption, the key should be used as K16, K15, K14, …, K1
Triple DES
3TDES consists of three different DES keys K1, K2 and K3.
3TDES key has length 3×56 = 168 bits
Triple DES systems are significantly more secure than single DES.
But, these are clearly a much slower process than encryption using single DES.
Principles of AES
No of rounds=10 rounds
Substitution:
Shift Row Transformation
Mixed Columns
Decryption:
The process of decryption of an AES cipher text is similar to the encryption process in the
reverse order.
Each round consists of the four processes conducted in the reverse order
Mix columns
Shift rows
Byte substitution
Stream Ciphers:
Stream-cipher technique involves the encryption of one plain-text bit at a time. The
decryption also happens one bit at a time.
Suppose the original message (plain text) is Pay 100 in ASCII (i.e. text format).
When we convert these ASCII characters to their binary values, let us assume that it
translates to 01011100
Let us also assume that we apply the XOR logic as the encryption algorithm.
Example:
Another interesting property of XOR is that when used twice, it produces the
original data
Example:
A=101, B=110
C= A XOR B
B = C XOR A
A = C XOR B
RC4
RC4 is a stream cipher
This is combined with the plain text using XOR for encryption.
RC4 Process
There is a variable length key consisting of 1 to 256 bytes (or 8 to 2048 bits).
This key is used to initialize a 256-byte state vector with elements identified
as S [0]. S [1]. ...., S [255].
Overall, there are two processes involved: (a) initialization of S, and (b)
stream generation
Initialization of S:
Create another temporary array T. If the length of the key K (termed as keylen) is
256 bytes, copy K into T as is.
Algorithm:
for i= 0 to 255
S[i] = i;
j = 0;
for i = 0 to 255
do
i , j = 0;
do
i = (i + 1 ) mod 256
k = s[t];
RC4 inside:
Consists of 2 parts
j = 0;
for i = 0 to 255
do
End for
Because the only operation on S is a swap, the only effect is a permutation. S still contains all the
numbers from 0 through 255.
i , j = 0;
plen=length[plainbtext];
while(plen>0)
i = (i + 1 ) mod 256
plen= plen-1;
endwhile
Example:
PRGA
XXXXXXXXXXXXXXTHE ENDXXXXXXXXXXXX