Content is user-generated and unverified.

MultiCharts.NET License Protection Instructions

Created by: Mark Brown
Website: markbrown.com
Document Version: 1.0
Generated: 2025-05-27


Overview

This document provides complete instructions for implementing license protection in your MultiCharts.NET indicators using hardware fingerprinting.

Your System Information

Based on the system scan performed on 2025-05-27:

Machine Details:

  • User Name: RedQu
  • Machine Name: RAZER
  • Domain: RAZER
  • OS Version: Microsoft Windows NT 10.0.26100.0
  • Processor: Intel64 Family 6 Model 183 Stepping 1, GenuineIntel
  • Processor Count: 32
  • Architecture: AMD64

Generated License Keys for Your Machine

1. Simple Fingerprint (Recommended)

GpACbTztZPghp9/l
  • 16 characters
  • Based on Machine Name + User Name
  • Good balance of security and simplicity

2. Short Fingerprint (User-Friendly)

GpACbTzt
  • 8 characters
  • Easy for manual entry
  • Good for customer license keys

3. Complex Fingerprint (Most Secure)

9pblo1Zina5IX/fGY6emMTSinEu8lVOiHFeydsYE7kM=
  • Full SHA256 hash
  • Combines multiple system identifiers
  • Highest security level

Implementation Steps

Step 1: Add License Validation Class

Add this class to your MultiCharts.NET indicator:

csharp
public class LicenseValidator
{
    // Your authorized machine fingerprints
    private static readonly string[] AuthorizedFingerprints = {
        "GpACbTztZPghp9/l",  // RedQu's RAZER machine
        // Add more authorized machines here as needed
        // "ABCD1234EFGH5678",  // Another authorized machine
    };
    
    public static bool IsAuthorized()
    {
        string currentFingerprint = GenerateSimpleFingerprint();
        return Array.Exists(AuthorizedFingerprints, fp => fp == currentFingerprint);
    }
    
    private static string GenerateSimpleFingerprint()
    {
        try
        {
            string combined = System.Environment.MachineName + System.Environment.UserName;
            using (SHA256 sha256 = SHA256.Create())
            {
                byte[] bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(combined));
                return Convert.ToBase64String(bytes).Substring(0, 16);
            }
        }
        catch
        {
            return "ERROR";
        }
    }
}

Step 2: Protect Your Indicator Constructor

Add license check in your indicator constructor:

csharp
public class YourProtectedIndicator : IndicatorObject
{
    public YourProtectedIndicator(object ctx) : base(ctx)
    {
        // License check at startup
        if (!LicenseValidator.IsAuthorized())
        {
            throw new UnauthorizedAccessException("Invalid license - Contact developer for authorization");
        }
        
        // Your normal initialization code here
    }
}

Step 3: Add Periodic License Checks (Optional)

Add periodic validation in CalcBar method:

csharp
protected override void CalcBar()
{
    // Periodic license recheck (every 1000 bars)
    if (Bars.CurrentBar % 1000 == 0)
    {
        if (!LicenseValidator.IsAuthorized())
        {
            Output.WriteLine("License validation failed - Indicator stopped");
            return; // Stop processing
        }
    }
    
    // Your indicator logic here
}

Complete Protected Indicator Example

csharp
using System;
using System.Security.Cryptography;
using System.Text;
using PowerLanguage.Indicator;

namespace PowerLanguage.Indicator
{
    [SameAsSymbol(true)]
    public class ProtectedIndicator : IndicatorObject
    {
        // License validation class
        private static class LicenseValidator
        {
            private static readonly string[] AuthorizedFingerprints = {
                "GpACbTztZPghp9/l",  // RedQu's RAZER machine
                // Add more authorized machines here
            };
            
            public static bool IsAuthorized()
            {
                string currentFingerprint = GenerateSimpleFingerprint();
                return Array.Exists(AuthorizedFingerprints, fp => fp == currentFingerprint);
            }
            
            private static string GenerateSimpleFingerprint()
            {
                try
                {
                    string combined = System.Environment.MachineName + System.Environment.UserName;
                    using (SHA256 sha256 = SHA256.Create())
                    {
                        byte[] bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(combined));
                        return Convert.ToBase64String(bytes).Substring(0, 16);
                    }
                }
                catch
                {
                    return "ERROR";
                }
            }
        }
        
        // Constructor with license check
        public ProtectedIndicator(object ctx) : base(ctx)
        {
            if (!LicenseValidator.IsAuthorized())
            {
                throw new UnauthorizedAccessException("Invalid license - Contact developer");
            }
            
            // Your initialization code here
        }
        
        protected override void Create()
        {
            // Your plot creation code here
        }
        
        protected override void CalcBar()
        {
            // Optional periodic check
            if (Bars.CurrentBar % 1000 == 0 && !LicenseValidator.IsAuthorized())
            {
                Output.WriteLine("License validation failed");
                return;
            }
            
            // Your indicator logic here
        }
    }
}

Adding New Authorized Machines

To authorize additional machines:

  1. Run SystemInfoTester on the target machine
  2. Get the Simple Fingerprint from the generated file
  3. Add the fingerprint to the AuthorizedFingerprints array
  4. Recompile your indicator

Example:

csharp
private static readonly string[] AuthorizedFingerprints = {
    "GpACbTztZPghp9/l",  // RedQu's RAZER machine  
    "XyZ9AbC123456789",  // Customer A's machine
    "DeF456GhI987654",   // Customer B's machine
};

Security Levels

Basic Protection (Simple Fingerprint)

  • Machine Name + User Name
  • Good for most use cases
  • Easy to manage

Enhanced Protection (Complex Fingerprint)

Replace GenerateSimpleFingerprint() with:

csharp
private static string GenerateComplexFingerprint()
{
    try
    {
        string combined = System.Environment.MachineName + 
                         System.Environment.UserName + 
                         System.Environment.OSVersion.ToString() +
                         System.Environment.ProcessorCount.ToString() +
                         (System.Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER") ?? "");
        
        using (SHA256 sha256 = SHA256.Create())
        {
            byte[] bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(combined));
            return Convert.ToBase64String(bytes);
        }
    }
    catch
    {
        return "ERROR";
    }
}

Troubleshooting

Common Issues:

  1. "Invalid license" error on authorized machine
    • Verify the fingerprint matches exactly
    • Check for typos in the authorized list
    • Ensure case sensitivity is correct
  2. Indicator fails to load
    • Check that SHA256 is available in MultiCharts.NET
    • Add try/catch blocks around crypto operations
  3. License check too frequent
    • Increase the modulo value (e.g., % 5000 instead of % 1000)
    • Or remove periodic checks entirely

Testing Your Protection:

  1. Test on authorized machine - should work normally
  2. Test on unauthorized machine - should show license error
  3. Test with modified fingerprint - should fail validation

Distribution Notes

When distributing your protected indicator:

  1. Compile to .dll format if possible
  2. Don't include source code with fingerprints visible
  3. Consider obfuscation tools for additional protection
  4. Keep master list of authorized fingerprints for support

Customer Support Process

When a customer needs authorization:

  1. Send them SystemInfoTester indicator
  2. Have them run it and send you the fingerprint
  3. Add their fingerprint to your authorized list
  4. Send them the updated protected indicator

Document Created by: Mark Brown
Website: markbrown.com
Generated on: 2025-05-27
Your Machine Fingerprint: GpACbTztZPghp9/l
Document Version: 1.0


This license protection system was developed by Mark Brown (markbrown.com) for securing MultiCharts.NET indicators using hardware fingerprinting technology.

Content is user-generated and unverified.
    MultiCharts.NET License Protection Instructions | Claude