Created
September 7, 2021 20:02
-
-
Save blackle/a94e4a50803261c6dee6de3a20928e39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I was thinking of what it would take to have a function like: | |
decrypt_if_input_valid(encrypted_data, input) | |
this function checks if the input satisfies some criteria, and if it does it will decrypt the data. | |
suppose our input is a list of numbers, and our criteria is "each number has to be at most 2 away from the number 378." writing this is fairly straightforward | |
however, if we want to distribute this function, it is trivial for someone to decompile it and see what it's checking for. is it possible to use cryptography to hide our validation criteria so we can run our code on insecure systems? | |
my thought is, we could hash the entire input and use this as the encryption key. but because our validation criteria is "loose", we need to account for every slightly different input that is still valid. if we enumerated over every valid input and computed it's hash value, and allowed for that value to decrypt our data as well, then this could be a solution | |
unfortunately this solution requires iterating over combinatorically many "valid" solutions, and including encrypted keys for each alongside the cyphertext. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here are my thoughts in no particular order: