# Thread: Total number of codes generated from 8 bit blocks

1. ## Total number of codes generated from 8 bit blocks

I have a question(and answer) for an assignment in my Cryptography course but I am having a hard time communicating my answer in terms that are mathematically sound.

Take an n block of bits message. Split this block of bits into 8 bit sections(assume that 8 divides n). For each 8 bit block we choose a permutation of the bits. How many different codes could come out of this?

I know that each block of 8 bits has 2^8 possible combinations. I also know that since 8|n then there is a k such that n = 8k. All the possible combinations are given by adding 2^8 a number of k times.

can I say that the total number of possible codes is given by ....

summation from i = 1 to k of [2 sub i]^8 ??????

or maybe [2 sub 1]^8 + [2 sub 2]^8 + ......... + [2 sub k]^8??????

2. ## Re: Total number of codes generated from 8 bit blocks

Originally Posted by restin84
I have a question(and answer) for an assignment in my Cryptography course but I am having a hard time communicating my answer in terms that are mathematically sound.

Take an n block of bits message. Split this block of bits into 8 bit sections(assume that 8 divides n). For each 8 bit block we choose a permutation of the bits. How many different codes could come out of this?

I know that each block of 8 bits has 2^8 possible combinations. I also know that since 8|n then there is a k such that n = 8k. All the possible combinations are given by adding 2^8 a number of k times.

can I say that the total number of possible codes is given by ....

summation from i = 1 to k of [2 sub i]^8 ??????

or maybe [2 sub 1]^8 + [2 sub 2]^8 + ......... + [2 sub k]^8??????
There are n/8 bytes in the message, each byte can have any of the 8! bit permutations applied to it therefore there are 8! (n/8) possible cyphers that can be used on a n bit message.

CB

3. ## Re: Total number of codes generated from 8 bit blocks

so 2^8 is not important at all? what does it reveal about the problem? anything?

4. ## Re: Total number of codes generated from 8 bit blocks

Originally Posted by restin84
so 2^8 is not important at all? what does it reveal about the problem? anything?
It is the number of possible bit patterns in a byte (it does not appear in the answer because a code is a set of permutations that will be applied to the bytes of the message, and there are 8! permutations of an 8-bit character).

CB

5. ## Re: Total number of codes generated from 8 bit blocks

okay that makes sense. There is a little bit of a language barrier in the classroom so I have been learning a lot on my own and now on math forums as well. Thank you very much and thanks for the quick response.

6. ## Re: Total number of codes generated from 8 bit blocks

Maybe I don't understand the problem, but it seems to me that since each byte can be scrambled in 8! ways and there are n/8 bytes, the total number of ciphers possible is (8!) ^ (8/n).