#Quick and sexy String encrypt / decrypt for Android
Sometimes you find yourself wanted to use SharedPrefs to hold something precious? Want to prevent those pesky rooted hackz0rs from looking in your SharedPreds? Here is a quick and sexy no-external-libs-required solution.
Notes;
-
I have declared everything static so you can create your own utility class and throw the following straight in.
-
3rd party imports are not required. Use
import android.util.Base64;
for Base64, andimport javax.crypto.*;
for Cipher.