Skip to main content

Deterministic Data Masking Engine with Mathematical Validation - No AI Guessing

Project description

OPAQUE 🛡️

The Deterministic Data Masking Engine for High-Stakes Engineering.

"Don't guess if it's a CPF. Prove it mathematically."

Tests Python License

English | Português | Español

OPAQUE is a high-performance, context-aware sanitization library designed for enterprise environments where data integrity and performance are non-negotiable. Unlike AI-based solutions that guess, OPAQUE validates mathematically.

🚀 Key Features

  • Rust-Powered Core: Process gigabytes of logs without slowing down your application
  • Deterministic Validation: Mathematical validation (Mod 11, Luhn) - no false positives
  • Secure Fingerprinting: SHA256 hashes instead of *** for debuggability
  • Vault Mode: Reversible AES-256 encryption for authorized debugging
  • Honeytokens: Detect intrusion attempts with bait data
  • Circuit Breaker: Prevents log flooding from crashing your server
  • Crash Handler: Sanitizes tracebacks and local variables
  • Compliance Auditing: Static analysis and HTML reports

📦 Quick Install

pip install opaque-logger

⚡ Quick Start

import logging
from opaque import OpaqueLogger, Validators

# Configure
OpaqueLogger.setup_defaults(
    rules=[Validators.BR.CPF, Validators.BR.CNPJ],
    obfuscation_method="HASH"
)

# Integrate
logging.setLoggerClass(OpaqueLogger)
logger = logging.getLogger("app")

# Log securely
logger.info("User CPF: 529.982.247-25")
# Output: User CPF: [HASH-3A4C]

📚 Documentation

🧪 Examples

Run the included examples to see OPAQUE in action:

# Set Python path
export PYTHONPATH="$(pwd)"  # Linux/Mac
$env:PYTHONPATH = "$(pwd)"  # Windows PowerShell

# Run examples
python examples/example_01_basic.py          # Basic usage
python examples/example_02_vault.py          # Vault mode
python examples/example_03_honeytokens.py    # Intrusion detection
python examples/example_04_crash_handler.py  # Traceback sanitization
python examples/example_05_audit.py          # Compliance scanning

🧪 Testing

pip install pytest
pytest -v

Test Results: ✅ 24/24 tests passed

🇧🇷 Supported Validators

  • CPF - Brazilian individual taxpayer ID (Mod 11)
  • CNPJ - Brazilian company taxpayer ID (Weighted Mod 11)
  • Pix - Brazilian instant payment keys (Email, Phone, UUID)
  • Credit Cards - International cards (Luhn algorithm)

🛠️ Advanced Features

Vault Mode

OpaqueLogger.setup_defaults(
    obfuscation_method="VAULT",
    vault_key="your-master-key"
)

Honeytokens

OpaqueLogger.setup_defaults(
    honeytokens=["999.888.777-66"]
)

Compliance Scanning

python -m opaque.cli scan ./src --output=report.html

🤝 Contributing

See CONTRIBUTING.md for development setup and guidelines.

📄 License

MIT License - see LICENSE file.

🔗 Links


Built with precision by the OPAQUE Security Team. #\x00 \x00O\x00P\x00A\x00Q\x00U\x00E\x00 \x00 \x00

Project details


Download files

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

Source Distribution

opaque_logger-0.1.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

opaque_logger-0.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file opaque_logger-0.1.0.tar.gz.

File metadata

  • Download URL: opaque_logger-0.1.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for opaque_logger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e34bfa5b02ff5639a07e263693a23ab646c7d4d5e26c1b1b1473e10633e82d1c
MD5 0e41c2375e485514d5af6d9a4e19d464
BLAKE2b-256 d5db5f236221520ee9263afb7fac7280d2ce0f6973ac810b8bc673a37e8eed36

See more details on using hashes here.

File details

Details for the file opaque_logger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opaque_logger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for opaque_logger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9977c4a51b9d679f8b5d17737900f629973d48116b0eb00091fec6f99b4e7c2
MD5 d388c184150c34b7f85bdc877c7485c6
BLAKE2b-256 2b92e99a7b065b55ac146b975bb3759726c227bcb2456a0f6fa728fbf2d8729f

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