Here is something similar: https://godbolt.org/z/Yj61b6GGj I useed a non-cryptographic PRNG to write a C program that only compiles if you know the correct key.