Encryption on Android

1

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).

    
asked by anonymous 11.06.2016 / 04:11

1 answer

0

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.

    
11.06.2016 / 05:01