painor / telethon-tgcrypto

MIT License
8 stars 3 forks source link

Upgrade for CTR mode encryption #2

Open igerzog opened 2 years ago

igerzog commented 2 years ago

For better performance telethon-tgcrypto upgrade is recommended to support CTR encryption mode.

Download media speed test for media size: 3259594

Without telethon-tgcrypto — Download time: 58.57s

With telethon-tgcrypto — IGE encryption only — Download time: 56.94s

__all__ = ["decrypt_ige", "encrypt_ige"]

With telethon-tgcrypto — IGE + CTR encryption — Download time: 4.41s

__all__ = ["decrypt_ige", "encrypt_ige", "encrypt_ctr", "decrypt_ctr"]
painor commented 2 years ago

What kind of media are you downloading? CTR is only used in CDN and I've never seen them being used.

igerzog commented 2 years ago

Ordinary GIF. CTR is used for any photo and video as I have tested.

painor commented 2 years ago

are you behind a VPN/proxy? I need to test it

igerzog commented 2 years ago

No, direct connection.