Implements a comprehensive client-side encryption and blockchain integration system for secure data uploads to the Stellar Privacy Analytics platform, addressing all requirements from issue #9.
- AES-256-GCM Encryption: Military-grade encryption using Web Crypto API
- RSA Key Management: Asymmetric encryption for secure key exchange
- SHA-256 Integrity Verification: File integrity checks before/after encryption
- Secure Key Generation: Cryptographically secure random password generation
- WASM-Based Prover: Client-side ZK-proof generation
- File Integrity Proofs: Prove data authenticity without revealing content
- Data Ownership Proofs: Verify ownership without exposing data
- Privacy Compliance Proofs: Demonstrate regulatory compliance
- Drag & Drop Interface: Intuitive file upload zone
- Real-time Progress: Multi-part upload progress bars
- File Format Support: CSV, JSON, and Parquet files up to 10GB
- Stage-Based Processing: Visual feedback for encryption, proof generation, and upload
- Multi-Wallet Support: Freighter, Albedo, and xBull compatibility
- Automatic Transaction Signing: Seamless blockchain integration
- On-Chain Storage: Immutable storage of data metadata and proofs
- Downloadable Receipts: Comprehensive receipts with verification URLs
File Input → Encryption → ZK-Proofs → Stellar Transaction → Receipt
↓ ↓ ↓ ↓ ↓
Integrity AES-256 WASM Wallet Signing Download
Check GCM Prover & Upload PDF
frontend/src/lib/webCrypto.ts- Client-side cryptographic operationsfrontend/src/lib/zkProof.ts- Zero-knowledge proof generationfrontend/src/lib/stellarWallet.ts- Stellar blockchain integrationfrontend/src/components/SecureDataUpload.tsx- Main upload componentfrontend/src/lib/__tests__/secureDataUpload.test.ts- Test suitefrontend/src/lib/README.md- Comprehensive documentation
frontend/src/pages/DataManagement.tsx- Integrated new upload component
- End-to-End Encryption: Data encrypted client-side before transmission
- Zero-Knowledge Privacy: Proofs without revealing sensitive data
- Blockchain Immutability: All transactions recorded on Stellar
- Client-Side Processing: No plaintext exposure to servers
Comprehensive test suite covering:
- Cryptographic operations and key generation
- ZK-proof serialization/deserialization
- Stellar wallet integration
- File integrity verification
- Receipt generation
- Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Requires Web Crypto API, File API, Fetch API, and WebAssembly support
import { SecureDataUpload } from './components/SecureDataUpload';
<SecureDataUpload
onUploadComplete={handleReceipt}
maxFileSize={10 * 1024 * 1024 * 1024} // 10GB
acceptedFormats={['.csv', '.json', '.parquet']}
/>- Client-side AES/RSA encryption using Web Crypto API
- ZK-proof generation using WASM-based prover
- Progress bar for multi-part uploads
- Drag and drop zone for CSV/JSON files
- SHA-256 file integrity verification
- Stellar wallet transaction signing
- Downloadable receipt with on-chain CID
The new secure upload can be accessed via the Data Management page, featuring:
- Enhanced security indicators
- Real-time upload progress
- Wallet connection interface
- Receipt download functionality
Comprehensive documentation available in frontend/src/lib/README.md including:
- Architecture overview
- API documentation
- Usage examples
- Troubleshooting guide
Closes #9