Format of the Password Safe data file

The data file used by Counterpane's Password Safe
program has a 28 byte header.  The first eight bytes
of the header is a salt value and the second 20 bytes
is the output of a SHA1 hash.  The hash value is
computed as follows.

BlowfishKey = SHA1 (NormalIV, salt || 0 || 0 || password)
dataBlock = salt
repeat 1000 times:
  dataBlock = BlowfishEncryptECB (BlowfishKey, dataBlock)
hash = SHA1 (ZeroIV, dataBlock || 0 || 0)

The operator || means concatenation.  It is used to add
two bytes of zeros to the SHA1 input buffer as well as
the password in the first use of SHA1.

The SHA1 function takes an initialization vector and
a data buffer to digest.  The NormalIV is the 20 byte
value specified in FIPS-180-1 (H0 through H4).  The ZeroIV 
is all zeros. The use of the ZeroIV occurs in some SHA1
implementations when the SHA1_Init function is not called 
after calling the SHA1_Final function before calling 
SHA1_Update again. Perhaps this was intentional.

The remainder of the file is encrypted with Blowfish
running in CBC mode with a random IV.  The method for
computing the data encryption key was not determined.
