Accéder au contenu.
Menu Sympa

belenios-discuss - Re: [Belenios-discuss] Which BASE64()?

Objet : Discussion list for Belenios

Archives de la liste

Re: [Belenios-discuss] Which BASE64()?


Chronologique Discussions 
  • From: Stéphane Glondu <stephane.glondu AT inria.fr>
  • To: Julien Moutinho <julm+inria AT autogeree.net>
  • Cc: belenios-discuss AT lists.gforge.inria.fr, Mieux Voter <contact AT mieuxvoter.fr>
  • Subject: Re: [Belenios-discuss] Which BASE64()?
  • Date: Fri, 16 Aug 2019 09:25:20 +0200
  • List-archive: <http://lists.gforge.inria.fr/pipermail/belenios-discuss/>
  • List-id: Discussion list for Belenios <belenios-discuss.lists.gforge.inria.fr>

Le 15/08/2019 à 17:04, Julien Moutinho a écrit :
> In section "4.12 Ballots" of the 1.6 specification of Helios-C,
> a BASE64() function is mentioned,
> one would expect it to be the base64 encoding of RFC4648.
> But currently Belenios uses Cryptokit.Base64.encode_compact
>> Same as Cryptokit.Base64.encode_multiline, but the output is not
>> split into lines, and no final padding is added.
>> This is adequate for encoding short strings for transmission
>> as part of URLs, for instance.
> Source:
> /usr/share/doc/libcryptokit-ocaml-dev/cryptokit/Cryptokit.Base64.html
>
> And AFAICS encode_compact is not exactly the same as RFC4648's base64,
> which requires padding by default:
>> 3.2. Padding of Encoded Data
>>
>> In some circumstances, the use of padding ("=") in base-encoded data
>> is not required or used. In the general case, when assumptions about
>> the size of transported data cannot be made, padding is required to
>> yield correct decoded data.
>>
>> Implementations MUST include appropriate pad characters at the end of
>> encoded data unless the specification referring to this document
>> explicitly states otherwise.
> Source: https://tools.ietf.org/rfc/rfc4648

Thank you for this precision.

> Could Belenios use encode_compact_pad?

In Belenios, we don't decode but even if we did the encoded thing is
always 256 bits (the output of SHA256) so the padding is always the same
and has no point. Really, we use Base64 just as a way to compress SHA256
output.

I'd rather make the specification more precise, and explicitly mention
the compact-with-no-padding encoding there.


Cheers,

--
Stéphane





Archives gérées par MHonArc 2.6.19+.

Haut de le page