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

πŸ₯·βŒ 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


@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.

var sensitiveString = "Sensitive String"
var sensitiveInt = 100
struct MyObject: Codable {
    var name: String

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


  • Swift Tools 5.5.0
View More Packages from this Author


  • None
Last updated: Tue Nov 08 2022 15:20:10 GMT-0500 (GMT-05:00)