Computer Security - Assignment 1: Table of Content

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

CIS326 – Computer Security

Assignment 1 – Year 2009/2010


Sebastian Attard - 040354516

Computer Security – Assignment 1


Table of Content
Table of Content 1
Introduction 2
Block Cipher 4
Electronic codebook (ECB) mode 5
Cipher Block Chaining (CBC) mode 6
Output feedback (OFB) mode 9
Improvements 11
Software Used 12
References 13

1|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Introduction

In human history, secrecy always played a big strategy especially during times of
combat and wars, where ambushes and strategic attacks required maximum secrecy
from the enemy.

Special people were usually trained to spy, infiltrate and intercept messages, to
countermeasure attacks and prepare their defence. Mathematicians were then used
to find a way and hide/encrypt messages so that enemies, even if messages are
intercepted, will not be able to read them. Sometimes, messages were encrypted in
a way that it was very easy to read another message. The earliest form of encryption
was to use pictures and symbols instead of letters. [1]

Messages were passed through a function and encoded into other messages using
special keys, which only the sender and the received would have known. The first
encryption function used where rather simple, but they quickly evolved.

Even in sports, quite often we see managers using secret gestures to communicate
with players and give instructions. This method is very used in Baseball.

During the second world war, there was an incident where the use of the enemy’s
secret code resulted in the explosion of a well guarded dock, as the story of the St.
Nazaire Raid tell us, “The British legitimately flew the Kriegsmarine ensign as a false
flag and used a German Morse call sign and gained almost five minutes of
unimpeded progress. Twice the German guns opened fire but were soon silenced by
reassuring coded messages.”

The need of security and encrypted messages today has drastically increased. The
internet today is used for trading, and to access secret files, often used by companies
or by the government. If an attacker get hold of important communication, it could
2|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516
mean the loss of very important data which could lead to loss of big money.
Therefore, companies invested in security software such as VPNs , where data is
being encrypted between 2 or more sites, with private keys being known only by the
end parties.

3|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Block Cipher

Block Cipher is a technique used to encrypted text. A stream of plain text is divided
into blocks, usually equal in size. On each block, a cryptographic key is applied
together with an algorithm/function to produce an encrypted text, also known as
ciphertext. [2]

A block cipher can be achieved in more than one way, some more secure than
others. There are methods where encrypting same messages using same key may
result in duplicate ciphertext, thus ease decryption and will also allow an attacker to
get hold of the key. On the other hand, different methods of encryption have been
designed to eliminate this problem.

4|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Electronic codebook (ECB) mode

In Electronic Codebook Mode, also known as ECB, the text is broken into a set of
predefined blocks, each of same size. Padding may be added to balance each
message block. Each block is then passed through an encryption algorithm, were an
encryption key is applied to each. The blocks are not masked using any feedback
from previous messages, thus 2 identical blocks of text will result in 2 identical
ciphertext.

From the above observation we can deduct that in ECB mode, each plaintext block
has a corresponding ciphertext.

The ECB method is very useful when a fast and simple encryption method is needed.
It is fast because it can be parallelized, since each block is independent. On the other
hand, during decryption, no processing can be done prior to the arrival of the blocks.

Since this method is an easy way to encrypt plain text, and since 2 identical text
blocks generates 2 identical ciphertext, when the same key is used. A cryptanalyst
will identify these 2 blocks, and with the help of a dictionary, will try to identify the
words. Identifying letters such as a, n, d, t, h, e, i, s and others used in repeated short
words will help him/her decrypt other words, thus other letters in the alphabet. It is
very insecure to use, especially when small blocks of plaintext are used (example,
smaller than 40 bits) [2].

Security is better improved if random pad bits are added to each block. Best used are
64-bit long blocks or larger.

Errors: Since in ECB, each blocks are totally independent from each other, errors only
effects the decryption of that particular block. No other ciphertext blocks are
affected. ECE is used to encrypt online games such as Phantasy Star Online.

5|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Cipher Block Chaining (CBC) mode

