×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    15

    QT/symbian encryption

    My problem is that I need to encrypt the data in my apps database.
    I succesfully managed to compile the sqlcipher for Qt, but I cannot use it in symbian devices. I think that I need to port the sqlcipher to QT/Symbian, but this will take me more time that I have.
    So I decided to encrypt all the rows in the database (this is slower, but is the only solution I can think), but I don't know how to do it. I was reading that I need to recompile OpenSSL for symbian devices in order to encrypt/decrypt the data.
    There is another way to do this? There is a QT/symbian library to encrypt /decrypt data?

    Thanks

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    There is built-in encryption in Symbian. See http://wiki.forum.nokia.com/index.ph...ptography_APIs

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    15

    Re: QT/symbian encryption

    Thanks for the quick response.
    I've downloaded and installed the SymbianCryptographyLibraries but I cannot make it work in Qt Creator.
    I tried this http://discussion.forum.nokia.com/fo...N-cryptography , but it gives me "cannot find -lcryptography" error.
    Is there any SymbianCryptographyLibraries / Qt Creator integration guide? I was looking, but with no luck.

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    Did you add "LIBS += -lcryptography" to your .pro file?

    There's no info that I know of specifically about using the Symbian crypto lib in Qt.

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    PS: I wouldn't trust the code from that post, other than as a crude example. Blind leading the blind sort of thing.

  6. #6
    Registered User
    Join Date
    Nov 2010
    Posts
    15

    Re: QT/symbian encryption

    Quote Originally Posted by danhicksbyron View Post
    Did you add "LIBS += -lcryptography" to your .pro file?

    There's no info that I know of specifically about using the Symbian crypto lib in Qt.
    yes, i added it, but i don't have the cryptosymmetric.h or cryptopadding.h files. I already downloaded and installed the SymbianCryptographyLibraries .
    Or maybe the headers has another names? I don't know...

  7. #7
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    Those .h files should have been installed in epoc32/include.

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: QT/symbian encryption

    There are multiple crypto algorithm implementations in Symbian devices - where were you reading that you need to re-compile OpenSSL for Symbian? OpenSSL is part of OpenC which is present everywhere Qt is on Symbian.
    http://library.forum.nokia.com/index...html/main.html

    Check the documentation - you should find the libraries you need are there already without any extra zip file. (There are reasons to prefer the native Symbian crypto libraries but in this case I doubt they're particularly valid).

    P.S. Given that you don't need to port OpenSSL and just the core of sqlcipher - if you're still interested in adding that it might be worth talking to Chris Dudding (trying firstname.lastname@nokia.com format should work there) who's team maintains SQLite on Symbian, which is after all still open source.

  9. #9
    Registered User
    Join Date
    Nov 2010
    Posts
    15

    Re: QT/symbian encryption

    Quote Originally Posted by danhicksbyron View Post
    Those .h files should have been installed in epoc32/include.
    I'm using the Nokia Qt SDK, and in the D:\NokiaQtSDK\Symbian\SDK\epoc32\include directory the only .h files that starts with cry*.* are cryptopanic.h and cryptotokenregistryinfo.rh :s

    Quote Originally Posted by Sorcery-ltd View Post
    There are multiple crypto algorithm implementations in Symbian devices - where were you reading that you need to re-compile OpenSSL for Symbian? OpenSSL is part of OpenC which is present everywhere Qt is on Symbian.
    http://library.forum.nokia.com/index...html/main.html

    Check the documentation - you should find the libraries you need are there already without any extra zip file. (There are reasons to prefer the native Symbian crypto libraries but in this case I doubt they're particularly valid).

    P.S. Given that you don't need to port OpenSSL and just the core of sqlcipher - if you're still interested in adding that it might be worth talking to Chris Dudding (trying firstname.lastname@nokia.com format should work there) who's team maintains SQLite on Symbian, which is after all still open source.
    I've been looking the docs you say, but I cannot make it work in Qt Creator.

  10. #10
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    When you install the crypto package EXE it installs those files in what you tell it is the Symbian SDK. If you told it wrong it may have installed them somewhere else. (IIRC the install package is unclear on that point.)

  11. #11
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: QT/symbian encryption

    I've been looking the docs you say, but I cannot make it work in Qt Creator.
    Include headers for OpenSSL are in this path in your Nokia Qt SDK (assuming default install path):
    C:\NokiaQtSDK\Symbian\SDK\epoc32\include\stdapis\openssl
    You probably need to add it as an include path.
    You should just be able to add libcrypto like any other library.

  12. #12
    Registered User
    Join Date
    Nov 2010
    Posts
    15

    Re: QT/symbian encryption

    ok, trying to make some crypt algorithm work, I create a blank project

    Crypt03.pro

    Code:
    QT       += core gui 
    
    TARGET = Crypt03
    TEMPLATE = app
    
    
    SOURCES += main.cpp
    
    HEADERS  += 
    
    CONFIG += mobility
    MOBILITY = 
    
    
    symbian {
        TARGET.UID3 = 0xeaaf2ed4
        # TARGET.CAPABILITY += 
        TARGET.EPOCSTACKSIZE = 0x14000
        TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }
    
    
    LIBS += -lcrypto
    
    INCLUDEPATH += d:\NokiaQtSDK\Symbian\SDK\epoc32
    INCLUDEPATH += d:\NokiaQtSDK\Symbian\SDK\epoc32\include
    INCLUDEPATH += d:\NokiaQtSDK\Symbian\SDK\epoc32\include\stdapis
    main.cpp

    Code:
    #include <crypt.h>
    
    int main(int argc, char *argv[])
    {
    	
    	return 0;
    }

    But the compiler throws the following error


    Code:
    In file included from ..\Crypt03\main.cpp:6:
    
    ..\..\..\NokiaQtSDK\Symbian\SDK\epoc32\include\stdapis/crypt.h:46: error: 'u_long' has not been declared
    
    mingw32-make[1]: *** [debug/main.o] Error 1
    
    mingw32-make: *** [debug] Error 2
    
    The process "D:/NokiaQtSDK/mingw/bin/mingw32-make.exe" exited with code %2.
    Error while building project Crypt03 (target: Qt Simulator)
    When executing build step 'Make'

    What i'm doing wrong?

  13. #13
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    Likely the includes assume the C vs C++ compile environment. You may need to write a small C module that includes crypt.h and "exports" interfaces you can use from C++. And, of course, on the C++ side you need to use 'extern "C"' to define or reference C-side symbols.

  14. #14
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: QT/symbian encryption

    I'm not sure this is the problem... u_long isn't defined in C either - more likely a typedef is missing, either from another include file (that wasn't found or is supplied as part of the toolchain).

    I note the mingw environment for the compile attempt here - note that once you start adding includes and libraries from the Symbian-specific part of the SDK your project won't build for the Qt Simulator (unless you use appropriate conditionals in the .pro and source files to make sure they're only used in Symbian-specific builds).

  15. #15
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QT/symbian encryption

    All I know is that when I was porting SqlCipher I ran into this problem and found I needed to "play" with what was compiled as C and what as C++.

    I suspect it has to do with deeply-buried #ifdefs.

Similar Threads

  1. Can I do call encryption using Symbian C++
    By girishvmx in forum Symbian
    Replies: 15
    Last Post: 2011-08-25, 04:07
  2. multiplatform encryption (symbian and windows)
    By sign8th in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2010-01-25, 12:05
  3. AES encryption for symbian 7.0
    By AndySH in forum Symbian
    Replies: 3
    Last Post: 2009-05-18, 15:17
  4. encryption tools for symbian os
    By jebeng in forum Symbian
    Replies: 2
    Last Post: 2007-09-23, 05:43
  5. Encryption Algorithm in Symbian
    By er_gps212 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2005-10-18, 11:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×