-
-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes in docs to facilitate appropriate crypto use #6666
Comments
Thanks for the feedback! Can you please make a PR against master branch for the docs change? About the hw accelerated speed: we use OpenSSL (sometimes also Python stdlib, or OpenSSL via Python stdlib). In the latest code there is E.g. from a Apple M1 cpu:
|
I will prepare something in the next few days and make a PR.
I don't know much about Apple's M1, but the sha256 is definitely accelerated. Thanks for the information! |
See borgbackup#6666 1st draft of adjusted security.rst
I made a draft for the security.rst; it is to solve the confusion that people can experience if they see, e.g., the English SHA2 page (which can be easily misinterpreted in terms of SHA2 being generally vulnerable), and to focus and to help users to choose the best primitive. The init.rst.inc seems to be already changed in the master branch; the comment about the Intel SHA extensions has been removed. A comment about which authentication primitive to choose makes maybe sense there as well? Or a link to security.rst? e.g.,
The init.rst.inc seems to be auto-generated, so the PR does not contain changes in this file. |
I guess in future people will just run Just guessing based on CPU and docs can be wrong, esp. if there are big differences in the software layer (as I noticed for crc32 speed on misc. platforms). |
BTW, if you like to review crypto stuff, could you have a look at the new crypto done in master branch? |
I can spare a little more time at the end of May. Do you have something specific in mind? |
#6463 <- that's the future crypto (and we'll get rid of AES-CTR). |
At first, thanks for maintaining this great tool!
Have you checked borgbackup docs, FAQ, and open Github issues?
Yes.
Is this a BUG / ISSUE report or a QUESTION?
Issue report about content in the docs.
System information. For client/server mode post info for both machines.
Not relevant. Issue is only related to the content of the docs.
Your borg version (borg -V).
Latest Borg docs.
Operating system (distribution) and version.
Not relevant. The issue is general.
Hardware / network configuration, and filesystems used.
Not relevant. Issue is only related to the content of the docs.
How much data is handled by borg?
Not relevant. Issue is only related to the content of the docs.
Full borg commandline that lead to the problem (leave away excludes and passwords)
Not relevant. Issue is only related to the content of the docs.
Describe the problem you're observing.
Issue is not critical / low priority.
I suggest two minor changes in the docs:
Although this is correct, it is highly suggestive: When encryption/authentication is enabled, Borg uses HMAC-SHA256 and not only SHA256. As long as it is used in conjunction with HMAC, there is no risk concerning length extension attacks against SHA256: with HMAC, SHA256 runs twice sequentially with different input each. The length extension resistance created by the first run and the concatenation before the 2nd is comparable to Blake2b's truncation (if truncation will become necessary for Blake2, which I think is not realistic).
Both HMAC-SHA256 and Blake2b are sufficiently secure, and will output a resilient, suitable 256 bit key for AES. Users might be encouraged to use the algorithm that is fastest on their system, which is Blake2b on most 64 bit architectures but possibly HMAC-SHA256 if Intel SHA extensions are available (the number of systems with these extensions is increasing). Maybe the paragraph should be adjusted to focus that? My point is that many systems may experience a strong increase in performance with the SHA extensions, which makes Borg more competitive against other solutions that incorporate no hardware-accelerated algorithms... making the user more happy :) Generally, a noteworthy advantage I see is that I can configure Borg in a way that all MAC/integrity algorithms are hardware-accelerated: we may share this information in the docs? Btw, the hardware support also increases security against several attacks.
Although I also prefer Blake2b in terms of security, an opponent could argue that SHA256 with HMAC has undergone one of the strongest cryptanalyses among hash algorithms. But this is a discussion that maybe belongs to somewhere else :) For here, I would say both are equally secure while any security difference is probabilistic and partly even academic. The user should focus on other things.
Does Borg / hashlib already support the Intel SHA extensions? Unfortunately, I have not yet hardware with which I can test it.
As this is not yet supported by all SHA256 implementations, it would be nice to make clear if the extensions can be already used.
Generally, the Borg docs are great, very detailed and precise. But some information might be a bit more tailored to average users, who might also use Borg (and who might not all be private users).
If you want, I can write an adjustment for your consideration.
Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.
Not relevant. Issue is only related to the content of the docs.
Include any warning/errors/backtraces from the system logs
None.
The text was updated successfully, but these errors were encountered: