Installation & Setup

This guide will help you install ShieldCipher and set up your first protected application.

System Requirements

Before installing ShieldCipher, ensure your system meets these requirements:

Note: For optimal performance, we recommend PHP 8.1+ with OPcache enabled.

Installing MemoryShield Extension

The MemoryShield PHP extension is required to execute protected code. Follow these steps to install it:

Linux Installation

Download the appropriate extension for your PHP version:

# Download MemoryShield extension
wget https://loaders.shieldcipher.com/memoryshield_linux_php81.so

# Copy to PHP extension directory
sudo cp memoryshield_linux_php81.so $(php-config --extension-dir)/memoryshield.so

# Update php.ini
echo "extension=memoryshield.so" | sudo tee -a $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||")

# Verify installation
php -m | grep memoryshield

macOS Installation

# Download MemoryShield extension
curl -O https://loaders.shieldcipher.com/memoryshield_macos_php81.so

# Copy to PHP extension directory
sudo cp memoryshield_macos_php81.so $(php-config --extension-dir)/memoryshield.so

# Update php.ini
echo "extension=memoryshield.so" | sudo tee -a $(php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||")

# Restart PHP-FPM (if applicable)
brew services restart php

Windows Installation

# Download MemoryShield extension
# Visit https://loaders.shieldcipher.com/ and download memoryshield_windows_php81.dll

# Copy to PHP extension directory (usually C:\php\ext\)
copy memoryshield_windows_php81.dll C:\php\ext\memoryshield.dll

# Edit php.ini and add:
extension=memoryshield.dll

# Restart your web server
Verification: After installation, verify the extension is loaded by running php -m | grep memoryshield or check phpinfo() output.

Creating API Keys

API keys allow programmatic access to ShieldCipher services. Create them in your customer portal:

  1. Log in to app.shieldcipher.com
  2. Navigate to SettingsAPI Keys
  3. Click Create New API Key
  4. Give your key a descriptive name (e.g., "Production Server", "CI/CD Pipeline")
  5. Select the appropriate scopes:
    • packages:read - View packages
    • packages:write - Upload and manage packages
    • licenses:read - View licenses
    • licenses:write - Create and manage licenses
  6. Copy the API key and secret immediately (they won't be shown again)
Security: Store API keys securely. Never commit them to version control. Use environment variables or secure key management systems.

Uploading Your First Package

Now that everything is set up, let's protect your first PHP application:

Step 1: Prepare Your Code

Create a ZIP file containing your PHP application files. Ensure:

Step 2: Upload via Portal

  1. Go to Packages in your customer portal
  2. Click Upload New Package
  3. Select your product (or create a new one)
  4. Enter a package name and version
  5. Upload your ZIP file
  6. Click Upload

Step 3: Lock Package

After upload, you need to lock the package with encryption:

  1. Click on your uploaded package
  2. Click Lock Package
  3. Optionally set a passphrase (for additional security)
  4. Click Lock

Step 4: Encode Package

Once locked, encode the package:

  1. Select a protection profile:
    • Basic: Standard protection for most applications
    • Standard: Enhanced protection with additional security layers
    • Advanced: Maximum protection for sensitive applications
  2. Click Encode
  3. Wait for encoding to complete (usually 1-5 minutes)

Step 5: Download Protected Version

Once encoding is complete:

  1. Click Download on your encoded package
  2. Extract the ZIP file
  3. Deploy to your server
  4. Ensure MemoryShield extension is installed
  5. Run your application

Next Steps

Now that you've protected your first package: