i use the pysqlcipher to set a password for a database
>>> from pysqlcipher import dbapi2 as sqlite3
>>> c = sqlite3.connect("UserData.db")
>>> com = c.cursor()
>>> passwd = "PRAGMA key='test'"
>>> com.execute(passwd)
<pysqlcipher.dbapi2.Cursor object at 0x7fd676d667a0>
>>> com.execute('''create table hello(id int not null);''')
<pysqlcipher.dbapi2.Cursor object at 0x7fd676d667a0>
>>> com.execute("insert into hello(id) values (3)")
<pysqlcipher.dbapi2.Cursor object at 0x7fd676d667a0>
>>> com.commit()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'pysqlcipher.dbapi2.Cursor' object has no attribute 'commit'
>>> c.commit()
>>> c.close()
but when i want to use the sqlcipher to open the database....
SQLCipher version 3.11.0 2016-02-15 17:29:24
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> PRAGMA key='test';
sqlite> ATTACH DATABASE 'plaintext.db' AS plaintext KEY '';
Error: file is encrypted or is not a database
why?what should i do?can i use the sqlcipher to open the database?
i use the pysqlcipher to set a password for a database
but when i want to use the sqlcipher to open the database....
why?what should i do?can i use the sqlcipher to open the database?