Cipher Block Chaining, also known as CBC, is an improvement over ECB. It uses the
same concept of blocks, but before applying the key for encryption, it takes the
previous ciphertext and mix it with the plaintext. The Previous ciphertext is XORed
with the plaintext prior to encryption using the key. This is a major improvement
over the ECB, as 2 identical plaintext blocks will not generate the same ciphertext.
However, we do encounter a problem with such a method. Since each block depends
on a previous ciphertext, even the first block has to be XORed with a ciphertext.
Since it is the first one, then an initialization block has to be generated to create the
first ciphertext. This initialization block has to be sent to the receiving end, otherwise
the message cannot be decrypted. This initialization block is called the Initialization
Vector.

The Initialization Vector (also referred to as simply “IV”) can be created in the
following ways:-

A fixed initialization vector may be adopted. At the beginning of the message, the
same IV is repeatedly used at every new message sent. Unfortunately, this also may
result in a flaw. Usually messages between 2 parties tend to start always with the
same words, for example; Hello, Dear or Hi, thus the first block of each message may
always be the same.

The IV can also be chosen in a sequencing way, an example of this is the choice of IV
being in multiples or counting from up to down or vice versa. However, this may also
result in problems, as sequences are easily recognized with specially, powerful and
specifically designed computer programs.

Another possibility is to randomly choose an IV. This is very secure, but problematic
as well, as the random IV needs to be transmitted to the receiving party.

6|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

The solution to all the above problems is to use the Nonce-generated IV.
The Nonce-generated IV is a number used with every message, but used only once.
The number is assigned to a message using a counter. The number is then encrypted
using the block cipher mode, generating a ciphertext, C0, which is then used as the IV.
This generated ciphertext is then XORed with the plaintext, and passed trough a
function using the encryption key to generate the first ciphertext using the CBC
mode.

Thus, chosen an IV, CBC will use a chaining mechanism. [2] It uses a feedback from
the previous ciphertext to encrypt the next plaintext to generate the next ciphertext.
This way it will randomize the plaintext and thus overcome some of the problems of
ECB.

With this great achievement, it still resides a big problem. If one of the blocks will
contain an error, even a single bit, that error will affect the decryption of all
subsequent blocks. [2]

The order of the blocks is also very important, and changing the order will result is a
different decrypted message.

There is also a small possibility that identical ciphertext blocks exists. If the same
plaintext is encrypted using the same key and the same initialization vector, and
keeping the same order, the same ciphertext blocks will be generated. Even though
the above stated is very rare to happen. The advantage of CBC over ECB is that it will
hide patterns in the language.

7|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

The image was taken from www.wikipiedia.com

8|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Output feedback (OFB) mode

Output Feedback Mode, also known as OFB, is yet again an improvement over CBC.
The plaintext is never used as feedback to the next block ciphers. Each XOR function
with each plaintext is done separately and independently from the previous plaintext
and ciphertext.

The feedback is taken from the output of the encryption block. This is a fix over the
error propagation of CBC. Unfortunately, the need for an IV is also needed in OFB. [2]

The stream of generated block ciphers is usually called the keystream. The keystream
is then XORed with the plaintext, to generate the ciphertext.

The improvement of this system is that it may be coupled with many error correcting
codes, thus some errors may be tolerated.

Image taken from www.wikipiedia.com

9|Page
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

In term of computation, since the Block Ciphers depends on each other but not on
the plaintext, or ciphertext, they can be computed in advance, thus encryption may
be performed in parallel.

10 | P a g e
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Improvements
Over the years, there have been improvements on the above encryption algorithms,
and in the 1970s, the US government developed the Data Encryption Standard, also
known as DES. DES was improved over the years with a bigger Key size. DES is not
widely used any more, as it exposes security issues as the stream would repeat itself.

In the year 2000, another encryption standard has been chosen and adopted, which
was called the AES, which is used by the US Government non-classified data. [3]

Others are Twofish , RC6 used in a number of products from RSA data security inc.
and IDEA, which is used in PGP and a number of commercial products.

11 | P a g e
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

Software Used
This document was written on Windows 2003 Server and Windows XP, using
Microsoft’s Word 2007.

12 | P a g e
CIS326 – Computer Security
Assignment 1 – Year 2009/2010
Sebastian Attard - 040354516

References

[1]
Link: http://library.thinkquest.org/27158/history.html
Date : January 18th, 2010

[2]
Link:
http://searchsecurity.techtarget.com/sDefinition/0,,sid14_gci213594,00.html
Date : January 18th, 2010

[3]
Link : http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
Date : March 5th, 2010

13 | P a g e

You might also like