Thursday, October 29, 2009

Lab 3- Classic Cryptography

In this lab, we need to
- Explain What is Symmetric and Asymmetric Cryptography
- Implementing Caesar Cipher for Symmetric Cryptography.
- Implementing Vigeneré Cipher for Symmetric Cryptography.

Symmetric encipherment

Caesar Cipher

The Caesar Cipher is formed by shifting the letters of the original alphabet. For example by replacing each letter of the alphabet with the letter three places down the alphabet. It is monoalphabetic as only one letter in plaintext is exchanged for one letter of ciphertext.

plaintext : 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

ciphertext : D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

A caesar chiper with a key 3

For an example the plain text in figure 4.2 below can be encrypted using key 3 to get the cipher text in figure below

plaintext : THE ATTACK TONIGHT START AT EIGHT,

REGROUP AT STATION A

ciphertext : WKHDWWDFNWRQLJKWVWDUWDWHLJK

WUHJURXSDWVWDWLRQD

A brute-force cryptanalysis is easily performed: by simply trying all the keys available.

The characteristics which enables the use of brute-force cryptanalysis:

1. The encryption and decryption algorithms are known
2. There are only 26 keys to try.
3. The language of the plaintext is known and easily recognizable. The pattern is obvious.

Task 1 – Deciphering simple substitution cipher text

Remind! Use a spreadsheet program to help you in encrypting your plaintext or decrypting your ciphertext

1. By using key 9 encrypt the following phrase

* Information Technology Security
* The target is the building on the right of the zoo
* The Truck is heading toward the dock

2. The following cipher text which is intercepted by the Special Forces during a routine surveillance on a terrorist headquarters. It was known that the cipher text is an English text containing a word ‘FALL’. Decrypt the cipher text.

RCTRZAVGGNJOCVORZXVIGZVMIOJNOVIYVBVDIVIYWZXJHZNOMJIBZM

Vigeneré Cipher

The cipher text encrypted using Caesar cipher method is easily broken by using a brute force attack. An attacker can easily try every combinations of character to break the code as the number of possibility is just 26. In order to improve the deciphering process we can used the vigeneré cipher method. The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.

A key is needed to encrypt a plaintext; a key can be a word or a phrase. To have a strong cipher text it is advised to use different key on each encryption.


Task 2 – Encrypt and decrypt using vigeneré cipher

  1. Encipher the message ‘CHAPTER 2 AUTHENTICATION AND BASIC CRYPTOGRAPHY ‘using Vigenere cipher and the enciphering key ‘MONEY’.
  2. The following ciphertext was intercepted by the MI6 Forces during a routine surveillance on a terrorist headquarters. It is believe that the first cipher text can be decrypted into (as picture below)

and the second ciphertext intercept

Authentification and Access Control

Authentification
Verification and conformation on someone of identity who generated some data. It involve confirming the identity of a person, tracing the origins of an artifact, ensuring that a product is what its packaging and labeling claims to be, or assuring that a computer program is a trusted one.

Requirement:
1. Message come from apparent source or author
2. Content are not be altered
3. It was sent at a certain time or sequence

Protection of passwords
1. Don’t keep your password to anybody
2. Don’t write or login your password at everywhere
Etc.

Choosing a good password
1. Criteria: -Hard to guess and easy to remember
2. Characteristics of a good password
-Not shorter than six characters
-Not patterns from the keyboard

Calculations on password
1. Password population, N =rs
2. Probability of guessing a password = 1/N
3. Probability of success, P=nt/N

Time taken by intruder to crack your password
Biometric

uniquely recognizing humans based upon one or more intrinsic physical or behavioral traits. In information technology, in particular, biometrics is used as a form of identity access management and access control. It is also used to identify individuals in groups that are under surveillance. It is because each person is unique.

Biometric Identifiers

  • Universality
  • Uniqueness
  • Stability
  • Collectability
  • Performance
  • Acceptability
  • Forge resistance

Biometric methods

  • Vein recognition (hand)
  • Palmprint
  • Gait recognition
  • Body odour measurements
  • Ear shape
  • DNA
  • Keystroke dynamics
