Yesterday I published a library for Kotlin Multipl...
# feed
i
Yesterday I published a library for Kotlin Multiplatform, if you like it... put a star πŸ™‚ πŸš€ KSafe - New Library for Effortless Enterprise-Grade Encrypted Persistence for Kotlin Multiplatform and Native Android with Hardware-Backed Security. πŸ‘‰ Just declare a variable and use it...
Copy code
var apiSecret by ksafe("")
πŸ‘‰ Encrypted+Persisted COMPOSE STATE?
Copy code
var counter by ksafe.mutableStateOf(0)
πŸ‘‰ Serializable data classes?
Copy code
// declare a serializable data class
@Serializable
data class AuthInfo(
        val accessToken: String = "",
        val refreshToken: String = "",
        val expiresIn: Long = 0L
)

// and a ksafe variable
var authInfo by kvault(AuthInfo())
πŸ‘ Then just feel free to read the variable to retrieve the encrypted stored info and modify your variables as with any other variable... That's it. Your mobile app's data is now persisting your Encrypted content in DataStore, protected by Android Keystore or iOS Keychain. Zero configuration. Zero headaches. Just a single line! 🎯 πŸ’‘ More ways to declare your ksafe content without delegation and within coroutines exist Check library's GitHub README. Useful for: OAuth tokens, API keys, User credentials, Any sensitive data Available in Maven Central, just add:
Copy code
implementation("eu.anifantakis:ksafe:1.0.0")
implementation("eu.anifantakis:ksafe-compose:1.0.0")
Benefits: βœ… One line of code = bank-level security βœ… Works identically on Android & iOS βœ… Automatic key management βœ… Compose state support included! πŸ”— Check it out: github.com/ioannisa/KSafe ⭐ Star it if you find it useful! Want to see KSafe in action? Visit the DEMO APP: πŸ”— github.com/ioannisa/KSafeDemo
πŸŽ‰ 5
r
FYI a similar library named KVault already exists https://github.com/Liftric/KVault
i
Damn, lol!
s
does it also support desktop targets or only mobile android&ios ?
βž• 1
i
For now I made it for mobile, but I can extend it easily for desktop... plan to include desktop at version2
πŸ‘πŸ» 1
@russhwolf renamed the library to KSafe... thanks! Packages everything is changed... Also let me say that Multiplatform Settings is THE library...