https://github.com/durellwilson/swift-security-toolkit
Production-ready security utilities for Swift/SwiftUI - Keychain, biometrics, input validation, network security
https://github.com/durellwilson/swift-security-toolkit
biometrics cybersecurity detroit devrel keychain security swift swiftui
Last synced: 7 days ago
JSON representation
Production-ready security utilities for Swift/SwiftUI - Keychain, biometrics, input validation, network security
- Host: GitHub
- URL: https://github.com/durellwilson/swift-security-toolkit
- Owner: durellwilson
- Created: 2025-10-31T18:25:29.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-15T20:03:43.000Z (8 months ago)
- Last Synced: 2025-11-15T22:06:47.396Z (8 months ago)
- Topics: biometrics, cybersecurity, detroit, devrel, keychain, security, swift, swiftui
- Language: Swift
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swift Security Toolkit
Production-ready security utilities for Swift/SwiftUI applications. Built for Detroit's cybersecurity and DevRel community.
## ๐ Features
### Secure Storage
- Keychain integration
- Encrypted data storage
- Device-only access
- Actor-based thread safety
### Input Validation
- Email validation
- XSS prevention
- SQL injection detection
- Input sanitization
### Biometric Authentication
- Face ID / Touch ID support
- Async/await API
- Type detection
- Error handling
### Network Security
- Certificate pinning
- Secure requests
- Timeout handling
- Response validation
## ๐ฆ Installation
### Swift Package Manager
```swift
dependencies: [
.package(url: "https://github.com/durellwilson/swift-security-toolkit.git", from: "1.0.0")
]
```
## ๐ Quick Start
### Secure Storage
```swift
import SwiftSecurityToolkit
let storage = SecureStorage()
// Store sensitive data
let apiKey = "secret-key".data(using: .utf8)!
try await storage.store(apiKey, key: "api_key")
// Retrieve
let retrieved = try await storage.retrieve(key: "api_key")
// Delete
try await storage.delete(key: "api_key")
```
### Input Validation
```swift
let validator = InputValidator()
// Validate email
let isValid = validator.validateEmail("user@example.com") // true
// Sanitize input
let clean = validator.sanitizeInput("alert('xss')") // ""
// Detect injection
let hasInjection = validator.detectInjection("'; DROP TABLE users--") // true
```
### Biometric Auth
```swift
let auth = BiometricAuth()
// Check type
let type = await auth.biometricType() // .faceID or .touchID
// Authenticate
let success = try await auth.authenticate(reason: "Unlock app")
```
### Network Security
```swift
let network = NetworkSecurity()
// Secure request
let data = try await network.secureRequest(url: URL(string: "https://api.example.com")!)
```
## ๐ฏ Use Cases
### Mobile Banking
- Secure credential storage
- Biometric authentication
- Certificate pinning for API calls
### Healthcare Apps
- HIPAA-compliant data storage
- Patient data encryption
- Secure network communication
### Enterprise Apps
- SSO integration
- Input validation
- Audit logging
## ๐๏ธ Architecture
- **Actor-based**: Thread-safe by design
- **Async/await**: Modern concurrency
- **Protocol-oriented**: Easy to mock/test
- **Zero dependencies**: Pure Swift/Foundation
## ๐งช Testing
```bash
swift test
```
## ๐ Performance
- Keychain operations: <10ms
- Input validation: <1ms
- Biometric auth: ~500ms (system)
- Network requests: Depends on latency
## ๐ค Contributing
Built for Detroit's open source community. Contributions welcome!
1. Fork repository
2. Create feature branch
3. Add tests
4. Submit PR
## ๐ License
MIT License
## ๐ Detroit DevRel
Part of Detroit's Swift and cybersecurity education initiative.
**Related Projects**:
- [Security Awareness Course](https://github.com/durellwilson/security-awareness-course)
- [Detroit Tech Equity](https://github.com/durellwilson/DetroitTechEquity)
- [ML Text Kit](https://github.com/durellwilson/ml-text-kit)
---
**Built with โค๏ธ in Detroit** ๐ญ