Hi :)

I am using RC4 algorithm and HexDump to store byte[] as String. It's simple 
and fast. You just need a byte key with which you encode/decode things.

RC4: http://opensourcejavaphp.net/java/hipergate/com/knowgate/acl/RC4.java.html
HexDump: 
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.4_r1.2/com/android/internal/util/HexDump.java#HexDump

public static String encryptString(String normal)
> {
>     byte[] encrypt = new RC4(KEY).rc4(normal); 
>     return HexDump.toHexString(encrypt);
> }
> public static String decryptString(String encrypted)
> {
>     if (encrypted.length() > 0)
>     {
>         byte[] decrypt = HexDump.hexStringToByteArray(encrypted);
>         return new String(new RC4(KEY).rc4(decrypt));
>     }
>     return "";
> }


On Tuesday, August 7, 2012 1:54:22 PM UTC+2, Jovce Mitrejcevski wrote:
>
> Hello,
>
> I am building an application which is using SQLite database. The 
> database/items inside should be encrypted that way, when someone with 
> rooted device export the database, the items should not be readable.
> While the application run time, i have to read articles from the database, 
> decode them, show to the user, and if he do some changes, save encrypted 
> items. All to all, I need 2 ways encrypt/decrypt algorithm.
> The question is what is the best approach way/best algorithm to do this?
>
> Thank you very much.
>
> Regards,
>
> Jovce
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to