ietf-smtp
[Top] [All Lists]

Re: [ietf-smtp] quoted-unprintable ?

2021-03-25 18:43:56
>> On Thu, 25 Mar 2021, Tony Finch wrote:
>> > Stuart Cheshire and Mary Baker have a super elegant binary escaping scheme
>> > called "consistent overhead byte stuffing" (COBS) that has a guaranteed
>> > overhead of less than 1%.
>> >
>> > http://www.stuartcheshire.org/papers/COBSforToN.pdf
>
>> That's quite clever, although it only avoids a single value and it's not
>> immediately obvious how to extend it to multiple values.  Applying it
>> iteratively for different values wouldn't work.
>
> If you really think this is a problem worth solving, the simplest way to do
> it is encrypt the dats using a fast encryption scheme and a fixed key.
> Encryption pretty much guarantees that there won't be too many of any 
particular byte
> value.

Look at the paper, which is solving a different problem.  He's dealing
with a situation where there is one special byte (zero in his example)
which is used to frame blocks, and this twiddles the data in a way that
gets rid of zeros very cheaply.

I'm aware of the problem the paper solves and that it isn't the problem we need
solved.

Our problem is different. There's at least one value we need to avoid
(zero), and two that we need to quote when they're in the data, and ignore
otherwise (CR and LF).  COBS doesn't help either with quoting CR and LF
when they are significant or ignoring them when they are not.

I agree, which is why I proposed two approaches that both address the problem
we're actually trying to solve. More specifically, the bloat associated with
quoting is only a problem when the characters you're quoting comprise a
significant fraction of the input data. Any competent encryption scheme produces
something close to uniformly distributed output, which is about as good as
you're going to get.

The second proposal actually analyzes the input, shifts characters around
to avoid the problematic cases, and selects a good quoting character.

                                Ned

_______________________________________________
ietf-smtp mailing list
ietf-smtp(_at_)ietf(_dot_)org
https://www.ietf.org/mailman/listinfo/ietf-smtp

<Prev in Thread] Current Thread [Next in Thread>