Skip to content
/ yapel Public

Yet Another (Shared) Preferences Encryption Library for Android

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.md
Notifications You must be signed in to change notification settings

vokod/yapel

yapel

Yet Another Shared Preference Encryption Library (for Android)

Yapel encrypts your Android shared preferences values. If you access shared preferences via Yapel, all the values will be encrypted with AES256 in GCM mode with a key that is generated with and is stored in the Android keystore. Key material cannot be extracted from the keystore and only the app that created it, can access the key.

The benefits: pentesters and hackers won't be able to read and manipulate the preferences of your app on a rooted device. You can store security sensitive information in shared preferences.

Features

  • AES256 GCM encryption
  • No need to set password
  • Encryption key is stored in the Android Keystore. Key material never leaves the keystore, key cannot be extracted.

Dependency

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
        maven { url "https://jitpack.io" }
    }
}

Then, add the library to your module build.gradle

dependencies {
    implementation com.github.vokod:yapel:0.2'
}

Usage

 try {
  Yapel yapel = Yapel.get("my_key_alias", this.getApplicationContext());
            
  yapel.setString("label1", "some string");
  yapel.setLong("label2", 1234);
            
  String readString = yapel.getString("label1", null);
  long readLong = yapel.getLong("label2", 0);
  
} catch (YapelException e) {
  e.printStackTrace();
}

Compatibility

minSdkVersion 23

License

Copyright (C) 2017 Vokó Dániel

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.

Author

Dániel Vokó (vokoda.reg@gmail.com)

About

Yet Another (Shared) Preferences Encryption Library for Android

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages