Skip to main content

Advanced cryptographic SDK with steganography and active defense capabilities

Project description

DTP Security SDK

PyPI version Python Support License

Advanced cryptographic SDK featuring steganography and active defense capabilities for next-generation cybersecurity applications.

🚀 Key Features

  • Advanced Encryption: AES-256-GCM with PBKDF2 key derivation
  • Steganographic Protection: Hide data using zero-width Unicode characters
  • Active Defense: Decoy password system for attack detection
  • Multi-layer Security: Combined password and client secret protection
  • Real-time Detection: Instant alerts when decoy credentials are used
  • Enterprise Ready: Professional SDK for easy integration

📦 Installation

pip install dtp-security

🔧 Quick Start

Basic Usage (Original DTP)

import dtp

password = "my-super-secret-password"
plaintext = b"This is the actual secret data."

# Encrypt the data
encrypted_data = dtp.encrypt_dtp(plaintext, password)

# Decrypt the data
decrypted_data = dtp.decrypt_dtp(encrypted_data, password)

print(f"Original:  {plaintext}")
print(f"Decrypted: {decrypted_data}")

# Generate a decoy string
decoy = dtp.generate_decoy()
print(f"Generated Decoy: {decoy}")

Enhanced Security with Client Secret

import dtp

# Generate a unique client secret (store securely on user's device)
client_secret = dtp.generate_client_secret()

password = "user-password"
plaintext = b"Sensitive user data"

# Encrypt with both password and client secret
encrypted_data = dtp.encrypt_dtp_with_client_secret(
    plaintext, password, client_secret
)

# Decrypt requires both password and client secret
decrypted_data = dtp.decrypt_dtp_with_client_secret(
    encrypted_data, password, client_secret
)

Decoy Detection System

import dtp

# Generate and track decoy passwords
decoys = []
decoy_hashes = set()

for _ in range(10):
    decoy = dtp.generate_decoy()
    decoy_hash = dtp.hash_password(decoy)
    decoys.append(decoy)
    decoy_hashes.add(decoy_hash)

# During login, check if password is a decoy
submitted_password = "some_password"
if dtp.is_decoy_password(submitted_password, decoy_hashes):
    print("🚨 ALERT: Decoy password detected! Possible attack!")
    # Trigger security response
else:
    print("✅ Legitimate password")
    # Proceed with normal login

🛡️ How It Works

The DTP SDK uses a revolutionary multi-layered approach:

  1. Inner Encryption: Real data is encrypted using AES-256-GCM with a secondary key (k2)
  2. Steganographic Embedding: The encrypted real data is hidden within a plausible decoy string using zero-width Unicode characters
  3. Outer Encryption: The decoy (containing hidden real data) is encrypted again with the primary key (k1)
  4. Decoy Detection: Generated decoys are hashed and tracked for real-time attack detection

Attack Scenario Protection

When an attacker breaks the outer encryption layer:

  • They get a plausible decoy password (e.g., "darknet42@!")
  • Attempting to use this decoy triggers an immediate alert
  • The real data remains safely hidden and encrypted
  • Users get notified to change their passwords
  • Attackers must start over, wasting time and resources

📚 Complete API Reference

Core Functions

  • encrypt_dtp(plaintext: bytes, password: str) -> bytes
  • decrypt_dtp(envelope: bytes, password: str) -> bytes
  • encrypt_dtp_with_client_secret(plaintext: bytes, password: str, client_secret: str) -> bytes
  • decrypt_dtp_with_client_secret(envelope: bytes, password: str, client_secret: str) -> bytes

Decoy Management

  • generate_decoy(decoy_data: Optional[Dict] = None) -> str
  • load_decoy_data(template_path: Optional[str] = None) -> Dict
  • is_decoy_password(submitted_password: str, known_decoy_hashes: set) -> bool

Security Utilities

  • hash_password(password: str) -> str
  • generate_client_secret() -> str

Advanced Functions

  • decrypt_decoy(envelope_bytes: bytes, password: str) -> str
  • extract_secret(decoy_with_zw: str, secret_key: bytes) -> bytes

Exception Classes

  • DTPError: Base exception for DTP-related errors
  • DTPDecryptionError: Raised when decryption fails

🎯 Customizing Decoy Generation

Create your own decoy_template.json file to generate industry-specific decoys:

{
    "subjects": ["srv", "db", "api", "net"],
    "verbs": ["run", "fail", "conn", "auth"],
    "objects": ["err", "ok", "cfg", "tmp"],
    "adjectives": ["fast", "dark", "red", "max"],
    "symbols": "!@#$%^&*",
    "templates": [
        "{adj}{subj}{time}{sym}{sym}",
        "{subj}_{obj}{sym}"
    ]
}

This customization makes it impossible for attackers to create universal DTP-breaking tools.

💼 Enterprise Integration

The DTP SDK is designed for easy integration into:

  • Web applications and APIs
  • Password managers
  • Secure communication systems
  • Database encryption layers
  • IoT and embedded systems

📄 License

Licensed under the Apache License, Version 2.0. See LICENSE file for details.

🤝 Support

For enterprise licensing, custom implementations, or technical support, please contact the development team.

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

dtp_security-1.0.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

dtp_security-1.0.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file dtp_security-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for dtp_security-1.0.0.tar.gz
Algorithm Hash digest
SHA256 316cd8171b7c892006b76266076ed9e132a82d29963545577e5d72d9a6894472
MD5 06a6d8bd7562cefe92007ecee9873539
BLAKE2b-256 c897f889ce01589f2e1578440871d22b4adac8c716db1e6aeb1934aed7e657b6

See more details on using hashes here.

File details

Details for the file dtp_security-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for dtp_security-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed5ca8ac1e9a25a8e3dc4aa5e909a2ab0852380cf917a37523906319c65dec51
MD5 f48239585fd05716ac0e5ea91b04145a
BLAKE2b-256 4bd7185e74ed4355542fae3ebc2a7306dc70b8c4dcd61f3fb8ae9fce928eadb1

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