4

I apologize if its redundant but I couldn't seem to find answer anywhere. I set up a password(encryption key) for my database using DB browser for SQLite3. It uses sqlcipher. Now I cannot access it. I'm not able to provide password\key. Here's my code:

import sqlite3
from Data.Item import item
import sys


conn = sqlite3.connect('maindb.db')
c = conn.cursor()
c.execute("PRAGMA KEY = 'password'")

def items():
      c.execute("SELECT * FROM Item")
      data=c.fetchall()

details=items()

My platform is Windows. I've tried pysqlcipher, It does not gets installed throws an error. How do I proceed from here? What should I do? My goal is to make my database file unreadable for some obvious reasons.

I get the following error: c.execute("SELECT * FROM Item") sqlite3.DatabaseError: file is encrypted or is not a database

3
  • Do you get an error from the code provided? What tells you exactly that this hasn't worked? Commented Sep 23, 2017 at 18:51
  • I edited the question to include all details. Commented Sep 23, 2017 at 19:04
  • @ Matee Ullah Malik. Hello, did you managed to solve your problem? I have the exact same problem than you. Commented May 19, 2018 at 1:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.