Reputation: 36273
I understand that including a secret/password into WASM is a bad idea since a binary can be decrypted but is there a concept/trick of safely generating salts for creating a secret within the WASM that can't be read by the host and thus exist only for the time of a single WASM execution?
Upvotes: 1
Views: 390
Reputation: 1342
No. This is just the impossible DRM problem again.
Let's walk this through:
You can of course, as with all DRM systems, try to concoct any complicated scheme to make these recordings hard for a human to figure out, but ultimately you are trying to both give someone information (that secret or salt) while simultaneously denying them that same information. You can raise the cost in terms of time or difficulty a person to break your DRM.
Now, just to be complete, there is a not-yet-practical approach based on fully homomorphic encryption where you can produce a program that someone else can run where they can't understand what the program has done (it's "computationally indistinguishable"), but current implementations require near-gigabyte sized keys and turn milliseconds of computing into minutes or hours, and secondly this has nothing to do with Wasm, if you could do it with Wasm you could do the same with python code or an x86-64 executable. The current best approach that I know of is https://tfhe.github.io/tfhe/ .
Upvotes: 4