SQLite file containing garbage characters
===

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][1], 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 any help me to encrypt this DB WITHOUT using SQLCipher?


  [1]: http://support.microsoft.com/kb/307010