# "file is encrypted or is not a database" using node js sqlite3 package with SQLCipher

**URL:** <https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-using-node-js-sqlite3-package-with-sqlcipher/4407>\
**Category:** Issues\
**Created:** [May 20, 2020, 9:04am UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-using-node-js-sqlite3-package-with-sqlcipher/4407 "2020-05-20T09:04:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aryesh](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@Aryesh](https://discuss.zetetic.net/u/Aryesh)\
**Post date:** [May 20, 2020, 9:04am UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-using-node-js-sqlite3-package-with-sqlcipher/4407/1 "2020-05-20T09:04:56Z")

</div>

Hello @developernotes  
I have generated encrypted database as shown in [this article](https://discuss.zetetic.net/t/how-to-encrypt-a-plaintext-sqlite-database-to-use-sqlcipher-and-avoid-file-is-encrypted-or-is-not-a-database-errors/868/2). I have requirements such that I am using [sqlite3](https://www.npmjs.com/package/sqlite3) package and have to follow its syntax in connection with database and other operations in node js project. When I try to make connection with encrypted database it is successfully done but when apply any operations it is showing **file is encrypted or is not a database**. I can understand that it is encrypted database but is there any syntax or password filling in sqlite3 which can be provided as a solution?  
Thanking you in advance!

---

<div class="post-metadata">

**Author:** ![Aryesh](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@Aryesh](https://discuss.zetetic.net/u/Aryesh)\
**Post date:** [May 20, 2020, 8:45am UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-using-node-js-sqlite3-package-with-sqlcipher/4407/2 "2020-05-20T08:45:06Z")

</div>

Hello Stephen, I am using [sqlite3](https://www.npmjs.com/package/sqlite3) package. In its documentation I found about SQLCipher. So as you have described the process I followed the same. And finally I got a encrypted database. But when I use it in my nodejs project with this lines for connection:  
var db = new sqlite3.Database(‘path/to/database’);  
It is showing connection done but they shows error that **file is encrypted or is not a database**. I cannot found any solution for that after searching a lot. Anything you can suggest? Please help me regarding this.

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [May 20, 2020, 9:50pm UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-using-node-js-sqlite3-package-with-sqlcipher/4407/3 "2020-05-20T21:50:58Z")

</div>

Hello @Aryesh ,

Zetetic doesn’t actually develop or support the node sqlite3 package so I’m not sure you’ll see much in the way of responses on this forum. It would be better to contact the developer of that library for support, either directly or via a GitHub issue.

If you’re in need of a commercially supported solution, we do offer a Cordova solution, but it is not a free package (it’s available only under the SQLCipher enterprise program). If you’re interested in learning more about that feel free to let us know.
