On Tue, May 08, 2001 at 01:10:03AM -0500, Scott Gregory Miller wrote:
> >
> > Ok, instead of starting off the Document-header with the crypto key itself,
> > let's start it with the SHA1 hash of the crypto key, so Document-header
> > looks like:
> >
> > <2 bytes, byte length of crypto key hash, i.e. 0x0014>
> Just use one byte, a hash has no real business producing more than 2048
> bits of output.
Remember, this is part of a general sequence of byte fields with 2-byte
length markers. I mean, we could use a 1 byte length for the crypto key
hash, and use MPIs for the data length and metadata length, but I think
the most important thing is to preserve the generality of being able
to parse out a series of byte fields without understanding what they
contain -- for the sake of code modularity and extensibility.
> > <20 bytes crypto key hash>
> > <2 bytes, byte length of data length field>
> > <big endian data length>
> > <2 bytes, byte length of metadata length field>
> > <big endian metadata length>
> >
> > Now if my limited understanding of crypto is correct, arranging it so
> > the plaintext to be encrypted begins with the hash of the crypto key
> > is just as good as initializing the IV with some hash function of
> > the crypto key, so we can leave the IV initialized to all zeroes,
> > right?
> Yes, that should be safe, that would give the IV 120 bits of randomness.
Great, so I think we almost have a standard for the Document-header now.
The only thing I'm still concerned about is padding it out to a power of
2 length. Currently we've agreed to zero-pad, but I don't really see how
it's less risky here than in the actual file data.
So I propose we:
1. require 2 bytes of zeroes after the last byte field, to give a
"null length marker" indicating the end.
2. pad the resulting byte stream using the same technique I proposed
for the file data.
#1 would also let us drop the requirement that the byte fields not have
odd lengths, which was no more than a parser convenience.
--
# tavin cole
#
# "The process of scientific discovery is, in effect,
# a continual flight from wonder."
# - Albert Einstein
_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://lists.freenetproject.org/mailman/listinfo/devl