I'm currently using MonoTouch and SQLite in order to determine whether using a database with encryption is better than a standard .txt file with encryption.
I am attempting to use RijndaelManaged and other System.Security.Cryptography methods to encrypt my SQLite DB, but the DB becomes corrupt.
I have found the problem, but have no idea why it's happening or how to fix it. This is a basic SQLite file with a single table:
SQLite format 3@ -‚
øø?gtablenewnewCREATE TABLE new (id int(5), name vchar(255))
After using an example online, and encrypting this database, I get this:
SQLite format 3@ -�
��?gtablenewnewCREATE TABLE new (id int(5), name vchar(255))
This leaves the DB corrupt and unusable. Does anyone have any idea why this happens? Can anyone help me to encrypt this DB WITHOUT using SQLCipher?
EDIT: I have tried reading the raw DB in as bytes, and tried converting the bytes to a string, but no matter what encoding I use, I get \0 after the first line.