October 13, 2012

Block cipher

Conventional cryptosystems are widely used throughout the world today, and new systems are published from time to time. 

There are two kinds of one-key ciphers: 
  • stream ciphers
  • block ciphers 

In stream ciphers a long sequence of bits is generated from a short string of key bits, and is then added bitwise module 2 to the plaintext to produce the ciphertext. In block ciphers the plaintext is divided into blocks of a fixed length, which are then encrypted into blocks of ciphertexts using the same key.

The block cipher is one of the more popular methods for hiding information. Is a type of symmetric-key encryption algorithm in which an algorithm and key are applied to a block of data (for example, 64 contiguous bits) at once as a group rather than to one bit at a time.

Decryption is performed by applying the reverse transformation to the ciphertext block using the same secret key

Using this encryption we assure that identical blocks of text do not get encrypted the same way in a message.

The first thing that a block cipher must do is break the original text or plaintext into blocks of equal size. A block is a group of characters, like 'iamablock'. The most common block size is 8 characters, or 64 bits. If the total number of characters in the plaintext is not divisible by the block size, then extra characters are generally added on to the end of the plaintext until a complete last block can be formed in other words extra characters are appended in order to have an eight-character block. Here is an example using a quote by former U.S. President Franklin Delano Roosevelt:

plaintext:                   The only thing we have to fear is fear itself
modified plaintext:   Theonlythingwehavetofearisfearitself
plaintext in blocks:   Theonlyt hingweha vetofear isfearit selfXend

This method of adding additional data or characters in order to make a complete block is called padding. 

Now that we have the information in chunks of 8 characters or in blocks, each block is transformed into another equally sized block. For example, we  have a block size of eight characters, each block would be transformed into a different, eight-character ciphertext block using any other cryptographic technique to transform each block. For this example we are going to use a simple transposition cipher to encrypt each block

plaintext:                  The only thing we have to fear is fear itself
plaintext blocks:      Theonlyt hingweha vetofear isfearit selfXend
ciphertext blocks:    tylnoehT ahewgnih raefotev tiraefsi dneXfles
ciphertext:                tylnoehTahewgnihraefotevtiraefsidneXfles

The cipher that we use to encrypt the plain text in blocks es very simple, we just reverse each block, this means that the last character becomes the first, the second becomes the second to last and so on. For more security, we can send the message in blocks of a different size than the original used. For example the ciphertext can be sent in this form:

ciphertext: tylno ehTah ewgni hraef otevt iraef sidne Xfles

This technique may no represent any difficult for decoding this text. Simply by reversing all the text and eliminating the white spaces. This is just for making an example and understand better about block cipher.

Eliminating white spaces and reversing the text, it would be like this:

ciphertext: selfXendisfearitvetofearhingwehaTheonlyt

We just need to figuring out the eight-character block size, and reversing the order of the blocks.

Sources


No comments:

Post a Comment