Is the encryption of a db predictable?

I am just wondering. What if…

  • I store data in SQLite DB that a user can select.
  • The user can choose if the DB is going to be encrypted.
  • The EncryptionKey is a static string of characters

Can one figure out the EncryptionKey by just saving two sets of identical data, where one set is encrypted, and the other one isn’t?

that would be a plain text attack and sounds possible.

If you use a secure hash on the password, the encryption key may be recoverable, but not the text used for the hash.