I want to store information inside a database on Android.
But for the sake of security, I'd like to encrypt this information.
Does anyone have any simple code for this? (and you can roll back).
I want to store information inside a database on Android.
But for the sake of security, I'd like to encrypt this information.
Does anyone have any simple code for this? (and you can roll back).
I have this example of encryption I used once:
String senha= "";
MessageDigest md = null;
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
BigInteger hash = new BigInteger(1, md.digest(pass.getBytes()));
senha= hash.toString(16);
basically only converts string, but you can adapt, there is already something to base it on.