Skip to content

A simple way to encrypt your secure data like passwords into a native .so library.

License

Notifications You must be signed in to change notification settings

linisme/Cipher.so

Repository files navigation

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

Cipher.so

Providing a simple way to keep your secure info safe for android app development.

GitHub license Android Weekly Recommend

Wiki


About

How it works?

All the key-values will be auto package into a native library during the compile time. Then your can obtain them from the Java interface generated by Cipher.so.

Features

  • Encrypt secure info in a native library via easy configs
  • Reflection free

Usages

Installation

Step 1. in the root build.gradle:

Add maven { url 'https://jitpack.io' } resposity and classpath 'com.github.MEiDIK:Cipher.so:dev-SNAPSHOT' dependency into the buildscript:

buildscript {
    repositories {
        google()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.github.MEiDIK:Cipher.so:dev-SNAPSHOT'
    }
}
Step 2. in the app module build.gradle:

Add apply plugin:'cipher.so' before(VERY IMPORTANT) apply plugin: 'com.android.application'

apply plugin: 'cipher.so'
apply plugin: 'com.android.application'

That's all, Cipher.so is ready to GO.

Configuration

In your app module build.gradle, add the follow-like configs to save key-values.

cipher.so {
    keys {
        hello {
            value = 'Hello From Cipher.so😊'
        }
        httpsKey {
            value = 'htkdjfkj@https2017now'
        }
        数据库密码 {
            value = '今天天气不错😂😂'
        }
        ...
    }
    encryptSeed = 'HelloSecretKey' //Secret key used for encryption
}

Then Rebuild to generate the Java Interface.

3. Call In Java/Kotlin

String hello = CipherClient.hello();
String httpsKey = CipherClient.httpsKey();
String dbKey = CipherClient.数据库密码();

Sample: HelloCipherSo

Contribute?

I am very glad for your contributes. Let's make this job awesome.

Here is the contribute workflow from github: Contribute Guide

Todos

  • Encrypt data in .so-lib
  • Prevent dynamic attacks
    • Check Signature
    • More
  • Support different Application varients

References

Great Thanks to


关于

原理?

在编译期,通过gradle配置将Key-value加密打包进native so库,然后通过自动生成的Java接口可以获取相应的数据。

特性

  • 通过简单的配置把隐私信息加密进native库
  • 没有使用反射

用法

安装

Step 1. 在root project的build.gradle中:

在buildscript中添加仓库maven { url 'https://jitpack.io' },添加依赖classpath 'com.github.MEiDIK:Cipher.so:dev-SNAPSHOT':

buildscript {
    repositories {
        google()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.github.MEiDIK:Cipher.so:dev-SNAPSHOT'
    }
}
Step 2. 在目标模块的build.gradle中:

apply plugin: 'com.android.application'(十分重要)添加apply plugin:'cipher.so'

apply plugin: 'cipher.so'
apply plugin: 'com.android.application'

至此,Cipher.so已经就绪。

配置

在app模块的build.gradle中,通过以下的配置保存key-value值。

cipher.so {
    keys {
        hello {
            value = 'Hello From Cipher.so😊'
        }
        httpsKey {
            value = 'htkdjfkj@https2017now'
        }
        数据库密码 {
            value = '今天天气不错😂😂'
        }
        ...
    }
    encryptSeed = 'HelloSecretKey' //用于加密的密钥
}

然后Rebuild一下,自动生产Java的调用接口。

3. 在Java/Kotlin中调用

String hello = CipherClient.hello();
String httpsKey = CipherClient.httpsKey();
String dbKey = CipherClient.数据库密码();

例子: HelloCipherSo

贡献代码?

十分欢迎你的贡献,让我们一起把这个做得更好。

这是Github的贡献指南: Contribute Guide

Todos

  • 在.so-lib中加密数据
  • 防止动态攻击
    • 检查应用 签名
    • 更多
  • 支持Multi Application varients

相关资料

万分感谢


License

Copyright 2017 认真的帅斌

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.