SQLCipher ported to Harbour (Windows)

Moderator: Rathinagiri

Post Reply
User avatar
Hazael
Posts: 109
Joined: Thu Jun 24, 2010 11:37 am
Location: France

Re: SQLCipher ported to Harbour (Windows)

Post by Hazael »

rathinagiri wrote:It is great to have a contact with the original developer.

I was eager to introduce our success in this regard in the mailing list. Since SQLCipher windows part is not free, I didn't tell anything there.
What isn't free is the binary package but you can make it yourself as the "Community Edition" that is under BSD-style open source license: http://sqlcipher.net/license. The only thing is that you must to include that license with your program.

Look what it says on their website:
SQLCipher's community edition is Open Source Software available under a permissive license that allows it's use in both open source and commercial products. All products that include SQLCipher (including those that use the Commercial Edition binaries) must abide by the following license, as well as the licenses for dependent and integrated products listed below. This generally requires attribution and reproduction of license grants in the application interface and/or materials.
Here is the mentioned license:
Copyright (c) 2008-2012 Zetetic LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the ZETETIC LLC nor the names of its contributors may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Please look it: http://sqlcipher.net/introduction/ - in special the last part about "Windows binaries" reproduced below:
Windows Binaries

The best resource for compiling SQLCipher on windows can be found in the MINGW thread on the mailing list. This process can be both difficult and time consuming, so we make a variety of pre-built windows binary packages available for sale.
And the mentioned thread on the mailing list: https://groups.google.com/forum/?fromgr ... cYpa1a_RTM

Finally the "Commercial Edition": http://sites.fastspring.com/zetetic/product/sqlcipher

In our case it is clear to me that we are using the "Community Edition" that is free as I previously explained before.

More interesting information about building SQLCipher for Windows here: http://thebugfreeblog.blogspot.fr/2012/ ... ndows.html

I believe (actually I hope) that we can find an even easier way to build SQLite with SQLCipher than the way you found (although that's enough and pretty good)
I hope that's make it clearer for us all.
Harbour | GTWVT | MingW | Visual Studio Code

User avatar
Hazael
Posts: 109
Joined: Thu Jun 24, 2010 11:37 am
Location: France

Post by Hazael »

rathinagiri wrote:Might be because HMG 3.1.1 is unicode enabled?

I have installed regional and east asian languages in my XP and it works fine.
Just an info... I tried with all the available versions of HMG to 3.0.28 and all them gave that error. It seems that has to do with SQLCipher but I am not sure... Would you please try to make new libs that we could try again and see if the error persists?

Thanks for your help.
Harbour | GTWVT | MingW | Visual Studio Code

User avatar
Hazael
Posts: 109
Joined: Thu Jun 24, 2010 11:37 am
Location: France

Post by Hazael »

Hello all,

I do not want to be insistent. I just would like to know if we will have any news, please.
Harbour | GTWVT | MingW | Visual Studio Code

User avatar
Rathinagiri
Posts: 5295
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 183 times
Been thanked: 199 times
Contact:

Post by Rathinagiri »

Hi Qatan,

Yes. Definitely.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Hazael
Posts: 109
Joined: Thu Jun 24, 2010 11:37 am
Location: France

Post by Hazael »

Hello Rathinagiri,

I have an idea. What do you think about including SQLCipher on HMG distribuition?
This way whenever you build a new distribuition you use the same "Harbour environment" to build SQLCipher lib. It would help to avoid any incompatibilities between different versions of HMG libs x Harbour libs x SQLCipher libs.
Please comment if you think it is not a good idea but please explain why so I could also get it.
Thanks
Harbour | GTWVT | MingW | Visual Studio Code

User avatar
Rathinagiri
Posts: 5295
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 183 times
Been thanked: 199 times
Contact:

Post by Rathinagiri »

I would be so happy to include SQLCipher on HMG distribution.

However, there is a small problem in this. As of now, Harbour is having the latest SQLite code. SQLCipher is not updated to that version. There is a string related error function call missing between these two versions.

So, if we want to include SQLCipher in HMG distribution we have to first eliminate the 'sqlite3' and 'hb_sqlite3' references in hmg.hbc. Then we have to include new library for SQLCipher + hb_sqlite3 (for old version renamed as hb_sqlcipher).

Whenever users want to use SQLite as such, they have to include sqlite3, hb_sqlite3 libraries manually.
Whenever users want to use SQLCipher, they have to include sqlcipher, hb_sqlcipher libraries manually.

I hope you can understand.

Now, if you want to use SQLCipher in hmg.3.1.3, you have to replace hb_sqlite3, sqlite3 with older libraries and include sqlcipher in the linking process.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Hazael
Posts: 109
Joined: Thu Jun 24, 2010 11:37 am
Location: France

Post by Hazael »

Hello Rathinagiri,

I understand because you were so kind to explain it in such a good way.
Well, I will try your solution for now but I hope we could have all updated when SQLCipher updates to latest SQLite and Harbour is updated for it.
Thanks for your help.
Harbour | GTWVT | MingW | Visual Studio Code

User avatar
Rathinagiri
Posts: 5295
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 183 times
Been thanked: 199 times
Contact:

Post by Rathinagiri »

SQLCipher new version is released and I could successfully create SQLCipher for Harbour.

Here is the compiled library. Please test it before using in live situation.
libsqlcipher.zip
(410.1 KiB) Downloaded 265 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
bpd2000
Posts: 1143
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 241 times
Been thanked: 139 times

Post by bpd2000 »

Rathinagiri wrote:SQLCipher new version is released and I could successfully create SQLCipher for Harbour.

Here is the compiled library. Please test it before using in live situation.
libsqlcipher.zip
Thank you, Rathi for sharing
BPD
Convert Dream into Reality through HMG

User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 2 times

Post by dhaine_adp »

Hello All,

Is there any one successfully converts libeay32.dll into libeay32dll.a (for HMG 3.1.5)?
My HMG-IDE Configuration Tab is look likes this:
incpaths=c:\hmg\include
libpaths=c:\hmg\lib
libs=valleylibs daleaidcommon tlUnicodeAccent hmgsqlite
libs=sqlcipher eay32
mt=yes
instpaths=
inc=no
head=native
Or perhaps I shall answer my question that libeay32.dll source code must be recompiled or do the easiest way, distribute the dll file along with the application?

The problem is when I link libsqlcipher.a and lieay32.a the application looks for libeay32.dll I am looking for a possibility of not distributing the dll file itself.

Regards,

Danny
Regards,

Danny
Manila, Philippines

Post Reply