Storing credentials securely on a device is in many occasions necessary. You probably don't want to rely only on the separation of processes of the Android OS but make sure the stored values are also encrypted.So Goal is to have storing Credentials Securely on Android Devices
Android 4.0 or higher
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.mammahe:Secure-key:1'
}
Step 3. Add import in activity
import com.sairamkrishna.keystoresecure.Secure;
Step 4. Add TOKEN_KEY as shown below
Secure.TOKEN_KEY ="fqJfdzGDvfwbedsKSUGty3VZ9taXxMVw";
Step 5. To Encrypt string key use the following code
Secure.encrypt(name))
Step 6. To Decrypt string key use the following code
Secure.decrypt(name))
Copyright 2019 Sairamkrishna Mammahe
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 under the License is distributed on an "AS IS" BASIS, WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. the License for the specific language governing permissions and under the License.