Tuesday, July 6, 2010

Why Cryptography?

Cryptography serves its purpose as to protect confidentiality, proof of authority and to maintain integrity. The below scenario explains on each of the functionality.

1. Confidentiality

The purpose of confidentiality is to ensure that only intended recipient is authorized read the message.

Scenario 1:

Sender(S) encrypts message using Recipient(R)’s public key.

Recipient(R) decrypts message using R’s private key.


A message is intended to be read by R alone. Hence, S has to find a way to ensure that only R has the authority to ‘open’ the message. S will encrypt the message using R’s public key. Take note that any message that has been encrypted with R’s public key can only be decrypted using R’s private key. No one will have R’s private key unless R himself. Since R is the sole owner of his own private key, it is cleared that he is the only authorized person to read the encrypted message.

2. Proof of Authority

Proof of Authority ensures that the message is written and sent out by the originator alone which is a trusted source.

Scenario 2:

Sender(S) encrypts message using Sender(S)’s private key.

Recipient(R) decrypts message using S’s public key.


Initially, a message was written by the original author which is S. S intends to send it to R, at the meantime proving that he is indeed the sole person who wrote and sends it. Hence, S encrypts the message with none other but his own private key. No one will have S’s private key unless himself. Recipient who receives the message will only be able to decrypt it with S’s public key. Therefore, recipient is well assured that the received message was written by S when they are able to decrypt it using S’s public key.

 
3. Integrity

Integrity added another layer of security and is considered as an extension of Scenario 2. It prevents message from being altered during the transmission.

Scenario 3:

Sender(S) hashed the message. Sender(S) then encrypts the hash and the message using S’s private key.

The encrypted hash and message are sent over to Recipient(R).

Verification will be carried out at Recipient’s end.

There will be two-way verification occurred at recipient site.

• Firstly, Recipient(R) decrypts the message using S’s public key. R will get the message after decryption.

Using the similar hashing algorithm, R will perform hashing on the message. The output would be the result of the calculated hash (Hash1).

• At the meantime, the encrypted hash will also be decrypted, the output will be Hash2.

Both Hash1 and Hash2 will be compared. An unaltered message yields a matching hash.

Thursday, July 1, 2010

How to Convert Table to Text

1. Select the rows or table that you want to convert to paragraphs.
2. Under Table Tools, on the Layout tab, in the Data group, click Convert to Text.

How to Embed Excel into Word

1. Open both the Word document and the Excel worksheet that contains the data that you want to create a linked object or embedded object from.
2. Switch to Excel, and then select the entire worksheet, a range of cells, or the chart that you want.
3. Press CTRL+C.
4. Switch to the Word document, and then click where you want the information to appear.
5. On the Home tab, in the Clipboard group, click the arrow under Paste, and then click Paste Special.
6. In the As list, select Microsoft Office Excel object.
7. Click Paste to insert an embedded object, or click Paste link to insert a link to the object.

How to Insert a Formula into a Table in Word 2007


1. Click inside the cell where you want to place the formula.
2. From the Layout tab, in the Data group, click Formula. The Formula dialog box appears.
3. Word automatically fills in the formula based on the numbers in the table and the location of the cell.

Tuesday, April 13, 2010

ASCII to Base64

In data encoding, text are translated into ASCII code to be stored into computers. ASCII code ranges from decimal 1-255. When transferring the data over the network, these data will be translated into binary which is represented by 8 bits. These binary codes will then be converted into Base64 encoding.

Base64 encoding schemes are commonly used when there is a need to encode binary data that needs be stored and transferred over media that is designed to deal with textual data.

Base64 implementation uses A–Z, a–z, 0–9, ‘+’ and ‘/’.

The following table shows the conversion process from text content to base64 encoding.


Explaination:

Row 1: Actual text data given - ‘Man’

Row 2: Textual data ‘Man’ is converted into ASCII which is the data representation in computer.

Row 3: The ASCII is then converted into binary which formed into 8 bits (8 bits= 1 byte). The three alphabets (letter ‘M’, ‘a’ and ‘n’) makes up to 3 bytes which totaled up to 24 bits altogether.

Row 4: Base64 uses only 64 characters, which is equivalent to 26. This means that 6 bits is to be used for base64 encoding. Hence, 24 bits has to be divided into 6 bits each, makes up to 4 sets of 6 bits. The index is summed up from the 6 bits.

Row 5: The index is converted into base64 encoding according to Base64 index table as per below: