2

Is there any free library / Java API to encrypt and decrypt sqlite database in java ? I am using SQLite JDBC driver as part of xerial project.

Thanks, Deep

2
  • 2
    Do you want to decrypt / encrypt the database while it's closed? That's relatively easy - but then you should change the title of the question to 'how to decrypt / encrypt a file'... If not, then there are various SQLite encryption extensions. But I don't know a Java library. Commented Sep 10, 2010 at 20:11
  • Thanks for your response. So do you mean, I can simply encrypt it as a normal file and then decrypt it like a normal file before reading the records from the tables. Commented Sep 15, 2010 at 15:03

1 Answer 1

1

There is an encryption library (sqlite-crypt) available in C, but if you want to do it in Java, I would simply encrypt the file like any other file. See this example of file encryption/decryption in Java.

Sign up to request clarification or add additional context in comments.

1 Comment

Just a question, won't encrypting and decrypting the file like that leave the file vulnerable? i mean jdbc picks up the file, which means you will have to decrypt the file to let's say the temp folder, and then use that fine in stead of the encrypted one. Won't this leave a small window of attack? I'd like my data to go from my encrypted database straight to my memory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.