realm-encryption-helper

A lightweight library for generate encrypt key and save to KeyStore for Realm

License

License

Categories

Categories

Realm Data Databases
GroupId

GroupId

com.github.tntkhang
ArtifactId

ArtifactId

realm-encryption-helper
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

realm-encryption-helper
A lightweight library for generate encrypt key and save to KeyStore for Realm
Project URL

Project URL

https://github.com/tntkhang/realm-encryption-helper
Source Code Management

Source Code Management

https://github.com/tntkhang/realm-encryption-helper

Download realm-encryption-helper

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.tntkhang/realm-encryption-helper/ -->
<dependency>
    <groupId>com.github.tntkhang</groupId>
    <artifactId>realm-encryption-helper</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.tntkhang/realm-encryption-helper/
implementation 'com.github.tntkhang:realm-encryption-helper:1.0.0'
// https://jarcasting.com/artifacts/com.github.tntkhang/realm-encryption-helper/
implementation ("com.github.tntkhang:realm-encryption-helper:1.0.0")
'com.github.tntkhang:realm-encryption-helper:aar:1.0.0'
<dependency org="com.github.tntkhang" name="realm-encryption-helper" rev="1.0.0">
  <artifact name="realm-encryption-helper" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.tntkhang', module='realm-encryption-helper', version='1.0.0')
)
libraryDependencies += "com.github.tntkhang" % "realm-encryption-helper" % "1.0.0"
[com.github.tntkhang/realm-encryption-helper "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

realm-encryption-helper

Android Arsenal

Download

This is a lightweight library to generate a 64-bit random key and using AES Algorithm to encrypt/decrypt that random number to get a Secret Key and save it to Key Store.

This library especially supports for Realm Encryption. That means when using you don't have to care about how to get a random key, where to save that key for safe,... this library will take it.

Support all android version

Setup and using

  1. Add library to your build.gradle in app level
implementation 'com.github.tntkhang:realm-encryption-helper:1.0.2'

2.In your CustomeApplication where you init your Realm

// Config RealmEncryptionHelper
RealmEncryptionHelper realmEncryptionHelper = RealmEncryptionHelper.initHelper(this, getString(R.string.app_name));

// Config Realm
Realm.init(this);
RealmConfiguration config = new RealmConfiguration.Builder()
         .name("realm_encrypt.realm")
         .encryptionKey(realmEncryptionHelper.getEncryptKey()) // Call realmEncryptionHelper to get encrypt key
         .build();
 Realm.setDefaultConfiguration(config);

with this code

realmEncryptionHelper.getEncryptKey()

The library will check and generate a new key if your app doesn't contain the key in Key Store before and then save it to Key Store, otherwise, it will be got from Key Store.

DEMO

Download and run project for simple demo

That is, let's enjoy!

Versions

Version
1.0.0