Using SigVisualizer with Secure LSL streams for real-time visualization.
SigVisualizer is a Python/PyQt5 application for real-time visualization of LSL streams. When used with secure liblsl, it automatically:
- Displays encryption status for discovered streams (lock icon 🔒)
- Decrypts incoming data transparently
- Detects security mismatches before connecting
- Shows the stream's security status in the status bar
The security-aware SigVisualizer ships as a component of this repository at
apps/SigVisualizer/. It depends on the in-repo pylsl component (apps/pylsl/)
for the stream-security API.
cd apps/SigVisualizer
# Install dependencies, including the in-repo pylsl component
pip install PyQt5 numpy
pip install -e ../pylslThis component is licensed under the GNU General Public License v3.0 (see
apps/SigVisualizer/LICENSE), inherited from upstream SigVisualizer.
Point Python to the secure liblsl library:
# macOS
export PYLSL_LIB=/path/to/secureLSL/liblsl/build/liblsl-secure.dylib
# Linux
export PYLSL_LIB=/path/to/secureLSL/liblsl/build/liblsl-secure.so
# Windows
set PYLSL_LIB=C:\path\to\secureLSL\liblsl\build\lsl-secure.dllGenerate or import keys on the visualization workstation:
# Generate new keys
./lsl-keygen
# Or import your lab's shared key
./lsl-keygen --import /path/to/lab_shared.key.enc
# Verify
./lsl-config --check# With secure liblsl
PYLSL_LIB=/path/to/liblsl-secure.dylib python sigvisualizer.pyWhen you open SigVisualizer, encrypted streams are marked with a lock icon:
Select Stream:
🔒 EEG-Amplifier [64 channels]
🔒 EMG-Device [8 channels]
⚠️ LegacyDevice [16 channels] (insecure)
- 🔒 Lock icon: Stream is encrypted
⚠️ Warning icon: Stream is not encrypted (security risk)- Fingerprint: Available in stream info panel
- Launch SigVisualizer
- Click "Select Stream" or use the stream selector
- Choose a stream (encrypted streams show 🔒)
- Visualization begins with decrypted data
The decryption is transparent; you see the original signal data.
SigVisualizer shows security information in the status bar:
┌─────────────────────────────────────────────────────┐
│ Stream: EEG-Amplifier │
│ Security: ENABLED 🔒 │
│ Fingerprint: BLAKE2b:70:14:e1:b5:7f:93:ae:af... │
│ Session: 2h 14m (last key rotation: 1h 30m ago) │
└─────────────────────────────────────────────────────┘
Always confirm the lock icon is present when visualizing sensitive biosignal data.
Even with encryption, use secured lab networks:
- Wired connections preferred over WiFi
- Isolated VLANs for research equipment
- Firewall protection from external networks
Enable logging to track security events:
[log]
level = 4 ; Info level captures security eventsSigVisualizer automatically detects security mismatches when you click "Update" to find streams.
- Secure stream + Insecure visualizer: Stream requires encryption but SigVisualizer has no credentials
- Insecure stream + Secure visualizer: SigVisualizer has credentials but stream is unencrypted
When a mismatch is detected, you'll see a dialog showing:
- The affected stream names (with lock icon for secure streams)
- Instructions on how to fix the issue
- Clear indication that visualization cannot proceed
Security Mismatch
─────────────────
The following streams require security, but SigVisualizer does not have
security credentials configured:
• SecureEEG
To fix this:
1. Run 'lsl-keygen' to generate credentials, or
2. Import shared credentials from an authorized device
Cannot visualize streams with mismatched security settings.
After configuring credentials, click "Update" again to retry stream discovery.
Possible causes:
- Security mismatch between visualizer and stream source
- Different keys on devices (403 Public key mismatch)
- Network connectivity issues
- Stream is no longer available
Solution:
- Check
./lsl-config --checkon both devices - Verify fingerprints match:
./lsl-config --show-public - Verify network connectivity
- Click "Update" to refresh stream list
- Verify SigVisualizer is built with secure liblsl
- Check the stream source has security enabled
- Restart the stream source and refresh
Normal security overhead is <1ms. If you see higher latency:
- Check network conditions
- Verify CPU load on both devices
- Use release builds, not debug
# Basic launch
PYLSL_LIB=/path/to/liblsl-secure.dylib python sigvisualizer.py
# With custom security config
PYLSL_LIB=/path/to/liblsl-secure.dylib LSLAPICFG=/path/to/lsl_api.cfg python sigvisualizer.py
# With verbose logging (set in lsl_api.cfg)
# [log]
# level = 6- LabRecorder Integration - Recording streams
- Custom Applications - Build your own
- Troubleshooting - Common issues