EazyDevirt
EazyDevirt copied to clipboard
Homomorphic Encryption
Currently, this project does not support decrypting branches encrypted with homomorphic encryption.
Here's a basic representation of how HM works in eaz:
// pretend this is virtualized code
var input = int.Parse(Console.ReadLine());
if (EncryptAsymmetric(input) == encryptedConstant)
{
// Homomorphic Encryption Start VM OpCode
var oldReader = VM.VMInstructionsReader;
VM.VMInstructionsReader = new VMInstructionsReader(decryptionKey: input);
// next instructions will be decrypted with the new key
Console.WriteLine("homomorphic encryption woah");
// Homomorphic Encryption End VM OpCode
VM.VMInstructionsReader = oldReader;
}
// next instructions will be decrypted with the original decryption key
Console.WriteLine("this uses the original instructions reader");
Untested but looks like it can be nested too.
Some information to make a bruteforcer more efficient:
Since the length is the first thing decrypted, we could easily get a set of possible solutions by checking the decrypted length against the method's code size.
If the length is within the method's length (maybe subtract already decrypted instructions from this length too), the key used is a possible solution which could then be used to decrypt instructions to find the true solution/key.