DEV Community

Cover image for Encryption, Explained Properly: AES vs ChaCha20 vs Argon2id (and How to Actually Combine Them)

Encryption, Explained Properly: AES vs ChaCha20 vs Argon2id (and How to Actually Combine Them)

Akhouri Anmol Kumar on October 22, 2026

Description 👇 A hands-on guide to AES-GCM, ChaCha20-Poly1305, Argon2id, HKDF, X25519 and Shamir, with a comparison table, Python code, and a real-w...
Collapse
 
technogamerz profile image
𝐓𝐡𝐞 𝐋𝐚𝐳𝐲 𝐆𝐢𝐫𝐥 •

Okay 👍🏻

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

👍👌

Collapse
 
effessdev profile image
EffessDev •

Can't you make each ATLOCK mention a link so people can click it anytime?

Picked as gem Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

means?

Thread Thread
 
effessdev profile image
EffessDev •

Like this: ATLOCK

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

oh you want that in App I add link to repo or something like that?
if yes then already v5 has buttons for it
or anything else?

Collapse
 
_5c75b1d3a1b3628dec81_58 profile image
Yoshiyuku •

Solid breakdown, especially the key commitment section. Most write-ups skip the partitioning-oracle angle entirely.

One question on the chunked format: index-in-nonce plus header-bound AAD stops reordering, but truncation only gets caught if the chunk count is authenticated or the final chunk carries a distinct flag. Which one does v3.1 use? If it’s neither, dropping trailing chunks would verify cleanly.

Also worth considering: since the release is an unsigned PyInstaller exe, publishing hashes plus a reproducible build recipe would let people verify that the binary matches the readable source you describe.

I do reverse engineering and crypto implementation reviews, so I’m happy to dig into the container parser if that would help.

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

hey Yoshiyuku bro, thaanks a lot man, realy appreciate you reading it this carefully

on truncation v3.1 uses both actualy. plain_len sits in the header and its covered by header_hash, and that header_hash goes into the AAD of every chunk along with the chunk index and a 1 byte is_final flag (aad = header_hash || idx || is_final). so if someone drops trailing chunks the decryptor already knows how many bytes to expect, and a chunck that isnt supposed to be last cant pass as final cuz the flag is authenticated. theres also a check for written != plain_len and for extra data after the last chunk, so cutting the tail gives a truncated container error and never a clean verify

Collapse
 
_5c75b1d3a1b3628dec81_58 profile image
Yoshiyuku •

Good.
Let's keep connection.

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

cool, I prefer to make Bros not connections
so Bros? 🤝?

Thread Thread
 
_5c75b1d3a1b3628dec81_58 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Yoshiyuku •

As your mind.
I like build relationship with engineers.
If you are interested on me, ping me.

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

@effessdev bro speak something or you are becoming xulingfeng? like just reading discussions 😂

Collapse
 
effessdev profile image
EffessDev •

Speak what? 🤔

Collapse
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

hmm no talk left?

Thread Thread
 
effessdev profile image
EffessDev •

Give me 30-60 minutes...

Thread Thread
 
akhourianmolkumar profile image
Akhouri Anmol Kumar •

woahh for whatt to find new talks 😂