How to read data from a .db.crypt file?

I want to read data as a string from .db.crypt file Is there any lib or method for decrypting data from this file?

If yes, then kindly indicate me the direction or indicate any sample.

+7
android database
source share
2 answers

I did this using the following code:

 public void copyDbToSdcard() { try { String comando = "cp -r /data/data/com.whatsapp/databases/msgstore.db /sdcard/My_Custom_Folder/"; Process suProcess = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(suProcess.getOutputStream()); os.writeBytes(comando + "\n"); os.flush(); os.writeBytes("exit\n"); os.flush(); try { int suProcessRetval = suProcess.waitFor(); if(255 != suProcessRetval) { // } else { // } } catch (Exception ex) { Log.e("ERROR-->", ex.toString()); } } catch (Exception e) { e.printStackTrace(); } } private void openAndQueryDatabase() { try { DataBaseHelper dbHelper = new DataBaseHelper(this.getApplicationContext()); newDB = dbHelper.getWritableDatabase(); Cursor c = newDB.rawQuery("SELECT data FROM messages where data!=''", null); if(c != null) { if(c.moveToFirst()) { do { String data = c.getString(c.getColumnIndex("data")); results.add(data); //adding to arrayList } while (c.moveToNext()); } } while (c3.moveToNext()); } } } catch (SQLiteException se) { Log.e(getClass().getSimpleName(), "Could not create or Open the database"); } } 

And then display the results in a TextView or, if you want.

Greetings! :)

0
source share

I think .db.crypt is just a suffix defined by someone. For example, I can create a text file and call it abc.db.crypt . Thus, you cannot do anything just by knowing the suffix.

But sometimes a suffix is ​​the key to finding a path to your decision. I think this file is the database file that was first encrypted. So you need to find the encryption method (perhaps DES or some algorithm defined by the author), decrypt the file to the database file (xxx.db), and then use sqlite3 to get the data from it.

0
source share

All Articles