Static and Dynamic Biometric method
Static (also called physiological) biometric methods – authentication based on a feature that is always present.

Dynamic (also called behavioural) biometric methods – authentication based on a certain behaviour pattern.

Access Control : The prevention of unauthorized use of a resource, including the prevention of use of a resource in an unauthorized manner.


Access Control Element :
1.Subject - entity that can access objects
-a process representing user/application
-often have 3 classes: owner, group, world
2. Object - access controlled resource
-e.g. files, directories, records, programs etc
number/type depend on environment
3. Access right - way in which subject accesses an object
-e.g. read, write, execute, delete, create, search

This is the basic of the authentification that i can tell. For futher information about authentification you can just use http://www.google.com .

Lab 2- The Goal of Information Technology Security

In general the term “Security” is use to describe the quality or state of being secure that is to be free from danger or to be protected from those who would do harm, intentionally or otherwise. In Information Security it is refer to the protection of information and the systems and hardware that use, store, and transmit that information.

Information security involves the security in an organization regarding the application security, policies involves and Information Technology infrastructure to create a secure and protected computing environment for an organization. The goals of an Information security are confidentiality, integrity and availability. In contemporary computer network environments, another goal to be achieved is to provide legitimate use of resources which ensuring that resources are from the original source.

In creating a secure computing environment, one must know how to balance these three elements. If one of the element is more or less it will affect the functionality of the system, for instance if you concentrate on providing the total confidentiality of the information then the availability of the data is less. Thus the balance between the elements is very important and this is the challenge a security administrator has to face. The relationship between the three goals is depicted in figure below.

5 objective that need to be achieve in this lab :

  1. Understand What is Information Technology Security goals
  2. Determine if partition is NTFS or FAT32
  3. Implementing confidentiality in Windows Server 2003
  4. Implementing integrity in Windows Server 2003
  5. Implementing availibility in Windows Server 2003



Exercise that have been to do :

Using NTFS to Secure Local Resources.
NTFS (New Table File System) is designed with local file security in mind. It is compatible with FAT; local file security will be enabled only if you have NTFS installed.

1. Open your winserv03 virtual machine
2. Log on to the Windows 2003 server as Administrator.
3. Click [Start].
4. Click [Run].
5. Type cmd to invoke the command line. (The FAT partition in this lab will be designated as drive letter D.)
6. At the command line type chkntfs d: to verify that the drive is not using NTFS. You will see the message, “D: is not dirty”. This means that there is no corruption on the drive.

7. To convert a FAT disk to NTFS you need to type at the command line convert d: /fs:ntfs

8. If the drive has a volume label, enter it when prompted. Windows will then convert the drive to NTFS. Note: If you convert the system partition you will have to reboot for the conversion to take place.

9. At the command line type chkntfs d: to verify that the drive is now NTFS.

10. An example of the steps is shown in Figure below.


11. Close all Windows and log off.


Task 2 – Data Confidentality

Once a secure file system is installed, you can begin to think about data confidentiality. Data confidentiality refers to making sure that only those intended to have access to certain data actually have that access. With the FAT file system, this is not possible at the local level, but with NTFS you can lock down both folders and files locally. NTFS can be used to protect data from intruders who may have physical access to the computer containing the data. In this lab, you will create a folder and files, assign NTFS permissions, then verify whether or not the data is confidential.

Before doing this task, we must make sure that :-

  • Login as an administrator
  • Make sure your partition is NTFS
  • Need two user accounts namely user1 and user2 before start this task

Creating user account

1. Two user-level accounts: User1 and User2

  • To create user account go to [Start] | [Administrative Tools] | [Computer Management].
  • Choose [Local User and Groups] and double click on the [user] folder.
  • To create new user right click on the pane and from the pop-up menu choose [New User] and fill up the necessary information such as username and password (use easy to remember password e.g. abc123)

Creating data Confidentiality between 2 user accounts.

1. Log on to the Windows 2003 server as Administrator.

2. Open My Computer, and then double-click on the D: drive.This should be the drive that was converted from FAT to NTFS in task 1

3. Create a new folder called Confidentiality.

