Masquerade - Masquerade attack takes place when one entity pretends to be different entity. E.g. Hoax bank sites.

Message modification - It means that some portion of a message is altered or that message is delayed or reordered to produce an unauthorized effect.

Repudiation - Sender denies that it sent the message or the receiver denies that it received the message.

Trojans - A Trojan horse, or Trojan, is a type of malicious code or software that looks legitimate but can take control of your computer. A Trojan is designed to damage, disrupt, steal, or in general inflict some other harmful action on your data or network.

Traffic Analysis - May be the data is masked, so no information can be extracted but some patterns like - sender, receiver, message length, time of the message etc. can be extracted to make intelligent guesses.

Question:

Write the pseudo code of the RC4 stream generation part.

Answer:RC4 is a stream cipher and variable length key
algorithm. This algorithm encrypts one byte at a time (or larger units on a
time). This algorithm involves three steps:

Initialization of Vector S and key K

Initial Permutation of vector S

Stream Generation

Below are the detailed steps for third part of RC4 :

Stream Generation

Once the S vector is initially permuted, the input key
(K) is no longer used.

Stream generation involves cycling through all the
elements of S[i], and for each S[i], swapping S[i] with another byte in S
according to a scheme dictated by the current configuration of S.

As an output a random stream bytes values (k) are
generated.

Pseudo Code

/* Stream
Generation */

i, j = 0;

while (true)

{

i = (i + 1)
mod 256;

j = (j +
S[i]) mod 256;

swap (S[i],
S[j]);

t = (S[i] +
S[j]) mod 256;

k = S[t];

}

NOTE: As only stream generation step is asked in the
question therefore only that step is explained in detail. Below is elaborated
reference for the first two steps of RC4 encryption algorithm.

Initialization of Vector S and key K

Steps

S is a state vector to store 256 bytes, with elements
S[0], S[1]........S[255].

The entries of S are set equal to the values from 0
through 255 in ascending order; that is, S[0] = 0, S[1] = 1, ...... S[255] =
255.

A key (K) of variable length <= 256 bytes is
chosen.

A temporary vector T of 256 bytes is filled with the
values of K. If K = 256, then all of K is filled in T, else K is repeated as
required to fill T.

Pseudo Code

/*
Initialization*/

for i = 0 to
255 do

{

S[i] = i;

T[i] = K[i
mod key_length];

}

Initial Permutation of vector S

Steps

T is used to produce the initial permutation of
S.

This involves starting with S[0] and going through to
S[255], and for each S[i], swapping S[i] with another byte in S according to a
scheme dictated by T[i].

The g function of the AES key schedule is illustrated in the Figure above. As shown, the operation consists of three stages: an S-Box transformation, a permutation, and an exclusive-or. The S-Box operation used in the AES key schedule is identical to the one used in the encryption phase as described previously. In the permutation phase of the g function, each byte of the word is shifted one position to the left. Finally, the leftmost byte is exclusive-ored with a round constant. The rounds constants in AES are the value of 2round_number modulo Galois Field 28.

About WaseianAt WASEIAN group, our affection to all the WASEians who have landed here for up-skilling themselves. We come up with various knowledge assistances with the wide range of Tutorials, Quizzes, Project tasks and Coursework as well.

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Security Werribee