C
C#16mo ago
FirstGarden

❔ Obfuscation

I know this isn't a topic that's liked in this server, but I am looking for C# / .NET code obfuscation for my application. To put it simply, I know that IL code can be deobfuscated very easily, but I am still going to try and protect my code. My main code isn't in C#, it's in C++, and there is communication between the 2 applications, but I still have user data that is going to be uploaded via an api, and registration / login via api. So yes, I am using an api, and taking other security measures other than obfuscation. But yes, any recommendations are good! As cheap as possible (that's reasonable of course) Thanks!
109 Replies
Angius
Angius16mo ago
$obfuscation
MODiX
MODiX16mo ago
"Then finally, there is that question of code privacy. This is a lost cause. There is no transformation that will keep a determined hacker from understanding your program. This turns out to be true for all programs in all languages, it is just more obviously true with JavaScript because it is delivered in source form. The privacy benefit provided by obfuscation is an illusion. If you don’t want people to see your programs, unplug your server." - Douglas Crockford https://softwareengineering.stackexchange.com/a/155133 * Spend your effort on putting proprietary things in your api, and keeping the distributed code as empty as possible * Use AuthN/AuthZ to control who/what/when/etc... * Free obfuscation is worth the amount your paid for it -- it's already broken and most decompilers out there can make sense of it. * Paid ofbuscation will bankrupt you unless you have a very strong revenue stream and can justify the additional cost with gained sales * The "threat" of someone hijacking your UI and shimming it to make it provide them money is not a real threat. If this is legitimate software, you can ruin their business with lawsuits - Cisien
Software Engineering Stack Exchange
Is it important to obfuscate C++ application code?
In the Java world, sometimes it seems to be a problem, but what about C++? Are there different solutions? I was thinking about the fact that someone can replace the C++ library of a specific OS wit...
Joreyk ( IXLLEGACYIXL )
license it properly Unity is a plain C++ compiled engine and is only protected by its license which companies pay in the hundred thousands money to be able to view the sauce
FirstGarden
FirstGardenOP16mo ago
Thanks I have authentication hosted, with secure and encrypted responses using PGP (Pretty good privacy), I am using basic sockets to send the input user data to the C++ app, and it awaits for a response
Joreyk ( IXLLEGACYIXL )
this has nothing to do with it
FirstGarden
FirstGardenOP16mo ago
license as in what sorry?
Jimmacle
Jimmacle16mo ago
license as in legal protection from people decompiling/modifying/reusing your code obfuscation in general won't stop anyone who actually wants your code, especially cheap obfuscation
FirstGarden
FirstGardenOP16mo ago
Oh right, well i'm not looking to go commercial yet, due to it just being a private project - but was thinking for the future, so I shall take this in mind True, but there are some good solutions, like DNGuard - In which converts the IL code into Psuedo code with their HVM Technology I'm thinking as in a little layer to ensure security
Jimmacle
Jimmacle16mo ago
obfuscation isn't security, don't confuse it
FirstGarden
FirstGardenOP16mo ago
My mistake, just a layer then
Jimmacle
Jimmacle16mo ago
it's just a roadblock to someone reading your code, it doesn't inherently make it more secure
Joreyk ( IXLLEGACYIXL )
for example one fork of stride engine is licensed under "this code is MIT licensed but if you earn money with it you need to pay 4% of your revenue else you are prohibited to use this engine" there are many companies out there who just wait for someone to break the license and lawsuit the one who broke it microsoft has a massive amount of closed source licenses which you can use if anyone breaks it, lawsuits will come in almost immediate atleast when oracle is involved ...
FirstGarden
FirstGardenOP16mo ago
So are they paid, or? Sorry for stupid questions, I am quite new to all this legal stuff
Joreyk ( IXLLEGACYIXL )
many different tempaltes for license models
Jimmacle
Jimmacle16mo ago
a license can be whatever you want
Joreyk ( IXLLEGACYIXL )
like wireshark which 80% of linux users have per default this is a legal license tho ( wording must be more accurate i think )... you describe what is allowed and what is forbidden
FirstGarden
FirstGardenOP16mo ago
everything is completely encrypted and sent upon runtime, and it's decrypted at the server using the private key, so that's not an issue Oh okay, I shall take a look. Thank you! Also, not sure if this matters, but just to say, my application is Cloud File Storage, I'm working on the application, because it's more efficient for the user in my opinion How much will it roughly be? Oh okay, no problem Thanks though! Much help from all of you
Joreyk ( IXLLEGACYIXL )
put your copyright into the license out of EU you will have to say it especially
FirstGarden
FirstGardenOP16mo ago
I don't have a copyright either, this is completely a new project
Joreyk ( IXLLEGACYIXL )
in EU you have the copyright the moment you do it, in america you can sell a copyright
FirstGarden
FirstGardenOP16mo ago
Yeah, i'm from England
Joreyk ( IXLLEGACYIXL )
ofc you have the moment you pressed the button on the keyboard its under your copyright if it meets the terms for being "big enough" a hello world cant be copyrighted or a standard if statement if you wrote an entire program then you have the copyright the moment you created it and you cant lose or sell it no matter what
FirstGarden
FirstGardenOP16mo ago
Oh okay, so I can copyright anything made by myself? That's cool! So i'd just need a legal license to ensure people do not use it?
Joreyk ( IXLLEGACYIXL )
in USA you can sell it, like sun sold copyright to oracle for java Copyright (C) Bobby McBOb - All Rights Reserved means you have the copyright , and you dont grant anyone else any rights which also means you cant sell it with this license as the user is not allowed to do anythign with it 👀
FirstGarden
FirstGardenOP16mo ago
I cannot sell the product under the copyright?
Jimmacle
Jimmacle16mo ago
i mean, they can do whatever they want until you pursue them legally if you're going to sell the product your license should include language that allows the intended use of the software but none of us are lawyers and you'd really want to get one involved if you want to do it right
FirstGarden
FirstGardenOP16mo ago
Yeah, the product itself is free, like for example 100GB Storage for free, and the user pays for more
Joreyk ( IXLLEGACYIXL )
a copyright is a ful license..but you dont grant anyone the right to use it or other stuff.. which means your license would include the rights what to do , and when ( for example after paying )
Jimmacle
Jimmacle16mo ago
this is why lots of applications have terms of service that are 3 miles long
Joreyk ( IXLLEGACYIXL )
and are pretty accurate and horrible to read so you get an accountant or whatever to make it for you or license manager anyone in IT will tell you to pick either 1. a license template that is well known 2. get a license from a proffessional but the "well known" licenses like gpl , MIT , freebsd are mostly for the use of "i dont care"
Jimmacle
Jimmacle16mo ago
especially if this is an online service you'll want to specifically list out what is approved and unapproved usage of your service so you're protected from people abusing it
Joreyk ( IXLLEGACYIXL )
so get an proffessional
Jimmacle
Jimmacle16mo ago
especially since it's cloud storage, what happens if someone uploads something illegal?
Joreyk ( IXLLEGACYIXL )
as service host you are the baddy if someone fails
FirstGarden
FirstGardenOP16mo ago
we have md5 hash checks, aswell as people cannot directly upload executables, .scr files, .dll files, .com files without confirmation - but honestly, i do not mind, but it might be against something. But overall, my goal is for people to upload anything to backup, like asuswebstorage.com
Jimmacle
Jimmacle16mo ago
i'm talking about illegal content
Joreyk ( IXLLEGACYIXL )
child porn videos
FirstGarden
FirstGardenOP16mo ago
illegal such as gore, child pornography?
Joreyk ( IXLLEGACYIXL )
as example
FirstGarden
FirstGardenOP16mo ago
yeah I didn't think about that I was thinking about malware / cheats
Jimmacle
Jimmacle16mo ago
yeah you really don't want to be on the legal hook for that
FirstGarden
FirstGardenOP16mo ago
yeah not wrong
Joreyk ( IXLLEGACYIXL )
so you put that into the license that its not allowed
FirstGarden
FirstGardenOP16mo ago
okay, no problem, can I specify that malware is aloud?
Joreyk ( IXLLEGACYIXL )
for example oracle enterprise manager, if you press the wrong button they sue you the day you pressed it well... they revooke your license as its illegal in the EU to have such a license... but out side EU its an immediate lawsuit
Jimmacle
Jimmacle16mo ago
generally you'll want to ask an actual lawyer all these things
FirstGarden
FirstGardenOP16mo ago
Oh okay
Jimmacle
Jimmacle16mo ago
i don't know all the legal details, i just know i wouldn't want to be implicated in distributing illegal content that someone else uploaded
Joreyk ( IXLLEGACYIXL )
not illegal either.. they would lose in every court as its not fulfilling EU laws... its complicated
FirstGarden
FirstGardenOP16mo ago
This law stuff is so confusing
Joreyk ( IXLLEGACYIXL )
thats why there are high paid dudes who know that shit ive always used MIT license as its the only one that i fully understand
FirstGarden
FirstGardenOP16mo ago
Sorry to ask, but what's that? I do see it alot with things on github
Jimmacle
Jimmacle16mo ago
it's an open source license that basically grants anyone the right to do whatever they want with the software/source code
Joreyk ( IXLLEGACYIXL )
do whatever you want with it but let me in peace and mention me as copyright holder with that license "let me in peace" .. it states that you cant sue me when you get problems with it or make me responsible
Tarcisio
Tarcisio16mo ago
Encrypting packets + HTTPs? @turkishtobacco Licenses won't protect your application, no one cares about them. It will just prevent companies from using your application and not paying what you deserve, that is, if they get audited. It's sad but you can't make a safe client-side app using .NET, not in a way that it makes it uncrackable or impossible to get your source code.
Joreyk ( IXLLEGACYIXL )
you cant make it with other languages either
Tarcisio
Tarcisio16mo ago
I'd like to see you try to get the full source code of a golang app
FirstGarden
FirstGardenOP16mo ago
what about NativeAOT?
Tarcisio
Tarcisio16mo ago
That's for the future to decide You can give Eazfuscator a try. I've heard that their VM has not yet been introspected But that's for the paid license only
FirstGarden
FirstGardenOP16mo ago
I'm using that currently actually haha
Joreyk ( IXLLEGACYIXL )
no difference, can be decompiled
FirstGarden
FirstGardenOP16mo ago
That aswell as VMProtect But I will give the license a go
Joreyk ( IXLLEGACYIXL )
you need anyway a license else you cant sell it
Tarcisio
Tarcisio16mo ago
VMProtect will be useless for C# But as people said in here You won't be 100% safe, if a really good reverse engineer attempts to crack your app, he probably will succeed But Eazfuscator is good enough to keep 90% of the script kiddies away
Joreyk ( IXLLEGACYIXL )
and sue him and then get more money from the lawsuit than you could ever from your app
FirstGarden
FirstGardenOP16mo ago
Not entirely in my experience Exactly this EAZFuscator licensing is $400 a personal license I believe
Joreyk ( IXLLEGACYIXL )
also microsoft has an obfuscator and afaik for free
Tarcisio
Tarcisio16mo ago
Yes it is really expensive
Tarcisio
Tarcisio16mo ago
I meant that EAZFuscator is expensive I wish mooseous was here he would probably know more about this
Joreyk ( IXLLEGACYIXL )
Dotfuscator Community+
FirstGarden
FirstGardenOP16mo ago
Ohh, yeah their obfuscator is terrible 😂 imo
Tarcisio
Tarcisio16mo ago
join the reverse engineering discord
Joreyk ( IXLLEGACYIXL )
for being free its good enough
FirstGarden
FirstGardenOP16mo ago
Take a look at DNGuard if you think EAZ is expensive Which one? Not wrong I quite like KoiVM as a free obfuscator / virtualizer
Tarcisio
Tarcisio16mo ago
There are plenty of devirtualizers for KoiVM
Joreyk ( IXLLEGACYIXL )
there is also a decompiler for unitys IL2CPP
Tarcisio
Tarcisio16mo ago
The only public good obfuscator/virtualizer right now is for Mono sadly
FirstGarden
FirstGardenOP16mo ago
Like oldrod, etc - but even so, KoiVM is a good base, VMProtect for .NET uses KoiVM / Simular techniques, aswell as StrongVM which is 80% KoiVM
Tarcisio
Tarcisio16mo ago
iirc KoiVM doesn't really work properly for .net 5+ no?
FirstGarden
FirstGardenOP16mo ago
Yeah, exactly, like il2cpp dumper Possibly, I use .net 4.7
Joreyk ( IXLLEGACYIXL )
and IL2CPP was known as "almost impossible" to reverse engineer didnt take a year...
Tarcisio
Tarcisio16mo ago
If there is investment there will be reversing
FirstGarden
FirstGardenOP16mo ago
BeeByte seems okay, it's very very simple, basic renaming of types, methods, and it has string encryption + junk code - but alot of people can never unpack it fully ^ For unity
Tarcisio
Tarcisio16mo ago
Just look at Node.js for example Your application will be safer with V8 bytecode than it is with IL
Joreyk ( IXLLEGACYIXL )
obfuscation through obscurity is a different thing...
Tarcisio
Tarcisio16mo ago
Because there is no investment in making a tool to reverse v8 bytecode is discord terrible today or is it my connection
Joreyk ( IXLLEGACYIXL )
oh you mean after obfuscation... i thought you meant the pure code kekw
FirstGarden
FirstGardenOP16mo ago
It's bad today, my messages aren't sending 50% of the time
Joreyk ( IXLLEGACYIXL )
terrible today, messages get red
FirstGarden
FirstGardenOP16mo ago
You know what, there isn't much point in doing all of this obfuscation for a file uploader, just the license, because 90% of the code is in C++ and I could also just make libraries for most of the imporant stuff
Kouhai
Kouhai16mo ago
Sorry for the dumb question, but why do you need to obfuscate a file uploader? Even if someone tries to reverse engineer the client app, it shouldn't give then any advantage
FirstGarden
FirstGardenOP16mo ago
Yes, but they can still access the api directly - and see which type of encryption is used even, anything like that And in general, I think it's quite unprofessional if an application is vulnerable
Kouhai
Kouhai16mo ago
It's not a vulnerability to allow the users to see the api calls I mean...discord the service we are using is exactly like that
FirstGarden
FirstGardenOP16mo ago
Yes, but even so, there are (d)dos attacks that could be started, or anything like that
Angius
Angius16mo ago
Let me introduce you to Telerik Fiddler that shows you every single call every single app makes on your PC: https://www.telerik.com/fiddler
Kouhai
Kouhai16mo ago
Or wireshark, or procmon 😅
FirstGarden
FirstGardenOP16mo ago
Yeah I know, but they are encrypted, and decrypted using the PGP Private key on the web server
Kouhai
Kouhai16mo ago
I still don't understand the benefit of obfuscating the client tbh 😅
FirstGarden
FirstGardenOP16mo ago
no, i'm using a basic xor cipher aswell I guess but that still needs a decryption key also base64
Kouhai
Kouhai16mo ago
What's being encrypted the payload?
Angius
Angius16mo ago
A base64 string is no different than a regular string
Kouhai
Kouhai16mo ago
^ base64 is not encyption, it's just an encoding scheme
FirstGarden
FirstGardenOP16mo ago
I know, but it's something yes
Angius
Angius16mo ago
No it really isn't It's like turning a decimal number into a hexadecimal one
Kouhai
Kouhai16mo ago
Well I personally don't see any reason to obfuscate the code, but it's your project and you understand what it needs more ThumbsUpSmile
FirstGarden
FirstGardenOP16mo ago
👍 Thank you for understanding
Tarcisio
Tarcisio16mo ago
certificate pinning go brrr
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server