Skip to content

Secure your sensitive data in SwiftUI project with ease @EncryptedAppStorage("sensitiveData") var sensitiveData = "Sensitive Data"

License

Notifications You must be signed in to change notification settings

khuong291/EncryptedAppStorage

Repository files navigation

🥷❌ EncryptedAppStorage

@AppStorage is built on top of UserDefaults, which is not secure storage. Which mean, you should not save your sensitive data using @AppStorage, because it’s easy for hacker to attack. Which @EncryptedAppStorage, your sensitive data will be saved in KeyChain. Once stored in Keychain this information is only available to your app, other apps can't see it. Besides that, operating system makes sure this information is kept and processed securely.

Twitter Swift Swift Package Manager

Usage

@EncryptedAppStorage can work with any types of value. If you assign the default value, then that value will be stored in KeyChain if it has no value there.

@EncryptedAppStorage(<#StoreKey#>)
var sensitiveString = "Sensitive String"
@EncryptedAppStorage(<#StoreKey#>)
var sensitiveInt = 100
struct MyObject: Codable {
    var name: String
}

@EncryptedAppStorage(<#StoreKey#>)
var myObject: MyObject? = nil

🛠 Compatibility

  • macOS 11.0+
  • iOS 14.0+
  • iPadOS 14.0+
  • tvOS 14.0+
  • watchOS 7.0+

⚙️ Installation

Only available with Swift Package Manager

🍻 PRs are welcome

👨‍💻 Author

Khuong – @khuong291

About

Secure your sensitive data in SwiftUI project with ease @EncryptedAppStorage("sensitiveData") var sensitiveData = "Sensitive Data"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages