Skip to content

Add encryption algorithm and key derivation algorithm to the 7z format.#505

Open
fzxx wants to merge 2 commits into
mcmilk:masterfrom
fzxx:master
Open

Add encryption algorithm and key derivation algorithm to the 7z format.#505
fzxx wants to merge 2 commits into
mcmilk:masterfrom
fzxx:master

Conversation

@fzxx

@fzxx fzxx commented Jun 13, 2026

Copy link
Copy Markdown
  • Added encryption algorithms: XChaCha20, XChaCha20-Poly1305, AES+XChaCha20-Poly1305, AES+XChaCha20+Ascon
  • Added key derivation algorithms: PBKDF2-HMAC-SHA512, HKDF-BLAKE2sp
  • Adjusted the encryption algorithm dropdown in the GUI
  • Adjusted property display to support showing the newly added algorithms
  • Updated documentation, added algorithm descriptions, copyright and source attribution statements
# AES-256
7z a archive.7z -ppassword -mhe=on
7z a archive.7z -ppassword -mhe=on -mem=aes256
7z a archive.7z -ppassword -mhe=on -mem=aes-256

# XChaCha20
7z a archive.7z -ppassword -mhe=on -mem=xchacha20

# XChaCha20-Poly1305
7z a archive.7z -ppassword -mhe=on -mem=xchacha20poly1305
7z a archive.7z -ppassword -mhe=on -mem=xchacha20-poly1305

# AES+XChaCha20-Poly1305
7z a archive.7z -ppassword -mhe=on -mem=axp
7z a archive.7z -ppassword -mhe=on -mem=aesxchacha20poly1305
7z a archive.7z -ppassword -mhe=on -mem=aes+xchacha20-poly1305

# AES+XChaCha20+Ascon
7z a archive.7z -ppassword -mhe=on -mem=axa
7z a archive.7z -ppassword -mhe=on -mem=aesxchacha20ascon
7z a archive.7z -ppassword -mhe=on -mem=aes+xchacha20+ascon

@mcmilk

mcmilk commented Jun 13, 2026

Copy link
Copy Markdown
Owner

@fzxx - this code looks really good already - thanks a lot

Could you add some testings of the different variants?
Maybe I can also add plot which shows speed differences - this is currently used: https://github.com/mcmilk/7-Zip-Benchmarking/blob/master/linux/runtests.sh

@fzxx

fzxx commented Jun 13, 2026

Copy link
Copy Markdown
Author

@fzxx - this code looks really good already - thanks a lot

Could you add some testings of the different variants? Maybe I can also add plot which shows speed differences - this is currently used: https://github.com/mcmilk/7-Zip-Benchmarking/blob/master/linux/runtests.sh

There's a commit conflict, resolve it first. The chart program seems to run on Linux, and I don't have the environment to test it — you can add it. I've tested the compression speed on Windows, and it's normal.

@fzxx fzxx reopened this Jun 13, 2026
@sebres sebres mentioned this pull request Jun 15, 2026
@fzxx

fzxx commented Jun 23, 2026

Copy link
Copy Markdown
Author

I think it's ready now. Please review it again and then we can merge.

@fzxx

fzxx commented Jun 28, 2026

Copy link
Copy Markdown
Author

Why is there no response at all? The delayed merge is causing conflicts again when updating 7z, so I've already published it elsewhere. @mcmilk

@mcmilk

mcmilk commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Hello @fzxx - please be more kind with me, I have other projects as well - and this one isn't my focus.
Thanks a lot for this PR, I will review it - when there is more time.

You have also several smaller commits which are named "fix sth." .... plase squash them properly and provide some more usefull commits which can be reviewed a bit more easy.

Edit: just as a hint, you can locally rebase things via rebase -i HEAD~10 .... and later user push -f to rewrite this PR.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7.0% Duplication on New Code (required ≤ 3%)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@fzxx

fzxx commented Jun 29, 2026

Copy link
Copy Markdown
Author

Hello @fzxx - please be more kind with me, I have other projects as well - and this one isn't my focus. Thanks a lot for this PR, I will review it - when there is more time.

You have also several smaller commits which are named "fix sth." .... plase squash them properly and provide some more usefull commits which can be reviewed a bit more easy.

Edit: just as a hint, you can locally rebase things via rebase -i HEAD~10 .... and later user push -f to rewrite this PR.

All commits have been merged, please check (some custom modifications that do not affect security are referenced from the original 7z's customizations, intended to increase the difficulty of standard analysis; for example, the original 7z uses custom SHA-256 derivation instead of PBKDF2-SHA256)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants