Is code obfuscation allowed in FOSS source code as per any of the popularly used FOSS licenses? If it is allowed, to what degree and extent?
No open source license that I know of disallows obfuscation, minification, or similar modifications. In a way, that's just a kind of translation like compilation, and it wouldn't make sense for an open source license to disallow compilation.
However, some licenses require the source code to be made available under certain circumstances. But what is the source code? The GPL defines the source code as:
the preferred form of the work for making modifications to it.
This is a very flexible definition. For example, if only obfuscated source code is available then that code might indeed be the preferred form of modifications. But the GPL's source code requirements cannot be satisfied with an obfuscated version if you have a non-obfuscated version available. Providing obfuscated code in place of the actual source code would be a license violation.
- Is code obfuscation allowed in FLOSS source code? Only if real source code is also available under the licence.
- Are there any FLOSS licences that allow obfuscation without restriction? Yes: all permissive licences, but then the software is no longer FLOSS.
No: it is impossible, there are no FLOSS licences that allow this. Any licence that does is not FLOSS. However it is allowed (e.g. as the compiled form of the program), so long as real source code is available, according to the rules of the licence.
See Free Software Definition, here is an extract.
- The freedom to run the program as you wish, for any purpose (freedom 0).
- The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
- The freedom to redistribute copies so you can help others (freedom 2).
- The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
The freedom to study the source code and make changes
In order for freedoms 1 and 3 (the freedom to make changes and the freedom to publish the changed versions) to be meaningful, you must have access to the source code of the program. Therefore, accessibility of source code is a necessary condition for free software. Obfuscated “source code” is not real source code and does not count as source code.
Extract from Open Source Definition:
2. Source Code
The program must include source code, and must allow distribution in source code as well as compiled form. Where some form of a product is not distributed with source code, there must be a well-publicized means of obtaining the source code for no more than a reasonable reproduction cost, preferably downloading via the Internet without charge. The source code must be the preferred form in which a programmer would modify the program. Deliberately obfuscated source code is not allowed. Intermediate forms such as the output of a preprocessor or translator are not allowed.
A note on permissive licences
Permissive Free-Software / Open-Source licences, allow one to make the software become proprietary.
While the licenses are Free-Software / Open-Source licences, and the software is Free-Software / Open-Source. You may choose to make it proprietary, then you may distribute without access to the source code. This includes obfuscation.
e.g. The MacOS X core is not Free-Software / Open-Source even though it was based on BSD.