Results 1 to 2 of 2

Thread: Using botan encryption

  1. #1
    Join Date
    Apr 2014
    Posts
    12
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Using botan encryption

    Hi All,

    I'm using Qt Creator 4.6.1 on Windows 10
    Based on Qt 5.10.1 (MSVC 2015, 32 bit)
    Built on May 2 2018 04:24:33
    qmake with mingw491_32

    There is a project from the web which makes use of a botanwrapper with the include Botan.pri

    The full code is quite long so not possible to post here but it is available at http://www.voidrealms.com/index.php?r=source/view&id=1 as a zip file. That all works and encrypts files but when I bring the files into my my project I get a huge number of compile errors such as those below.
    Qt Code:
    1. botan.h:9380: error: expected identifier before '(' token
    2. X942_DH_PARAMETERS = ANSI_X9_42,
    3. ^
    To copy to clipboard, switch view to plain text mode 
    and error: expected '}' before '(' token which points to the line
    Qt Code:
    1. enum Format {
    2. ANSI_X9_42,
    3. ANSI_X9_57,
    4. PKCS_3,
    5.  
    6. DSA_PARAMETERS = ANSI_X9_57,
    7. DH_PARAMETERS = ANSI_X9_42,
    8. X942_DH_PARAMETERS = ANSI_X9_42, // Error points to here
    9. PKCS3_DH_PARAMETERS = PKCS_3
    10. };
    To copy to clipboard, switch view to plain text mode 

    Also lots of errors relating to the const such as error: non-member function 'bool Botan::verify_group(Botan::RandomNumberGenerator&, bool)' cannot have cv-qualifier
    bool verify_group(RandomNumberGenerator& rng, bool strong) const;
    Which points to the code below

    Qt Code:
    1. bool verify_group(RandomNumberGenerator& rng, bool strong) const;
    To copy to clipboard, switch view to plain text mode 

    I have checked the .pro files for the includes and I have the same files setup as the project that compiles and runs on the same setup. I have the same botan.pri file included which contains
    Qt Code:
    1. win32 {
    2. DEFINES += BOTAN_TARGET_OS_IS_WINDOWS \
    3. BOTAN_TARGET_OS_HAS_LOADLIBRARY BOTAN_TARGET_OS_HAS_WIN32_GET_SYSTEMTIME \
    4. BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK BOTAN_HAS_DYNAMICALLY_LOADED_ENGINE \
    5. BOTAN_HAS_DYNAMIC_LOADER BOTAN_HAS_ENTROPY_SRC_CAPI BOTAN_HAS_ENTROPY_SRC_WIN32 \
    6. BOTAN_HAS_MUTEX_WIN32
    7.  
    8. win32-msvc* {
    9. QMAKE_CXXFLAGS += -wd4251 -wd4290 -wd4250
    10. DEFINES += BOTAN_BUILD_COMPILER_IS_MSVC BOTAN_TARGET_OS_HAS_GMTIME_S
    11. } else {
    12. QMAKE_CFLAGS += -fpermissive -finline-functions -Wno-long-long
    13. QMAKE_CXXFLAGS += -fpermissive -finline-functions -Wno-long-long
    14. }
    15. LIBS += -ladvapi32 -luser32
    16. }
    To copy to clipboard, switch view to plain text mode 
    I have read that removing the const will remove 1 or more errors but I don't understand why this is broken on the same setup that happily compiles the botan.h and runs the build and encrypts files. Could someone help with how to start to troubleshoot this. Help appreciated. Thanks in advance.

  2. #2
    Join Date
    Apr 2014
    Posts
    12
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Using botan encryption

    Thanks to Jack at StackOverflow https://stackoverflow.com/questions/...-encrypt-files the solution is to use #undef X942_DH_PARAMETERS

Similar Threads

  1. Text Encryption
    By alizadeh91 in forum General Programming
    Replies: 4
    Last Post: 12th June 2013, 13:28
  2. Encryption with Qt
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2013, 17:48
  3. Encryption with Qt
    By safknw in forum Newbie
    Replies: 7
    Last Post: 11th July 2012, 16:06
  4. Encryption api in Qt
    By safknw in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2010, 05:25
  5. need to symmetric encryption in qt app
    By FS Lover in forum Qt Programming
    Replies: 12
    Last Post: 9th March 2010, 11:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.