Skip to content

Instantly share code, notes, and snippets.

View yoonseopshin's full-sized avatar
🏠
Working from home

Yoonseop Shin yoonseopshin

🏠
Working from home
View GitHub Profile
@yoonseopshin
yoonseopshin / SecureSharedPreferences.kt
Created March 17, 2022 05:32 — forked from FrancescoJo/SecureSharedPreferences.kt
A SharedPreferences wrapper implementation with encryption/decryption, using CipherHelper implementation.
import android.content.SharedPreferences
/**
* A [android.content.SharedPreferences] wrapper that helps easy reading/writing values.
*
* @author Francesco Jo([email protected])
* @since 22 - Mar - 2018
*/
class SecureSharedPreferences(private val sharedPref: SharedPreferences) {
fun contains(key: String) = sharedPref.contains(key)
@yoonseopshin
yoonseopshin / AndroidRsaCipherHelper.kt
Created March 17, 2022 05:32 — forked from FrancescoJo/AndroidRsaCipherHelper.kt
Android RSA cipher helper with system generated key. No more static final String key in our class - an approach which is very vulnerable to reverse engineering attack.
import android.os.Build
import android.security.KeyPairGeneratorSpec
import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
import android.util.Base64
import timber.log.Timber
import java.math.BigInteger
import java.security.GeneralSecurityException
import java.security.KeyPairGenerator
import java.security.KeyStore
@yoonseopshin
yoonseopshin / README.md
Created July 16, 2022 06:48 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store