Skip to content

PhotoSafe is a privacy-focused iOS app that lets users securely store photos, encrypt them, and organize them using face detection.

Notifications You must be signed in to change notification settings

OGSarah/PhotoSafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

PhotoSafe - A Secure Photo Vault App

PhotoSafe is a privacy-focused UIKit app that lets users securely store photos, encrypt them, and organize them using face detection. The app supports offline access, secure sharing via RESTful APIs, and an SDK for third-party integration. It uses a mix of Objective-C, Swift, and C/C++ to handle low-level operations, with a focus on performance, security, and modern iOS development practices.

Development Plan - Currently WIP

Setup:

  • Configure Core Data stack and SQLite backend.
  • Set up GitHub repository. ✅
  • Add SwiftLint to the project. ✅

Core Features:

  • Implement photo encryption/decryption in C/C++.
  • Build face detection with Core Image and C/C++ optimizations.
  • Create programmatic UI for photo gallery with Core Animation.

Networking and Sharing:

  • Integrate RESTful APIs for photo sharing.
  • Implement asynchronous networking with URLSession.
  • Add secure data handling with certificates.

SDK Development:

  • Build and test the native SDK.
  • Create documentation and a sample integration app.

Testing and Optimization:

  • Write unit and UI tests.
  • Profile with Instruments for performance and memory issues.
  • Optimize concurrency with GCD and Operation Queues.

Distribution Prep:

  • Setup CI/CD with GitHub Actions.
  • Create and add an app icon. ✅
  • Configure provisioning profiles and code signing.
  • Prepare App Store metadata and submit for review.

Polish and Release:

  • Fix bugs identified during testing.
  • Finalize UI animations and user flows.
  • Release to Test Flight.

Key Features

Secure Photo Storage:

  • Photos are encrypted using AES-256 (leveraging cryptography knowledge).
  • Stored in a Core Data database with SQLite backend for persistence.
  • Offline access with secure caching.

Face Detection:

  • Uses Core Image for face detection to tag and organize photos.
  • Implemented in C/C++ for performance-critical image processing.

Secure Sharing:

  • RESTful API integration to share encrypted photos with other users.
  • Asynchronous networking with JSON parsing for metadata exchange.

Custom UI:

  • Programmatic UI using Swift and Interface Builder for certain views.
  • Core Animation for smooth transitions and custom photo gallery animations.

SDK for Third-Party Integration:

  • A native iOS SDK to allow other apps to integrate PhotoSafe’s encryption and storage capabilities.
  • Exposes APIs for photo encryption/decryption and storage.

Performance Optimization:

  • Multithreading with GCD and Operation Queues for background tasks (e.g., encryption, face detection).
  • Memory management with ARC and manual handling for C/C++ components.

Testing and Debugging:

  • Unit tests for core functionality (encryption, database operations).
  • UI tests for user flows (e.g., photo upload, sharing).
  • Profiling with Instruments for memory leaks and performance bottlenecks.

App Distribution:

  • Configured for App Store submission with provisioning profiles and code signing.
  • Uses Swift Package Manager for third-party dependencies (e.g., networking libraries).

Technical Implementation

1. Languages and Frameworks:

  • Swift: Used for the main app logic, UI, and modern iOS APIs (e.g., Core Data, Core Image).
  • Objective-C: Handles integration with legacy iOS APIs and CoreFoundation for low-level memory management.
  • C/C++: Implements performance-critical components like custom image processing for face detection and AES-256 encryption.
  • UIKit

2. Low-Level iOS Development

  • CoreFoundation: Manages memory for C-based image processing and encryption routines, bridging to Swift/Objective-C.
  • Core Graphics: Renders custom photo thumbnails and overlays for the gallery view.
  • Core Animation: Creates smooth transitions (e.g., photo grid animations, modal view presentations).

3. Memory Management:

  • ARC: Used for Swift and Objective-C components, with careful handling of retain cycles in closures and delegates.
  • Manual Memory Management: Applied in C/C++ for image processing and encryption to optimize resource usage.

4. UI Development:

  • Xcode and Interface Builder: Storyboards for the onboarding flow and settings screen.
  • Programmatic UI: Swift-based custom photo gallery view with a UICollectionView for dynamic layouts.
  • Core Animation: Animates photo transitions and loading states.

5. App Lifecycle and PerformanceLifecycle:

  • Handles app state transitions (e.g., saving state in applicationDidEnterBackground).
  • Optimization:Uses GCD for background tasks like photo encryption and face detection.
  • Operation Queues for managing dependent tasks (e.g., download photo, then decrypt).
  • Instruments to profile CPU, memory, and energy usage.

6. Multithreading and Concurrency:

  • GCD: Dispatches encryption and image processing to background queues.
  • Operation Queues: Manages sequential tasks like uploading photos to a server and updating the database.
  • Thread Safety: Ensures Core Data access is thread-safe using NSManagedObjectContext confinement.

7. Data Persistence:

  • CoreData: Stores photo metadata (e.g., tags, timestamps) and encrypted photo references.
  • SQLite: Backend for Core Data, with custom queries for performance.
  • File System: Encrypted photos stored in the app’s secure file directory.

8. Networking:

  • RESTful APIs: Integrates with a mock server for photo sharing (e.g., upload/download encrypted photos).
  • JSON Parsing: Uses Codable in Swift for metadata parsing.
  • Asynchronous Operations: URLSession for network requests, with retry logic and error handling.

9. Security:

  • Cryptography: Implements AES-256 encryption using C/C++ for performance, with key management via Keychain.
  • PKI/Certificates: Uses certificates for secure API communication (HTTPS with pinned certificates).
  • Secure Data Handling: Ensures no unencrypted data is stored or transmitted.

10. Testing:

  • Unit Tests: Tests encryption, decryption, and Core Data operations using XCTest.
  • UI Tests: Automates user flows like photo upload and sharing.
  • Mocking: Uses mock networking responses for testing API integration.

11. Debugging and Profiling:

  • Instruments: Profiles memory leaks, CPU usage, and network performance.
  • Xcode Debugger: Used for runtime debugging of complex issues (e.g., concurrency bugs).

12. App Distribution:

  • Swift Package Manager: Integrates dependencies like Alamofire for networking.
  • Provisioning Profiles/Code Signing: Configured for development and distribution.
  • App Store Submission: Follows Apple’s guidelines for metadata, privacy, and review.

13. Version Control and CI/CD:

  • GitHub: Hosts the project with feature branches and pull requests. CI/CD: Uses GitHub Actions for automated testing and building on push. Collaborative Workflow: Follows Shape Up methodology with 6-week cycles for feature development.

14. SDK Development:

  • Native SDK: A Swift-based SDK exposing encryption and storage APIs. Documentation: Includes API references and sample code for third-party developers. Integration: Tested with a sample third-party app to ensure compatibility.

15. Continuous Learning:

  • Leverages the latest iOS 26 features.
  • Follows WWDC sessions and Apple’s documentation for best practices.

Tools and Technologies

  • Xcode: For development, debugging, and Interface Builder.
  • Instruments: For profiling memory, CPU, and network usage.
  • GitHub: For version control and collaboration.
  • Swift Package Manager: For dependency management.
  • Core Data, Core Image, Core Graphics, Core Animation, CoreFoundation: For core functionality.
  • Keychain: For secure key storage.

About

PhotoSafe is a privacy-focused iOS app that lets users securely store photos, encrypt them, and organize them using face detection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages