# SM9-Embodied-Guardian **Repository Path**: thksang/SM9-Embodied-Guardian ## Basic Information - **Project Name**: SM9-Embodied-Guardian - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 24 - **Created**: 2026-02-13 - **Last Updated**: 2026-02-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SM9-Embodied-Guardian > SM9-signed tokens + privacy-preserving secure access control for embodied data (JSON/SQLite + Streamlit + ROS2) [中文](README.md) | [English](README_EN.md) | Link | URL | | --- | --- | | Repo | https://gitee.com/silver-guardian/SM9-Embodied-Guardian | | Issues | https://gitee.com/silver-guardian/SM9-Embodied-Guardian/issues | | Pull Requests | https://gitee.com/silver-guardian/SM9-Embodied-Guardian/pulls | ## Table of Contents - [Overview](#overview) - [Quick Start](#quick-start) - [Requirements](#requirements) - [Installation](#installation) - [Usage](#usage) - [Testing](#testing) - [License](#license) - [Contact](#contact) ## Overview This project provides two task modules: 1. **Task 1: SM9 fundamentals & key management** - System initialization (master key generation and parameter persistence) - User registration and attribute management - User private key extraction and encrypted storage - Token issuance (verifiable) - Attribute updates triggering key rotation, master key rotation, and revocation list updates - Audit logging (JSON Lines) 2. **Task 2: Privacy protection & secure access control for embodied data** - Generate 5 robot sensor records + 5 medical sensor records and **store them encrypted** - Policy decision based on user attributes and access policies (`raw` / `privacy` / `deny`) - Return **SM9-signed tokens** for authorized access (signature verification supported) - Return privacy-preserved (desensitized) data for limited-permission users - Produce an **access audit report** (per-request details: user attributes, matched policy, decision, privacy parameters) Supported components: - JSON / SQLite storage backends - Streamlit dashboard (Chinese UI) ## Quick Start ```bash git clone https://gitee.com/silver-guardian/SM9-Embodied-Guardian.git cd SM9-Embodied-Guardian python -m venv venv # Windows: venv\Scripts\activate # Linux/Mac: # source venv/bin/activate pip install -r requirements.txt # Start the dashboard streamlit run sm9_privacy_access/dashboard.py ``` For more commands and parameters (including ROS2/Gazebo demo), see: `使用方法.md`. ## Requirements ### OS - Windows / Linux / macOS (Python 3.10+ recommended) ### GmSSL dynamic library (Important) This project uses `gmssl-python`, which depends on the **GmSSL dynamic library** (e.g., `libgmssl.so` on Linux, `gmssl.dll` on Windows). If installing/loading the dynamic library on Windows is difficult, using **WSL2 (Ubuntu)** is recommended. Quick check: ```bash python -c "import gmssl; print('Sm9EncMasterKey' in dir(gmssl))" ``` ### Python - Python 3.10+ - pip ### Dependencies See `requirements.txt`. ## Installation ```bash pip install -r requirements.txt ``` ## Usage ### Run demos ```bash # Task 1 demo python -m sm9_privacy_access # Task 2 demo: generate 5+5 records, encrypt & store, simulate multi-user access, and output audit report python -m sm9_privacy_access.embodied_privacy_access.demo_embodied_privacy_access ``` ### Run Streamlit dashboard ```bash streamlit run sm9_privacy_access/dashboard.py ``` ### ROS2 demo (Ubuntu / ROS2 Humble) The repository root can be used directly as a colcon workspace (ROS2 packages are under `src/`). Build & launch: ```bash # 1) source ROS2 source /opt/ros/humble/setup.bash # 2) build in workspace root colcon build --symlink-install # 3) source overlay source install/setup.bash # 4) launch ros2 launch sm9_privacy_access_ros2 sm9_privacy_access_gazebo_bridge.launch.py ``` ## Testing This project recommends running tests via `run_tests.py`: ```bash # Task 1 tests python run_tests.py --task task1 # Task 2 tests python run_tests.py --task embodied_privacy_access # All python run_tests.py --task all # Or run legacy tests directly pytest tests ``` Test artifacts are written under `docs/`. ## License This project is licensed under the **Apache License 2.0**. ### Important Notices 1. **Experimental Software**: This is an experimental research project for educational and research purposes only. It is NOT intended for production use or deployment in safety-critical systems. 2. **Cryptographic Implementation**: This project implements SM9 algorithms using gmssl-python. Users are responsible for: - Verifying the correctness and security of cryptographic implementations - Ensuring compliance with local cryptographic regulations and export controls - Conducting independent security audits before any production deployment 3. **Privacy and Data Protection**: This software processes sensitive data (biometric information, medical records, location data, etc.). Users must: - Comply with applicable data protection laws (GDPR, HIPAA, etc.) - Implement appropriate security measures for data storage and transmission - Obtain necessary consents and authorizations for data processing - Conduct privacy impact assessments as required by law 4. **No Warranty for Security**: While this software implements privacy protection and access control mechanisms, the contributors make NO WARRANTY regarding the security or privacy guarantees of the system. Users assume all risks associated with the use of this software. 5. **Third-Party Dependencies**: This project depends on third-party libraries (gmssl-python, cryptography, etc.). Users are responsible for reviewing and complying with the licenses of all dependencies. 6. **Research and Educational Use**: This software is designed for: - Academic research and education - Prototype development and testing - Algorithm validation and benchmarking Commercial use requires additional evaluation and may require separate licensing arrangements. ### Full License Text See [LICENSE](LICENSE) file for details. ### Contributing By contributing to this project, you agree that your contributions will be licensed under the same Apache License 2.0 terms, and you certify that you have the right to submit the contribution. ## Contact - Issues: https://gitee.com/silver-guardian/SM9-Embodied-Guardian/issues