tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.06k stars 2.23k forks source link

Question about truncated MAC in mediacipher.py #3260

Open EvanXiaa opened 5 months ago

EvanXiaa commented 5 months ago

Hey guys, I just noticed that the MAC encoded are truncated here.

        mac = hmac.new(mac_key, digestmod=hashlib.sha256)
        mac.update(iv)
        mac.update(ciphertext)

        return ciphertext + mac.digest()[:10]

Curious about why we are not using the complete MAC here for better security?