<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">This reminds me Bruce Schneier's quote:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">"Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break."</div></blockquote><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">You can encrypt a class, but a) your private key will be somewhere obfuscated in your code and b) once decrypted, you can dump it from memory.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Maybe in the future, the Panama project will facilitate running certain tasks within, for instance, an SGX enclave or other TEE environments.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--</div><font style="color:rgb(153,153,153)" size="2"><a style="font-family:garamond,serif" href="http://twitter.com/apr" target="_blank">@apr</a></font><br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 28, 2023 at 10:32 AM Raffaello Giulietti <<a href="mailto:raffaello.giulietti@oracle.com">raffaello.giulietti@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
IIUC, the decryption key is distributed in some form with the desktop <br>
application.<br>
What is unclear to me is how the key is protected in turn.<br>
<br>
<br>
Greetings<br>
Raffaello<br>
<br>
<br>
<br>
On 2023-04-28 07:12, Henrik Buestad wrote:<br>
> Hi<br>
> <br>
> I don't know if this is the right place to post this, so have me excused.<br>
> <br>
> This might be naive, or a good idea?<br>
> <br>
> I have an issue with .class files in a desktop application. They can be <br>
> reverse enginered. Using GraalVM is unfortunately not an option since we <br>
> need to be able to load custom classes runtime.<br>
> <br>
> I thought of an idea to be able to encrypt .class files using RSA and <br>
> then have a custom JDK VM with a natively compiled decrypter with a <br>
> private key. (The private key could be a configure option). I then just <br>
> need to tap into the code where the .class file is read from disk and <br>
> check if it starts with CAFEBABE. If not run it through the decrypter.<br>
> <br>
> Can somebody point me to which source file(s) I should start to mess <br>
> around in? I mean where is the classloader reading the .class file from <br>
> disk?<br>
> <br>
> As I said, this might be naive😅<br>
> <br>
> Best regards,<br>
> Henrik Buestad<br>
> <br>
</blockquote></div>