Results 1 to 6 of 6

Thread: Encryption, approach request

  1. #1
    Join Date
    Mar 2009
    Posts
    104
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Encryption, approach request

    i'm tying to make text redactor with ability to encrypt the text using for example AES128,256.
    I read that QtCrypto a 3rd party library is used to implement such algorithm.
    Are there any alternatives ?
    Any recommendations?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Encryption, approach request

    I would use libcrypto (from OpenSSL) directly especially that Qt uses it itself for SSL functionality. It's C-based but you just need a few calls to be able to use it so it's painless. I even wrote a Qt wrapper around it some time ago.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Posts
    104
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Encryption, approach request

    OpenSSL is used for network transfer encryption.What i need is completely different.i need to encrypt a plain text using AES256 algorithm

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Encryption, approach request

    Let me ask you a question: A pencil is made to write with it on papers. But could you also write with it on a wall? YES. On the floor? YES. On your pants? YES. And this although it wasn't designed for that!

    And now, can you imagine, that you can use a library, which was constructed to encrypt text for sending it over the network, only local?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Encryption, approach request

    Quote Originally Posted by unix7777 View Post
    OpenSSL is used for network transfer encryption.What i need is completely different.i need to encrypt a plain text using AES256 algorithm
    libcrypto is a cryptographic library. Period.

    BTW. Pencils don't really write on pants and they are quite lousy when writing on walls too. libcrypto is much better in doing AES encryption

    A snippet of code from my libcrypto wrapper:

    Qt Code:
    1. QByteArray result = device.readAll(); // some encrypted data
    2. QwwCipher ciph("aes-128-cbc");
    3. ciph.setKey("0123456789ABCDEF");
    4. ciph.setIv(QByteArray(16,0));
    5. ciph.setInput(&result);
    6. QFile f("/tmp/tst.txt");
    7. ciph.setOutput(&f);
    8. ciph.decryptAll();
    To copy to clipboard, switch view to plain text mode 

    BTW 2. libcrypto is doing all the PKI for SSL/TLS so it's definitely not only about transfering data over network (which it doesn't do) - something has to generate, sign and verify SSL keys and certificates, right?
    Last edited by wysota; 20th February 2010 at 16:28.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    gboelter (26th August 2010)

  7. #6
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Encryption, approach request

    Here is another very brief link (http://saju.net.in/blog/?p=36), which explains why he created this example (http://saju.net.in/code/misc/openssl_aes.c.txt).

  8. The following user says thank you to pitonyak for this useful post:

    gboelter (26th August 2010)

Similar Threads

  1. Encryption with Qt
    By safknw in forum Newbie
    Replies: 7
    Last Post: 11th July 2012, 15:06
  2. Encryption api in Qt
    By safknw in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2010, 04:25
  3. sqlite+qt+encryption
    By skrzypu in forum Qt Programming
    Replies: 4
    Last Post: 21st October 2009, 14:22
  4. Encryption and decryption
    By vermarajeev in forum General Programming
    Replies: 5
    Last Post: 27th August 2007, 21:17
  5. Qhttp::request(...) method and GET request
    By mikhailt in forum Qt Programming
    Replies: 4
    Last Post: 15th September 2006, 12:26

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.