Verifying that something has been "done" using hashes / encryption

So, to begin, I want to point out that I know that these things are never perfect, and if enough effort is made, everything can be broken.

But: Let's say I transfer a piece of software to someone (what I wrote) and force them to run it. I want to check the result that they get. I was thinking about using some kind of encryption / hash that I can use to verify that they started it and got a satisfactory result.

I also do not want the result to be “fake” (although, again, I know that if there is enough effort to break it, it’s applied, etc. etc.). This means, therefore, if I use a hash, I can’t just have a hash for “yes” and a hash for “no” (since this means that the hash will be only one of two options - it's easy to fake).

I want the user of the tool to send me something (possibly via email, for example), something as small as possible (for example, I don’t want to etch log lines and lines).

How would you do that? I may not have explained what is best, but I hope you get the gist of what I want to do.

If someone has already implemented this thing before, any pointers would be much appreciated.

This question is more about "how to implement," rather than just asking about the code, so if I missed an important tag, feel free to edit!

+3
source share
6 answers

I think you are looking for non-repudiation . You are right, the hash is not enough here - you will have to think about some kind of encryption and digital signature on the "done work", perhaps PKI . This is a fairly wide field, I would say that you need authentication and integrity (for example, Piskvor did this, and he did it this way at the time).

To look at the bird's eye, the main stream will be something like this:

On the user's computer:

  • start the process
  • , ..
  • ,
  • ( - - , -, ...)

:

, , ; , , , .

+3

, :

. , . , . , , . , , , - .

, , , - , : ", , !". , , ( , ), , , , , .

- , , . , :

  • /
  • Hostname
  • HASH ( / | | | )

, - , , , , , . / ( , ), .

+3

( "" ""?) , ?

, :

YES-3456234
b23603f87c54800bef63746c34aa9195

, , .

, md5("YES-3456234") == "b23603f87c54800bef63746c34aa9195".

, , - md5, .

( , "" ) , .

:

YES-3456234
01428dd9267d485e8f5440ab5d6b75bd

,

md5("YES-3456234" + "secretsalt") == "01428dd9267d485e8f5440ab5d6b75bd"

, , - md5, , .

, , .

- , , Piskvor answer, :)

+2

, - , . , . , , .

, . , , , hash(result + private_salt) == signature. , .

, . , : ?

+1

-, , . , .

, .

+1

, .

" " , , , , , - . , - , , .

- , ​​ , , , () , .

, , , "", "" - , ?

+1

Source: https://habr.com/ru/post/1752620/


All Articles