4. Double-click the Confidentiality folder and create a new folder called User1Folder.

5. To secure this folder from other users, right-click User1Folder.

6. Click [Properties] to open the User1Folder Properties window.

7. Click the [Security] tab, as seen in Figure 2.3. Note: if the drive was not formatted with NTFS the Security tab will be unavailable

8. Click on the Advanced Button, you will receive a windows as shown in figure below

9. Uncheck the box “Allow inheritable permissions from parent to propagate to this object”.

10. You will receive the message shown in figure below

11. Click [Copy] to retain the permissions.

12. Click [Add] and the Select Users, Computers, or Groups window will pop up.

13. Type User1 and then click [Checks Names].

14. Click [OK].

15. In the Permission Entry windows, click the Allow Full Control box and then click [OK].

16. Remove the other username except Administrator, System and User1 by clicking the username and click the [Remove] button, refer figure below

17. Click OK.

18. Double-click User1Folder.and you should see the content of the folder

19. Close all windows and log off.

20. Log on as User2 and navigate to the User1Folder, can you open it?

21. Close all windows and log off.

Modern Cryptography

Modern Cryptography use a sequence binary such as ASCII that represent each character in the computer keyboard. there are 2 algorithm that popular and being use now :

1. Stream Cypher is a symmetric key cipher where plaintext bits are combined with a pseudorandom cipher bit stream (key stream), typically by an exclusive-or (xor) operation. In a stream cipher the plaintext digits are encrypted one at a time, and the transformation of successive digits varies during the encryption. It also generates successive elements of the keystream based on an internal state. This state is updated in essentially two ways: if the state changes independently of the plaintext or ciphertext messages, the cipher is classified as a synchronous stream cipher.

a.Synchronous stream ciphers : stream of pseudo-random digits is generated independently of the plaintext and ciphertext messages, and then combined with the plaintext (to encrypt) or the ciphertext (to decrypt).


b. Self-Synchronous stream ciphers : has the advantage that the receiver will automatically synchronise with the keystream generator after receiving N ciphertext digits, making it easier to recover if digits are dropped or added to the message stream. Single-digit errors are limited in their effect, affecting only up to N plaintext digits.


2. Block Cipher is a symmetric key cipher operating on fixed-length groups of bits, termed blocks, with an unvarying transformation. A block cipher encryption algorithm might take (for example) a 128-bit block of plaintext as input, and output a corresponding 128-bit block of ciphertext. The exact transformation is controlled using a second input — the secret key. Decryption is similar: the decryption algorithm takes, in this example, a 128-bit block of ciphertext together with the secret key, and yields the original 128-bit block of plaintext and to encrypt messages longer than the block size. There are 2 type:

a. DES (Data Encryption Standard) : The plaintext is divided into 64 bit block with a key of 56bits ( 8 bit parity) and will go through 16 round of expansion, substitution, key mixing and permutation process.

b. RSA ( Rivest, Shamir, Adleman) : algorithm that been use for public-key cryptography. It is the first algorithm known to be suitable for signing as well as encryption, and one of the first great advances in public key cryptography.Widely used in electronic commerce protocols, and is believed to be secure given sufficiently long keys and the use of up-to-date implementations.


RSA Key Setup Example :

1.Select primes: p=17 & q=11
2.Compute n = pq =17 x 11=187
3.Compute ø(n)=(p–1)(q-1)=16 x 10=160
4.Select e: gcd(e,160)=1; choose e=7
5.Determine d: de=1 mod 160 and d < 160 Value is d=23
6.Publish public key PU={7,187}
7.Keep secret private key PR={23,187}


Hash Function : mostly used to speed up table lookup or data comparison tasks — such as finding items in a database, detecting duplicated or similar records in a large file, finding similar stretches in DNA sequences, and other that related. It also any well-defined procedure or mathematical function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an index to an array. The values returned by a hash function are called hash values, hash codes, hash sums, or simply hashes. It must have this 4 criteria:
- easy to compute the hash value for any given message.
-
infeasible to find a message that has a given hash
-
infeasible to modify a message without changing its hash
-
infeasible to find two different messages with the same hash