Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Preface: here is the official site for the Blowfish algorithm:

http://www.schneier.com/blowfish.html

The Blowfish algorithm uses an s-box, which consists of hex digits of pi (found here: http://www.schneier.com/code/constants.txt). I'm guessing that this s-box serves a very similar purpose to the s-box in AES (right?)

However, at the bottom of that file, there is a smaller box called p_array or parray or something. I have no idea what it does! Also, is there some sort of significance to why the hex digits for pi are used, and not some random values?

share|improve this question
1  
Actually, the digits of $\pi$ are only used as the initial value of the P- and S-boxes. During the key schedule, they will be replaced by pseudo-random numbers depending on the initial values as well as the key. –  Paŭlo Ebermann Nov 8 '12 at 9:32
add comment

migrated from security.stackexchange.com Nov 8 '12 at 8:21

This question came from our site for Information security professionals.

1 Answer

up vote 1 down vote accepted

Yes. Blowfish's S-boxes serve a similar purpose as AES's S-box.

The P-array is used as part of the key schedule, to make sure that each round is different (this helps prevents slide attacks and related-key attacks).

I recommend you read the official specification of Blowfish and Wikipedia's article on Blowfish for more about the design rationale for Blowfish.

The use of digits of pi is a "nothing up my sleeve" number.

Bruce Schneier (the algorithm designer) wanted to use a random number. For Blowfish, it basically doesn't matter what number you use, if it is random. However, Bruce also wanted everyone to be able to see that he didn't somehow pick some very special choice of number that introduces a trapdoor. The digits of pi are basically random-looking, and cannot be controlled by Bruce. Therefore, they make a standard choice for a "nothing up my sleeve" number.

See also How to choose constants in a cryptographic function? and Wikipedia on nothing up my sleeve numbers.

share|improve this answer
    
That was really helpful. I've been studying this algorithm lately and I just wanted to make sure those assumptions were correct! Since you seem to know a lot about this, I just found an interesting quotation from Schneier that I could use some insight on. He said "there is a class of keys that can be detected, although not broken--in Blowfish variants of 14 rounds or less." Do you know what he means, and why it is true? –  SwaroopGiwali Nov 8 '12 at 8:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.