Message Boards Message Boards

0
|
5711 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

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

Posted 3 years ago
  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.

POSTED BY: Mihai Raulea
2 Replies

Rohit is right. Another option, you can use HMAC

POSTED BY: Dariia Porechna
Posted 3 years 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 *)
POSTED BY: Rohit Namjoshi
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