sqlcipher_export not working

813 views
Skip to first unread message

Ganesh V

unread,
Jan 1, 2014, 12:07:23 PM1/1/14
to sqlc...@googlegroups.com
Hi,
Sorry for poor english.
i have readied the site http://sqlcipher.net/
how to a non encrypted database to an encrypted database, from an encrypted database to a non encrypted database?
i need do put into xcode project of non encrypted of sqlite to encrypted sqlite. I tried terminal the below

-macbook:sqlTest user1$ sqlite3 sqlTest.sqlite
SQLite version 3.7.13 2012-07-17 17:46:21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> ATTACH DATABASE 'encrypted.sqlite' AS encrypted KEY 'testkey';
sqlite> SELECT sqlcipher_export('encrypted');
Error: no such function: sqlcipher_export
sqlite>
sqlcipher_export() is missing function. Please help me

Stephen Lombardo

unread,
Jan 1, 2014, 10:08:21 PM1/1/14
to sqlc...@googlegroups.com
Hello Ganesh,

The first step is to build the sqlcipher command line tool, as described here:

http://sqlcipher.net/introduction/

Once you have done this, you should run the command like this:

$ ./sqlcipher sqlTest.sqlite

or

$ /full/path/to/sqlcipher/sqlcipher sqlTest.sqlite

On unix systems, if you don't provide an explicit path for a command, the system will look for the program in $PATH. On OSX, the system ships with a sqlite3 command, so you've probably been using that instead of the version compiled with SQLCipher. Please let us know if that resolves the problem. Thanks!

Cheers,
Stephen
--
 
---
You received this message because you are subscribed to the Google Groups "SQLCipher Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlcipher+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Anil

unread,
Jan 2, 2014, 1:02:35 AM1/2/14
to sqlc...@googlegroups.com
Hello Stephen,

Which is edition of use sqlcipher_export() function? Commerical edition or Community edition?

Anil

unread,
Jan 2, 2014, 4:02:28 AM1/2/14
to sqlc...@googlegroups.com
Thank you for help i tired it for 6 hours. sqlite3_export() function will working.


On Thursday, January 2, 2014 8:38:21 AM UTC+5:30, Stephen Lombardo wrote:

Anil

unread,
Jan 2, 2014, 7:13:43 AM1/2/14
to sqlc...@googlegroups.com
One problem have that,

plaintext.sqlite size is 1 MB, has contain 4 tables. 

./sqlcipher plaintext.sqlite

QLCipher version 3.8.0.2 2013-09-03 17:11:13

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite> ATTACH DATABASE 'encrypted.sqlite' AS encrypted KEY 'testkey';

sqlite> SELECT sqlcipher_export('encrypted');

sqlite> DETACH DATABASE encrypted;

After command above,

plaintext.sqlite file size is getting zero byte and encrypted.sqlite getting 1 KB.

$ ./sqlite3 encrypted.db 

sqlite> PRAGMA key = 'testkey'; 

sqlite> ATTACH DATABASE ‘sqlTest.sqlite’ AS plaintext KEY '';

sqlite> SELECT sqlcipher_export('plaintext'); 

sqlite> DETACH DATABASE plaintext;

After Decrypt to plaintext

plaintext.sqlite size is zero byte. contain tables are missing.

What is issue?

Nick Parker

unread,
Jan 2, 2014, 10:11:08 AM1/2/14
to sqlc...@googlegroups.com
Hello Anil,

When you perform a sqlcipher_export command on an attached database, it
does not delete the referenced database. Also, in your example below,
once you have exported a plain-text database to an encrypted form, you
will not be able to open it with the standard sqlite3 command line
shell, nor would you have access to the sqlcipher_export convenience
function. To verify you are using a SQLCipher command line shell, issue
PRAGMA cipher_version and verify you get a value printed on your screen.

On 1/2/14, 6:13 AM, Anil wrote:
> One problem have that,
>
> plaintext.sqlite size is 1 MB, has contain 4 tables.
>
> *./sqlcipher plaintext.sqlite*
>
> *QLCipher version 3.8.0.2 2013-09-03 17:11:13*
>
> *Enter ".help" for instructions*
>
> *Enter SQL statements terminated with a ";"*
>
> *sqlite> ATTACH DATABASE 'encrypted.sqlite' AS encrypted KEY 'testkey';*
>
> *sqlite> SELECT sqlcipher_export('encrypted');*
>
> *sqlite> DETACH DATABASE encrypted;*
>
> After command above,
>
> plaintext.sqlite file size is getting zero byte and encrypted.sqlite
> getting 1 KB.
>
> *$ ./sqlite3 encrypted.db *
>
> *sqlite> PRAGMA key = 'testkey'; *
>
> *sqlite> ATTACH DATABASE ‘sqlTest.sqlite’ AS plaintext KEY '';*
>
> *sqlite> SELECT sqlcipher_export('plaintext'); *
>
> *sqlite> DETACH DATABASE plaintext;*
>
> After Decrypt to plaintext
>
> plaintext.sqlite size is zero byte. contain tables are missing.
>
> What is issue?
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "SQLCipher Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sqlcipher+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
Nick Parker

signature.asc

Anil

unread,
Jan 3, 2014, 12:25:45 AM1/3/14
to sqlc...@googlegroups.com
Hi Nick,

Thank you for help. i got it. 

Vinay Hegde

unread,
Jan 27, 2015, 4:56:29 AM1/27/15
to sqlc...@googlegroups.com
Hi Anil,

i am also facing same issue. can you please tell me how you solved this.
Reply all
Reply to author
Forward
0 new messages