A Swift library providing secure property wrappers for storing data in UserDefaults, Keychain, and custom storages with encryption.
SecurePropertyStorage is a Swift library that provides secure property wrappers for storing sensitive data. It automatically encrypts values and hashes keys, offering a safe way to persist data in UserDefaults, Keychain, or custom storage backends. The library solves the problem of securely managing app secrets and user data with minimal boilerplate code.
iOS, macOS, tvOS, watchOS, and visionOS developers who need to securely store sensitive data like passwords, tokens, or user preferences in their Swift applications.
Developers choose SecurePropertyStorage for its automatic encryption, ease of use via property wrappers, and support for multiple storage backends. Its built-in concurrency safety and dependency injection features provide a robust, secure solution without manual security implementation.
Helps you define secure storages for your properties using Swift property wrappers.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically encrypts values with AES-GCM and hashes keys with SHA512 by default, ensuring robust security without manual implementation, as highlighted in the README's feature list.
Supports multiple backends like UserDefaults, Keychain, singleton memory, and custom storage, allowing developers to choose the right security level for different data types, as shown in the basic usage examples.
Offers Codable-prefixed wrappers (e.g., @CodableUserDefault) for easy serialization of custom types, reducing boilerplate code when storing complex data structures securely.
Includes @Inject and @Register wrappers with qualifiers and scopes for type-safe DI, simplifying app architecture without relying on external libraries, as detailed in the dependency injection section.
Designed with Swift concurrency in mind, using a global actor to prevent data races during storage operations, though it requires stored types to be Sendable, as emphasized in the concurrency guide.
Mandates that all stored types conform to Sendable for concurrency safety, which can be challenging for legacy or mutable types, adding development overhead and potential migration issues.
The built-in DI system is unique to this library, creating vendor lock-in and making it harder to switch to or integrate with other DI solutions in larger or evolving codebases.
Automatically encrypts all values, which might be unnecessary for non-sensitive data like simple preferences, leading to performance trade-offs in data-intensive apps without an opt-out mechanism.
Restricted to Apple platforms (iOS 13.0+, macOS 11.5+, etc.), with no support for server-side Swift, Linux, or other ecosystems, limiting its use in broader projects.