I’m trying to put encrypted data into a sqlite3 database and I’m getting the dreaded 1 error:
“SQLITE_ERROR 1 /* SQL error or missing database */”
The data type on the field is undefined, which according to the documentation makes it BLOB.
The database writes fine if I don’t encrypt the data.
I’m using openSSL with aes to encrypt the data.
Any idea why it’s failing to write to the database?
Things I have tried so far:
I looked up field limits in sqlite and the maximum data length is :1,000,000,000
I’m guessing my string length is in the hundreds, so that doesn’t seem to be the problem.
I tried putting the encrypted data in brackets and then encoding it with json again to simplify the character set, it didn’t fix the problem.
I’m just looking for some ideas why it might not write. In testing, I have some lines that are not encrypted and some that are encrypted and the non encrypted lines write just fine.
Any suggestions are appreciated.