Skip to content

Security

FullStackHero edited this page Aug 3, 2025 · 1 revision

πŸ” Security Architecture

This document explains how the VirusTotal File Scanner is protected at runtime and what measures are taken to prevent tampering, unauthorized use, or reverse engineering.


πŸ”’ Code Protection with PyArmor

The main application logic in app.py is encrypted using PyArmor – a commercial-grade code obfuscator and runtime protector for Python.

πŸ”§ How it works:

  • app.py is not readable or executable on its own
  • At runtime, it is decrypted and executed using pyarmor_runtime.pyd
  • Without pyarmor_runtime.pyd, the app will not run

🧩 What is pyarmor_runtime.pyd?

This is a binary runtime loader used to decrypt and run PyArmor-encrypted scripts.

πŸ” Key properties:

  • Platform-specific (Windows/Linux/macOS)
  • Must remain in: pyarmor_runtime_000000/
  • Do not rename, remove, or edit this file

If this file is missing, users will get:

RuntimeError: this script is encrypted by pyarmor, but no runtime library is found

🧱 Tamper Protection

Since the logic is encrypted:

  • Source code is protected from inspection or modification
  • Logic cannot be modified or bypassed at runtime
  • Attempts to patch or alter the runtime will cause failure

πŸ” Runtime Integrity

For security-sensitive tools like a VT scanner:

  • It’s important that the logic cannot be altered or misused
  • Encryption ensures that no API key harvesting, logic changes, or unauthorized debugging is possible

πŸ“¦ Deployment Tips

  • Always include the full folder: pyarmor_runtime_000000/
  • Include:
    • __init__.py
    • pyarmor_runtime.pyd
  • Avoid uploading the unencrypted app.py or exposing build internals

❓ Can it be reverse engineered?

No, not without serious effort:

  • The Python bytecode is encrypted
  • The runtime is native compiled
  • Tools like uncompyle6 do not work on encrypted .pyc

⚠️ Limitations

  • PyArmor is not a cryptographic tool – it protects structure, not secrets
  • Do not embed API keys or secrets in encrypted app.py – use config.py instead

βœ… Summary

  • Encrypted with PyArmor
  • Relies on pyarmor_runtime.pyd to execute
  • Designed to prevent unauthorized access to internal logic
  • Can be safely distributed to users without exposing core functionality
Clone this wiki locally