Simplest way to obfuscate and deobfuscate a string in JavaScript

You can use btoa() and atob(). btoa() is like base64_encode() and atob() like base64_decode(). Here is an example: btoa(‘Some text’); // U29tZSB0ZXh0 atob(‘U29tZSB0ZXh0’); // Some text Keep in mind that this is not a secure way to keep secrets. Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format by … Read more

How does this magic JavaScript code work?

Before looking closer at the code, you have to know that since JavaScript 1.5 identifiers are allowed to contain not just ASCII characters but also Unicode characters. In this case many of these funny sequences are just identifiers. After exchanging these identifiers by simpler identifiers and removing unnecessary comments and parenthesis, the code looks as … Read more

Secure distribution of NodeJS applications

Yes you can create a binary format. V8 allows you to pre-compile JavaScript. Note that this might have a bunch of weird side-effects on assumptions made by node core. Distributing source code means clients can easily steal our solution and stop paying licensing fees. Just because you distribute the binary doesn’t protect you againsts theft. … Read more

How to debug with obfuscated (with ProGuard) applications on Android?

Add the following lines to your proguard configuration. -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable Now your stack traces will include line numbers, and by using the retrace tool that ships with proguard (included in the Android SDK), you are able to debug like normal. Note that even if you didn’t use these two configuration options, retrace still … Read more

What does the ->

There is no -> <- operator. That first -> is just lambda syntax, as introduced in Java 8, and that second <- is a misleading concatenation of ‘smaller than’ < and ‘unary minus’ -. You can read it as IntPredicate neg = (x) -> (x < (-x));, i.e. it tests whether x is smaller than … Read more

iPhone/iPad App Code Obfuscation – Is it Possible? Worth it? [closed]

There doesn’t seem to a code obfuscator for Objective-C. But let’s assume for a moment that one does exist. Apple will probably not reject an obfuscated app as long as it doesn’t crash. The main question is: what is the point of obfuscation ? Normally, you want to obfuscate code to protect your knowledge, for … Read more

Best solution to protect PHP code without encryption

Obfuscating things can only inconvenience your legitimate, law-abiding customers, while the people who would would rip you off are not your target paying customers anyway. (edited out other thoughts about obfuscation) Another suggestion for protecting your software: create a business model in which the code is an incomplete part of the value of your offering. … Read more

How to hide a string in binary code?

I’m sorry for long answer. Your answers are absolutely correct, but the question was how to hide string and do it nicely. I did it in such way: #include “HideString.h” DEFINE_HIDDEN_STRING(EncryptionKey, 0x7f, (‘M’)(‘y’)(‘ ‘)(‘s’)(‘t’)(‘r’)(‘o’)(‘n’)(‘g’)(‘ ‘)(‘e’)(‘n’)(‘c’)(‘r’)(‘y’)(‘p’)(‘t’)(‘i’)(‘o’)(‘n’)(‘ ‘)(‘k’)(‘e’)(‘y’)) DEFINE_HIDDEN_STRING(EncryptionKey2, 0x27, (‘T’)(‘e’)(‘s’)(‘t’)) int main() { std::cout << GetEncryptionKey() << std::endl; std::cout << GetEncryptionKey2() << std::endl; return 0; } … Read more

This obfuscated C code claims to run without a main(), but what does it really do?

C language define execution environment in two categories: freestanding and hosted. In both execution environment a function is called by the environment for program startup. In a freestanding environment program startup function can be implementation defined while in hosted environment it should be main. No program in C can run without program startup function on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)