sqlite error code 26

Because in SQLite the database driver/library has no way to know if a given file is an encrypted database or not a database at all. SQLite’s method of database encryption is to completely encrypt the entire file, just like if you encrypted a text file. Without the correct encryption key (and encryption method), there’s no way to tell what kind of file it is. When you set the encryption key for connecting to a SQLite database, it unencrypts the file’s contents as it loads it into memory, again just like you would for an encrypted text file. So, without the correct encryption key, all the database driver can say is the file it attempted to open is not a valid database file.