Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
lacre:ongoing [2024/04/19 12:43] – Research: avoiding message transformation pfmlacre:ongoing [2024/04/19 13:02] – Research: avoiding... - multipart messages pfm
Line 17: Line 17:
 The problem with the first approach is that if we choose to encrypt an ''EmailMessage'', its contents is serialised by an appropriate [[https://docs.python.org/3/library/email.generator.html|email.generator]] implementation, instead of producing the original content. This is OK for payloads like text in pure ASCII or Unicode with Latin scripts, but things get tricky when we want to transfer non-Latin scripts (e.g. Japanese, Chinese, or any of the Cyrillic alphabets). (This is mostly caused by different ''Content-Transfer-Encoding'' being chosen by ''email.generator''.) The problem with the first approach is that if we choose to encrypt an ''EmailMessage'', its contents is serialised by an appropriate [[https://docs.python.org/3/library/email.generator.html|email.generator]] implementation, instead of producing the original content. This is OK for payloads like text in pure ASCII or Unicode with Latin scripts, but things get tricky when we want to transfer non-Latin scripts (e.g. Japanese, Chinese, or any of the Cyrillic alphabets). (This is mostly caused by different ''Content-Transfer-Encoding'' being chosen by ''email.generator''.)
  
-''BytesHeaderParser'' and its string counterpart let us only parse the headers and keep original message body in memory. The drawback is that we can't process multipart messages as sequences of MIME entities, which we need for one of the Lacre's modes of operation. (There are two: PGP/MIME with whole body encrypted and PGP/Inline with each part of multipart message encrypted separately.) We could use ''BytesHeaderParser'' with PGP/MIME only.+''BytesHeaderParser'' and its string counterpart let us only parse the headers and keep original message body in memory. The drawback is that we can't process multipart messages as sequences of MIME entities, which we need for one of the Lacre's modes of operation. (There are two: PGP/MIME with whole body encrypted and PGP/Inline with each part of multipart message encrypted separately.) We could use ''BytesHeaderParser'' with PGP/MIME only, because a multipart message would be impossible to handle in PGP/Inline mode.