Message Boards Message Boards

GROUPS:

Does a (cryptographic?) function satisfying these 3 constraints exist?

Posted 6 months ago
973 Views
|
2 Replies
|
0 Total Likes
|
  1. f(program,state)=hash. hash is unique for every pair of (program,state). f, program and state are public. Maybe state can be made private.

  2. f^−1(hash) does not exist, and there is no function g, g(hash)=(program,state). Meaning, there is no other way to obtain the hash but by using f.

  3. verify(program,state,hash)=true, if f(program,state)=hash. False otherwise.

2 Replies
Posted 6 months ago

Wouldn't any cryptographic hash work?

f[program_, state_] := Hash[program <> state, "SHA512", "HexString"];
verify[program_, state_, hash_] := f[program, state] == hash;

hash = f["Hello", "World"]
verify["Hello", "World", hash]
(* True *)

Rohit is right. Another option, you can use HMAC

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract