# Message compressor

**URL:** <https://forum.delta.chat/t/message-compressor/1563>\
**Category:** Feature Proposal\
**Created:** [March 7, 2021, 2:54am UTC](https://forum.delta.chat/t/message-compressor/1563 "2021-03-07T02:54:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slender1808](https://forum.delta.chat/user_avatar/forum.delta.chat/slender1808/32/1054_2.png) [@Slender1808](https://forum.delta.chat/u/Slender1808)\
**Post date:** [March 7, 2021, 2:54am UTC](https://forum.delta.chat/t/message-compressor/1563/1 "2021-03-07T02:54:20Z")

</div>

One way to further reduce the size of the messages would be to add a step at the end of the message process.  
One way would be through this algorithm below, which basically takes the already encrypted string, reducing the length of the string by half

in this test I achieved savings of **25%** in the message size  
about it I did a little demonstration  
[repl.it/talk/share/hash-to-utf/126759](https://repl.it/talk/share/hash-to-utf/126759)

```
var a = 'a';
var z = 'z';
// Convertendo em hex
var a_hex = a.charCodeAt(0).toString(16)
console.log("a: ", a_hex)
var z_hex = z.charCodeAt(0).toString(16)
console.log("z: ", z_hex)
// Concat dos hex
var az_hex = a_hex+z_hex
// Tranformado em numero
var az_int = parseInt(az_hex, 16)
// Convertando hex em char
var res = String.fromCharCode(az_int)
console.log("char",res)
// Converter char em hex
var res_hex = res.charCodeAt(0).toString(16)
console.log("char to hex: ",res_hex)
// Pega duas primeira letras do hex e tranforma em int
var a_char = parseInt(res_hex[0]+res_hex[1], 16)
// Pega duas ultimas letras do hex e tranforma em int
var z_char = parseInt(res_hex[2]+res_hex[3], 16)
// Tranforma cada numero em char junta numa string
var az_char = String.fromCharCode(a_char)+String.fromCharCode(z_char)
console.log("origem: ",az_char)
```

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/user_avatar/forum.delta.chat/link2xt/32/1971_2.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [March 8, 2021, 4:34am UTC](https://forum.delta.chat/t/message-compressor/1563/2 "2021-03-08T04:34:09Z")

</div>

I answered in another thread:

> [@Integrated compressor](https://support.delta.chat/t/integrated-compressor/1128/11):
>
> There is already an [yEnc](https://en.wikipedia.org/wiki/YEnc) encoding doing this. The problem is not that it’s impossible to do, but that it is non-standard and incompatible to other email clients such as K-9 Mail and Thunderbird.

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/user_avatar/forum.delta.chat/link2xt/32/1971_2.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [March 8, 2021, 4:38am UTC](https://forum.delta.chat/t/message-compressor/1563/3 "2021-03-08T04:38:30Z")

</div>

I have looked at this option in the past, Thunderbird even supports yEnc for non-encrypted messages:

> <https://github.com/deltachat/deltachat-core-rust/issues/1754>
>
> Currently attachment is base64-encoded, encrypted, and resulting binary is base64-encoded again, resulting in larger message size for encrypted attachments. While binary...

But overall I decided against it because of incompatibility to other clients. If we want to get rid of ASCII armoring (speaking about OpenPGP messages), we need a joint effort by developers of several email clients, including at least Thunderbird and K-9 Mail, but also KMail, Evolution, mutt etc.

---

<div class="post-metadata">

**Author:** ![Slender1808](https://forum.delta.chat/user_avatar/forum.delta.chat/slender1808/32/1054_2.png) [@Slender1808](https://forum.delta.chat/u/Slender1808)\
**Post date:** [March 8, 2021, 3:13pm UTC](https://forum.delta.chat/t/message-compressor/1563/4 "2021-03-08T15:13:20Z")

</div>

Would OpenPGP people be interested in reducing the size?

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/user_avatar/forum.delta.chat/link2xt/32/1971_2.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [March 8, 2021, 4:38pm UTC](https://forum.delta.chat/t/message-compressor/1563/5 "2021-03-08T16:38:14Z")

</div>

You can join [OpenPGP WG](https://datatracker.ietf.org/wg/openpgp/about/) and see.

Quick search over their mailing list reveals related issues have been discussed several times:

- [In 1997](https://mailarchive.ietf.org/arch/msg/openpgp/rhCewXEeDACJ0rTRmLxR_2ESgLw/)
- [In 2016](https://mailarchive.ietf.org/arch/msg/openpgp/kyMNZZJSYU0MTF3wQI2lcQk_f_4/)

yEnc was discussed in 2016: [Archive](https://mailarchive.ietf.org/arch/msg/openpgp/Q9LruEhDsbVKX091zq40LgSRLX4/)

---

<div class="post-metadata">

**Author:** ![r10s](https://forum.delta.chat/user_avatar/forum.delta.chat/r10s/32/1513_2.png) [@r10s](https://forum.delta.chat/u/r10s)\
**Post date:** [October 6, 2026, 3:02pm UTC](https://forum.delta.chat/t/message-compressor/1563/6 "2026-10-06T15:02:43Z")

</div>


