Skip to main content

Technical solution to protect open source projects from commercial abuse

Project description

OSLisLim - Open Source License Limitation

Technical solution to protect open source projects from commercial abuse

OSLisLim is an innovative open source project protection tool that uses technical means to prevent open source projects from being maliciously packaged into commercial software for distribution.

Core Features

  • Mandatory Dependency Mechanism: Project cannot run after removing protection code
  • Intelligent Usage Tracking: Automatically records function calls and usage data
  • Packaging Environment Detection: Blocks PyInstaller and other packaging tools
  • Complete Encryption Protection: Protection bundle as single-line encrypted text
  • Advanced Anti-Reverse Engineering: Multi-layer security mechanisms

Installation

pip install oslislim

Quick Start

Basic Usage

from oslislim import decrypt_and_execute, protect_function

# Must call this (project won't run if removed)
decrypt_and_execute("protection.oslim")

@protect_function
def main():
    print("Protected open source project")
    return "Project execution complete"

if __name__ == "__main__":
    result = main()
    print(result)

Generate Protection Bundle

from oslislim import generate_protection_bundle

# Generate default protection bundle
generate_protection_bundle()

# Or with custom configuration
generate_protection_bundle(
    output_file="my_protection.oslim",
    config={
        "project_name": "My Project",
        "author": "Author Name"
    }
)

How It Works

1. Encrypted Protection Bundle

exec(__import__('oslislim.crypto_client',fromlist=['decrypt_bundle_code']).decrypt_bundle_code('OSL_encrypted_data...'))

2. Mandatory Dependency Mechanism

  • Project must call decrypt_and_execute("protection.oslim")
  • Removing this line makes the project non-functional
  • Creates genuine technical dependency

3. Packaging Environment Detection

  • Automatically detects PyInstaller, cx_Freeze, Nuitka, etc.
  • Immediately refuses to run in packaging environments
  • Effectively prevents commercial packaging and distribution

4. Intelligent Tracking System

  • All functions decorated with @protect_function are automatically tracked
  • Supports local tracking mode
  • Anonymized user information processing for privacy protection

Advanced Configuration

Custom Tracking Function

def custom_tracker(func_name, args, kwargs):
    """Custom tracking logic"""
    import json
    import os
    from datetime import datetime

    usage_data = {
        "timestamp": datetime.now().isoformat(),
        "function": func_name,
        "args_count": len(args),
        "user": os.getenv("USERNAME", "unknown")
    }

    # Save to custom location
    with open("usage_log.json", "a") as f:
        json.dump(usage_data, f)
        f.write("\n")

# Use custom tracker
generate_protection_bundle(tracker_code=custom_tracker)

Project Configuration Options

config = {
    "project_name": "Project Name",
    "author": "Author Information",
    "version": "1.0.0",
    "protection_level": "high",  # standard, high
    "core_functions": ["main", "init", "process"],
    "license_file": "LICENSE"
}

generate_protection_bundle(config=config)

Security Features

Anti-Debugging Protection

  • Debugger environment detection
  • Reverse engineering tool identification
  • Virtual machine environment detection
  • Process analysis tool detection

Multi-Layer Encryption

  1. XOR Encryption: Advanced XOR with multiple layers
  2. Bit Shift Obfuscation: Byte shift processing
  3. Base64 Encoding: Standard encoding
  4. Character Substitution: Custom character mapping

Environment Checks

  • Python version verification
  • Operating system detection
  • Execution environment analysis
  • File system checks

Use Cases

Open Source Project Protection

  • Prevent commercial abuse: Block packaging of open source projects into commercial software
  • Maintain open source spirit: Ensure projects are used in open source environments
  • Technical barriers: Increase technical difficulty for malicious use

Software License Management

  • Usage monitoring: Understand actual software usage patterns
  • Function call statistics: Analyze which functions are frequently used
  • User behavior analysis: Collect anonymous usage data

Intellectual Property Protection

  • Source code protection: Core algorithms stored in encrypted form
  • Reverse engineering protection: Multiple technical measures to prevent reverse engineering
  • Legal evidence: Provide technical means as evidence for rights protection

Important Notes

Legal Use

  • OSLisLim is only for protecting legitimate open source projects
  • Must not be used for malware or illegal purposes
  • Users must comply with relevant laws and regulations

Technical Limitations

  • Cannot prevent all forms of reverse engineering
  • Advanced attackers may still bypass protection mechanisms
  • Recommend combining with legal measures for comprehensive protection

Performance Impact

  • Protection mechanisms introduce slight performance overhead
  • Encryption/decryption processes require additional computation time
  • Recommend using protection on critical functions only

Contributing

We welcome community contributions! Please feel free to submit issues and pull requests.

Development Environment Setup

# Clone repository
git clone https://github.com/oslislim/oslislim.git
cd oslislim

# Install development dependencies
pip install -e ".[dev]"

# Run tests
python -m pytest tests/

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

Contact


OSLisLim - Making open source projects safer and the open source spirit purer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oslislim-0.3.2-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file oslislim-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: oslislim-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for oslislim-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7529aa645faf87aa790fc6a1774560fcc8bfb5c2be4d313e4c56938639e58907
MD5 3e1124aece4565e76c65aa14b485f049
BLAKE2b-256 784549bf095fb724c0f72bdbe888c15fd9c4e415a7ec8bde91482db4e74adb5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page