Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Databases created are not encrypted on Linux (Manjaro 5.15.112), electron-react-boilerplate #110

Open
dashDotter opened this issue May 31, 2023 · 0 comments

Comments

@dashDotter
Copy link

The database is created via the following code.

export function createDatabase(filePath: string, password: string): Promise<Database> {

  return new Promise<Database>((resolve): void => {
    let database: Database = new Database(filePath, async (): Promise<void> => {
      database.serialize(function(): void {
        database.run("PRAGMA cipher_compatibility = 4");
        database.run(`PRAGMA key = '${password}'`);
      });
      database = await setupTables(database);
    });
    resolve(database);
  });
}

called somewhere else in the project via:

//....
const someAsyncFunction = async () => {
    const db = await createDatabase(pathToDbFile, password);
}
//....

The resulting file can be opened with an editor/sql viewer of choice without providing the specified password. The same code when compiled on windows however, will result in an encrypted Database.

It is used within the electron-react-boilerplate
@journeyapps/sqlcipher version is 5.3.1
I tested it on manjaro 5.12 and manjaro 6.1.

@dashDotter dashDotter changed the title Database created are not encrypted on Linux (Manjaro 5.15.112), electron-react-boilerplate Databases created are not encrypted on Linux (Manjaro 5.15.112), electron-react-boilerplate May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant