• Stars
    star
    411
  • Rank 105,001 (Top 3 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kissme: Kotlin Secure Storage Multiplatform

Kissme: Kotlin Secure Storage Multiplatform

Android Arsenal Build Status

Kissme is an open-source library providing encrypted key-value storage.

It can be integrated seamlessly in Kotlin projects built with Kotlin Multiplatform, Kotlin/Native, and Kotlin Android plugins.

Kissme allows storing key-value data in common code modules without any additional boilerplate code.

Currently library supports the following platforms:

  • Android (API >= 23)
  • iOS (ios_arm64 and ios_x64 targets)

Download

To use this library in your project, add Netguru and Binryprefs maven urls to the repositories block:

repositories {
    maven {  url 'https://dl.bintray.com/netguru/maven/' }
    maven { url "https://jitpack.io" }
}

Then add following dependencies to the common module build.gradle:

    sourceSets {
        commonMain {
            dependencies {
                implementation 'com.netguru.kissme:common:0.2.5'     
            }
        }
        androidMain {
            dependencies {
                implementation 'com.netguru.kissme:android:0.2.5'
            }
        }
        iosMain {
            dependencies {
                implementation 'com.netguru.kissme:ios:0.2.5'
            }
        }
    }

Remember to enable GRADLE_METADATA in settings.gradle:

enableFeaturePreview('GRADLE_METADATA')

Usage

Just start with creating an instance of Kissme class somewhere in your common module and enjoy! It's as simple as that. You don't have to initialize it by yourself nor to pass Android Context. Everything is done automatically.

val storage = Kissme(name = "my_secret_storage")

The name parameter is optional. You can omit it if you want to use default storage. Kissme allows you to store and persist multiple data types:

  • String
  • Int
  • Long
  • Float
  • Double
  • Boolean

If you want to store something, just call:

storage.putString(key = "someKey", value = "value")

If you want to get stored value - use:

storage.getString(key = "someKey", defaultValue = "default")

All get() functions will return defaultValue parameter if storage doesn't contain selected key.

You can get all keys stored in Kissme storage by calling:

storage.getAll()

You can check if Kissme storage contains selected key by calling:

storage.contains(key = "someKey")

You can also remove selected key from storage:

storage.remove(key = "someKey")

Last, but not least, you can remove all data stored in Kissme storage:

storage.clear()

About

Kissme allows to store key-value pairs in platform-specific way securely.

Android

Android implementation uses binaryprefs library under the hood in order to provide a robust key-value storage mechanism. The 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.

In order to acquire the application Context instance required for data storing operations the library registers an internal ContentProvider.

iOS

The 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. Keychain is simple wrapper build upon Security interface to store, save, and fetch not only passwords, but also accounts.

Running sample app

Sample app uses Maven Local for resolving Kissme dependencies. Before running sample app you need to:

  1. Build the library - ./gradlew build
  2. Publish dependencies to Maven Local - ./gradlew publishToMavenLocal
  3. Run selected library. If you want to run iOS app - you need to properly configure Xcode. Please check: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#setting-up-xcode before running iOS sample app.

Development roadmap

  1. Configure integration tests on iOS
  2. Add CI
  3. Add support for Android API < 23
  4. Automate KeychainWrapper framework generation
  5. Migrate to kotlin-multiplatform Gradle plugin
  6. Clean up .pom dependencies declarations
  7. Add experimental JavaScript support - call for ideas

Kissme is an open source project developed and maintained by Kotlin community. Feel free to contribute to the project.

License

Copyright 2018 Netguru

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

ResponseDetective

Sherlock Holmes of the networking layer. ๐Ÿ•ต๏ธโ€โ™‚๏ธ
Swift
1,956
star
2

sticky-parallax-header

A simple React Native library, enabling the creation of fully customized header for your iOS and Android apps.
TypeScript
1,811
star
3

CarLensCollectionViewLayout

An easy-to-use Collection View Layout for card-like animation.
Swift
548
star
4

videochatguru-android

Open source library to create fast and beautiful video chats over WebRTC
Kotlin
309
star
5

BlueSwift

Swift framework for easy connection with Bluetooth peripherals.
Swift
169
star
6

ngrvalidator

Validation has never been as easy as now!
Objective-C
165
star
7

compose-multiplatform-charts

Charts library for Kotlin multiplatform applications
Kotlin
136
star
8

CarLens-iOS

CarLens - Recognize and Collect Cars
Swift
130
star
9

AnimatedCardInput

Easy to use iOS library with components for input of Credit Card data.
Swift
38
star
10

ar-localizer-view-android

Kotlin
33
star
11

CarLens-Android

CarLens - Recognize and Collect Cars
Kotlin
24
star
12

mobile-security-checklist

Netguru mobile security checklist
Python
23
star
13

rnd-retail-multiplatform-public

Kotlin
22
star
14

baby-monitor-client-android

Internal Baby Monitor android project
Kotlin
20
star
15

heroes-api

TypeScript
18
star
16

baby-monitor-client-ios

Swift
17
star
17

netguru

netguru gem - collection of solutions we use to develop and deploy our projects.
Ruby
16
star
18

awesome-list

Ruby
15
star
19

xcconfigs

Collection of common Xcode configuration files. ๐Ÿ› ๏ธ
14
star
20

CreateML-Research

The easy ways to start your journey with CreateML.
Swift
14
star
21

mobile-security-review

Security review guidelines for mobile projects
13
star
22

react-native-ar-localizer

Java
12
star
23

nodejs-recruitment-task

Repository for Node.js department's recruitment process.
JavaScript
11
star
24

productivity

Productivity tips for Netguru
Dockerfile
10
star
25

ng-ios-network-module

iOS Networking Module
Swift
9
star
26

commentable-rs

Rust
9
star
27

highway

Build system on top of Fastlane.
Ruby
9
star
28

coolcal-android

Kotlin
9
star
29

flutter-recruitment-task

Dart
8
star
30

design-process

CSS
7
star
31

opoca

Library for speeding up building machine learning proof of concepts.
Python
7
star
32

atstats-android

atStats native android app
Kotlin
5
star
33

graphql-starter-pack

Graphql training by Netguru.
Ruby
4
star
34

kivy-games

Python
4
star
35

SimpleRegEx

Wrapper for RegEx, made so the RegEx code will be understable
Python
4
star
36

smarthome

Kotlin
4
star
37

netguru-grdb

Swift
4
star
38

react-native-modal-dropdown

JavaScript
4
star
39

sections-decorator-android

Kotlin
4
star
40

bitrise-step-slack

A next-gen Slack webhook step for Bitrise
Ruby
3
star
41

frontend-recruitment-task

3
star
42

picguard-swift

Image analysis framework for Swift
Swift
3
star
43

hubguru-ios-public

Swift
3
star
44

ios-framework-template

Swift
3
star
45

qa-selenium-java-framework

Java
2
star
46

ar-localizer-view-iOS

Swift
2
star
47

capistrano-docker

Ruby
2
star
48

ngrcrop-ios

ngrcrop-ios: UI component for editing selected photos.
Objective-C
2
star
49

rack_password

Small rack middleware to block your site from unwanted vistors.
Ruby
2
star
50

awesome-frontend-architecture

Collection of awesome frontend architecture resources
2
star
51

iOS-Good-Practices

Swift
2
star
52

inicjatywyotwarte-be

A website that tries to collect all important and relevant initiatives that could help in the times of COVID-19. https://www.inicjatywyotwarte.pl
Ruby
2
star
53

terraform-module-hcloud

Hetzner Cloud module for terraform
HCL
2
star
54

inicjatywyotwarte-fe

A website that tries to collect all important and relevant initiatives that could help in the times of COVID-19.
JavaScript
2
star
55

sync-aws-extend-switch-roles

Sync AWS Extend Switch Roles
1
star
56

ios-bitrise-client-public

Swift
1
star
57

bitrise-step-ng-jira-step

Shell
1
star
58

codestories-react-native-hooks

JavaScript
1
star
59

devise-2fa

Devise with 2FA support based on Twilio
Ruby
1
star
60

twilio-2fa-bot

Simple Twilio messages scrapper for shared phone numbers
JavaScript
1
star
61

danger-flutter-coverage

Ruby
1
star
62

meetguru

JavaScript
1
star
63

django-modular-user

Python
1
star
64

bitrise-step-danger-android

Shell
1
star
65

dc-docker-task

This repo stores docker recruitment tasks for devops-college
Dockerfile
1
star