-3

When I use to decompile a program (such as using ILSpy for C#), Maximum time I see that the source code is encrypted like names of sources as A.cs,AA.cs,AB.cs etc... And also inside them the methods, variables, constants, even classes are also encrypted as same AA,ABC,IJ..

I have seen this in Java and C# codes. Do the programmers write in this encrypted style or they use encryptor later? How do they do that?

DG_
  • 246
  • 1
  • 3
  • 15
  • 2
    You need an obfuscator: https://stackoverflow.com/questions/2537568/best-java-obfuscator – Roman Puchkovskiy Dec 14 '17 at 09:01
  • 1
    One example is Proguard: https://www.guardsquare.com/en/proguard But it only claims to provide a 'minimal' protection from reverse engineering. – Roman Puchkovskiy Dec 14 '17 at 09:03
  • I guess there is a huge difference between java and C#. Because the java byte code still contains the original names. –  Dec 14 '17 at 09:08

1 Answers1

3

That is not encryption.

When the code is compiled, the original variable names are removed. They are of no interest to the compiler, only the memory locations where these variables reside are.

So when you decompile it, the original variable names are no longer available. The decompiler gives it a human-readable name - usually a combination of letters and digits.

If you want to protect your program from decompiling, then you could use an obfuscation tool - as @ Roman Puchkovskiy suggests in their comment. I should heed that user's warning that such tools offer only minimal protection from reverse engineering. If the end user has access to the executable, they have every opportunity to reverse engineer it, you can only make it harder - you can never make it impossible.