Questions tagged [obfuscation]

Obfuscation is the process by which the code is altered so that a developer finds it much harder to understand clearly what the intended program does or how it operates. The larger the program the greater the obfuscation, as code becomes intertwined linking different segments through out the program.

While it may be possible to use a disassembler to figure out how certain aspects within a program function, it requires knowledge of assembly. Assembly language by its nature is non-trivial.

Another way to increase obfuscation is to use packers.

2987 questions
997
votes
4 answers

Obfuscated C Code Contest 2006. Please explain sykes2.c

How does this C program work? main(_){_^448&&main(-~_);putchar(--_%64?32|-~7[__TIME__-_/8%8][">'txiZ^(~z?"-48]>>";;;====~$::199"[_*2&8|_/64]/(_&2?1:8)%8&1:10);} It compiles as it is (tested on gcc 4.6.3). It prints the time when compiled. On my…
corny
  • 7,824
  • 3
  • 14
  • 20
780
votes
28 answers

How do I protect Python code from being read by users?

I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file. If we distribute the .py files or even .pyc files it will be…
Jordfräs
  • 8,903
  • 3
  • 27
  • 30
747
votes
22 answers

How can I obfuscate (protect) JavaScript?

I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible?
Teifion
  • 108,121
  • 75
  • 161
  • 195
522
votes
38 answers

Protect .NET code from reverse engineering?

Obfuscation is one way, but it can't protect from breaking the piracy protection security of the application. How do I make sure that the application is not tampered with, and how do I make sure that the registration mechanism can't be reverse…
Priyank Bolia
  • 14,077
  • 14
  • 61
  • 82
442
votes
17 answers

Simple insecure two-way data "obfuscation"?

I'm looking for very simple obfuscation (like encrypt and decrypt but not necessarily secure) functionality for some data. It's not mission critical. I need something to keep honest people honest, but something a little stronger than ROT13 or…
Matt Dawdy
  • 19,247
  • 18
  • 66
  • 91
306
votes
6 answers

Strange definitions of TRUE and FALSE macros

I have seen the following macro definitions in a coding book. #define TRUE '/'/'/' #define FALSE '-'-'-' There was no explanation there. Please explain to me how these will work as TRUE and FALSE.
Keshava GN
  • 4,195
  • 2
  • 36
  • 47
296
votes
3 answers

What is the >>>= operator in C?

Given by a colleague as a puzzle, I cannot figure out how this C program actually compiles and runs. What is this >>>= operator and the strange 1P1 literal? I have tested in Clang and GCC. There are no warnings and the output is "???" #include…
CustomCalc
  • 2,182
  • 3
  • 12
  • 9
227
votes
10 answers

Is there a code obfuscator for PHP?

Has anybody used a good obfuscator for PHP? I've tried some but they don't work for very big projects. They can't handle variables that are included in one file and used in another, for instance. Or do you have any other tricks for stopping the…
user29593
  • 2,425
  • 2
  • 16
  • 6
225
votes
25 answers

Protecting executable from reverse engineering?

I've been contemplating how to protect my C/C++ code from disassembly and reverse engineering. Normally I would never condone this behavior myself in my code; however the current protocol I've been working on must not ever be inspected or…
graphitemaster
  • 3,483
  • 4
  • 19
  • 14
213
votes
4 answers

Why does the MongoDB Java driver use a random number generator in a conditional?

I saw the following code in this commit for MongoDB's Java Connection driver, and it appears at first to be a joke of some sort. What does the following code do? if (!((_ok) ? true : (Math.random() > 0.1))) { return res; } (EDIT: the code has…
Monstieur
  • 7,992
  • 10
  • 51
  • 77
177
votes
2 answers

How does this code generate the map of India?

This code prints the map of India. How does it work? #include main() { int a,b,c; int count = 1; for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq ULo+\ UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\ …
narayanpatra
  • 5,627
  • 13
  • 51
  • 60
165
votes
30 answers

.NET obfuscation tools/strategy

My product has several components: ASP.NET, Windows Forms App and Windows Service. 95% or so of the code is written in VB.NET. For Intellectual Property reasons, I need to obfuscate the code, and until now I have been using a version of dotfuscator…
csmba
  • 4,053
  • 3
  • 32
  • 42
157
votes
29 answers

Best way to obfuscate an e-mail address on a website?

I've spent the past few days working on updating my personal website. The URL of my personal website is (my first name).(my last name).com, as my last name is rather unusual, and I was lucky enough to pick up the domain name. My e-mail address is…
Adam Rezich
  • 3,122
  • 6
  • 31
  • 39
155
votes
8 answers

Convert a PHP script into a stand-alone windows executable

I want to automate a fairly simple task. For this I have written a small PHP script which I run from the command line using PHP-CLI. Now I want to hand over this script to someone but I do not want to: give away the source code ask him to install…
Salman A
  • 262,204
  • 82
  • 430
  • 521
149
votes
7 answers

What are JavaScript's builtin strings?

this question is difficult to summarize in a question title UPDATE I created a JSFiddle that builds an obfuscated string out of your input based on the letters extracted from this question: You can access it here, or would a gist be easier? I…
Jason Sperske
  • 29,816
  • 8
  • 73
  • 124
1
2 3
99 100