I have witnessed how the ADB bot compresses some attachments,
and it occurred to me to think because delta doesn’t have an integrated compressor, which automatically compresses some attachments.
I think this would allow for significant data savings and increased speed.
OpenPGP already compresses the message losslessly before encryption, but after encryption the message is base64-encoded. We can hardly do anything about it, because other encodings for OpenPGP are not standardized. There is a binary MIME content-transfer-encoding, but it is not widely supported and can’t be used to re-encode OpenPGP messages: OpenPGP messages are not using base64 Content-Transfer-Encoding, but ASCII-Armoring instead. OpenPGP message is basically a text message starting with -----BEGIN PGP MESSAGE-----, not a binary file. On TLS level compression is deprecated for security reasons, because of BREACH and similar attacks.
As a result, we end up with gzip compression + 33% base64 overhead.
“Attachment” is just a special type of MIME part, it does not matter whether OpenPGP message is sent as a first part, attachment or anything else. The only ways to decrease message payload size further is to replace ASCII armoring with binary encoding (not specified by OpenPGP) or to use better compression instead of gzip.
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)
There is already an 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.