EazyDevirt icon indicating copy to clipboard operation
EazyDevirt copied to clipboard

Homomorphic Encryption

Open puff opened this issue 2 years ago • 1 comments

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.

puff avatar May 26 '23 16:05 puff

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.

puff avatar Sep 19 '25 14:09 puff