android-library icon indicating copy to clipboard operation
android-library copied to clipboard

SHA-256 Hash

Open Alexander-Ger-Reich opened this issue 9 months ago • 6 comments

I wrote an add-on that requires the client to provide the SHA-256 hash of the uploaded files and chunks.

Alexander-Ger-Reich avatar May 10 '25 20:05 Alexander-Ger-Reich

DCO is happy

Alexander-Ger-Reich avatar May 15 '25 19:05 Alexander-Ger-Reich

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

github-actions[bot] avatar May 25 '25 02:05 github-actions[bot]

I am very late to this, sorry for that! I see that this function setHashDownloadCheck is not being used inside library. Thus I assume that this is within the customized files app?

Since we want to have only code that is actually used by the core Nextcloud system, what do you about this:

  • move sha check/generation to your customized app
  • enhance library to allow to pass/read any header --> this way the customized sha logic would be in your app, but the library will support it?

tobiasKaminsky avatar Aug 19 '25 11:08 tobiasKaminsky

I am very late to this, sorry for that! I see that this function setHashDownloadCheck is not being used inside library. Thus I assume that this is within the customized files app?

Since we want to have only code that is actually used by the core Nextcloud system, what do you about this:

  • move sha check/generation to your customized app
  • enhance library to allow to pass/read any header --> this way the customized sha logic would be in your app, but the library will support it?

Do you know if there is already another method to check whether the file on the client is 100% the same as the file on the server during upload? Is this already happening? Is a hash already being generated somewhere else and communicated to the server? I only started doing this because I hadn't seen anything like it before.

Alexander-Ger-Reich avatar Aug 20 '25 11:08 Alexander-Ger-Reich

Do you know if there is already another method to check whether the file on the client is 100% the same as the file on the server during upload? Is this already happening? Is a hash already being generated somewhere else and communicated to the server? I only started doing this because I hadn't seen anything like it before.

No, we do not do this. But we have for each and every upload/chunked upload a status code. So it is assumed that if one transfer/chunk is working, then also the resulting file is correct.

tobiasKaminsky avatar Sep 09 '25 10:09 tobiasKaminsky

Man

Do you know if there is already another method to check whether the file on the client is 100% the same as the file on the server during upload? Is this already happening? Is a hash already being generated somewhere else and communicated to the server? I only started doing this because I hadn't seen anything like it before.

No, we do not do this. But we have for each and every upload/chunked upload a status code. So it is assumed that if one transfer/chunk is working, then also the resulting file is correct.

I could add MD5 as an algorithm. To save power and time, it would only apply to the entire file, not individual chunks. The server would then have to enter this information into the file without changing it (metadata). All official changes to a file would change it, but any tampering would be immediately detected by a different hash.

Alexander-Ger-Reich avatar Sep 20 '25 08:09 Alexander-Ger-Reich