{"id":13428887,"url":"https://github.com/netguru/Kissme","last_synced_at":"2025-03-16T02:30:40.988Z","repository":{"id":142735030,"uuid":"155874964","full_name":"netguru/Kissme","owner":"netguru","description":"Kissme: Kotlin Secure Storage Multiplatform","archived":false,"fork":false,"pushed_at":"2020-07-06T08:22:50.000Z","size":1008,"stargazers_count":418,"open_issues_count":14,"forks_count":29,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-15T02:08:24.560Z","etag":null,"topics":["android","cross-platform","defaults","encrypted","encryption","ios","key-value","kotlin","kotlin-library","kotlin-multiplatform","library","multiplatform","preferences","secure","storage","token"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netguru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-11-02T14:11:15.000Z","updated_at":"2025-02-07T10:26:05.000Z","dependencies_parsed_at":"2023-04-22T00:26:12.605Z","dependency_job_id":null,"html_url":"https://github.com/netguru/Kissme","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FKissme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FKissme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FKissme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netguru%2FKissme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netguru","download_url":"https://codeload.github.com/netguru/Kissme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243815605,"owners_count":20352195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cross-platform","defaults","encrypted","encryption","ios","key-value","kotlin","kotlin-library","kotlin-multiplatform","library","multiplatform","preferences","secure","storage","token"],"created_at":"2024-07-31T01:01:07.868Z","updated_at":"2025-03-16T02:30:40.964Z","avatar_url":"https://github.com/netguru.png","language":"Kotlin","funding_links":[],"categories":["Libraries","数据库","Database"],"sub_categories":["Storage","Spring Cloud框架"],"readme":"\n# Kissme: Kotlin Secure Storage Multiplatform\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Kissme-brightgreen.svg?style=flat-square)](https://android-arsenal.com/details/1/7452)\n[![Build Status](https://app.bitrise.io/app/b68dbe54aa16417f/status.svg?token=xAwQZBpUd_XUybTNkRTiIQ)](https://app.bitrise.io/app/b68dbe54aa16417f)\n\n\n**Kissme** is an open-source library providing encrypted key-value storage.\n\nIt can be integrated seamlessly in Kotlin projects built with **Kotlin Multiplatform**, **Kotlin/Native**, and **Kotlin Android** plugins.\n\n**Kissme** allows storing key-value data in common code modules without any additional boilerplate code.\n\nCurrently library supports the following platforms:\n- Android (API `\u003e=` 23)\n- iOS (`ios_arm64` and `ios_x64` targets)\n\n## Download\nTo use this library in your project, add Netguru and Binryprefs maven urls to the repositories block:\n```groovy\nrepositories {\n    maven {  url 'https://dl.bintray.com/netguru/maven/' }\n    maven { url \"https://jitpack.io\" }\n}\n```\n\nThen add following dependencies to the common module build.gradle:\n```groovy\n    sourceSets {\n        commonMain {\n            dependencies {\n                implementation 'com.netguru.kissme:common:0.2.5'     \n            }\n        }\n        androidMain {\n            dependencies {\n                implementation 'com.netguru.kissme:android:0.2.5'\n            }\n        }\n        iosMain {\n            dependencies {\n                implementation 'com.netguru.kissme:ios:0.2.5'\n            }\n        }\n    }\n```\n\nRemember to enable `GRADLE_METADATA` in `settings.gradle`:\n```groovy\nenableFeaturePreview('GRADLE_METADATA')\n```\n## Usage\nJust start with creating an instance of `Kissme` class somewhere in your common module and enjoy! It's as simple as that.\nYou don't have to initialize it by yourself nor to pass Android `Context`. Everything is done automatically.\n```kotlin\nval storage = Kissme(name = \"my_secret_storage\")\n```\nThe `name` parameter is optional. You can omit it if you want to use default storage.\n`Kissme` allows you to store and persist multiple data types:\n- String\n- Int\n- Long\n- Float\n- Double\n- Boolean \n\nIf you want to store something, just call:\n```kotlin\nstorage.putString(key = \"someKey\", value = \"value\")\n```\n\nIf you want to get stored value - use:\n```kotlin\nstorage.getString(key = \"someKey\", defaultValue = \"default\")\n```\n\nAll `get()` functions will return `defaultValue` parameter if storage doesn't contain selected `key`.\n\nYou can get all keys stored in `Kissme` storage by calling:\n```kotlin\nstorage.getAll()\n```\n\nYou can check if `Kissme` storage contains selected `key` by calling:\n```kotlin\nstorage.contains(key = \"someKey\")\n```\n\nYou can also remove selected key from storage:\n```kotlin\nstorage.remove(key = \"someKey\")\n```\n\nLast, but not least, you can remove all data stored in `Kissme` storage:\n```kotlin\nstorage.clear()\n```\n\n## About\n`Kissme` allows to store key-value pairs in platform-specific way securely.\n\n### Android\nAndroid implementation uses [binaryprefs](https://github.com/yandextaxitech/binaryprefs) library under the hood in order to provide a robust key-value storage mechanism. \nThe keys and values are encrypted using XOR and AES encryption accordingly. The data encryption and encryption keys storing generating mechanisms are fully automated and is applied to the stored data by default. All the encryption keys are stored in the Android `KeyStore`.  \n\nIn order to acquire the application `Context` instance required for data storing operations the library registers an internal \n `ContentProvider`.\n\n### iOS\nThe iOS implementation is using native iOS `Keychain`. The Secure Enclave is a hardware-based key manager that's isolated from processor. It allows you to store, delete, fetch passwords and accounts. \n`Keychain` is simple wrapper build upon `Security` interface to store, save, and fetch not only passwords, but also accounts.\n\n## Running sample app\nSample app uses Maven Local for resolving `Kissme` dependencies. Before running sample app you need to:\n1. Build the library - `./gradlew build`\n2. Publish dependencies to Maven Local - `./gradlew publishToMavenLocal`\n3. Run selected library. If you want to run iOS app - you need to properly configure Xcode.\n Please check: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#setting-up-xcode before running iOS sample app.\n \n## Development roadmap\n1. Configure integration tests on iOS\n2. ~Add CI~\n3. Add support for Android API \u003c 23\n4. Automate KeychainWrapper framework generation\n5. Migrate to kotlin-multiplatform Gradle plugin\n6. Clean up .pom dependencies declarations\n7. Add experimental JavaScript support - call for ideas\n\nKissme is an open source project developed and maintained by Kotlin community. Feel free to contribute to the project.\n\n## License\n\nCopyright 2018 Netguru\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2FKissme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetguru%2FKissme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetguru%2FKissme/lists"}