开发者

Secure file upload with Qt

开发者 https://www.devze.com 2023-02-08 09:30 出处:网络
I\'m in the process of creating a utility to backup user\'s media files. The media isn\'t being shared etc its only a backup utility.

I'm in the process of creating a utility to backup user's media files. The media isn't being shared etc its only a backup utility.

I'm trying to think of the best way to protect users from ISPs accusing them of downloading illegal media files by using some sort of secure connection.

The utility is written in C++ using the Qt lib and so far I've only been able to find the QtSslSocket component for secure connections. The domain already has a valid SSL certificate for the next few years.

Can anyone suggest the best way to go about implementing this from both the server and client side. i.e what does the server need to have in place and is there anything in particular the backup utility needs to implement from the client side to ensure secure transactions?

Are there any known, stable sftp or ftps servers available etc?

As far as I know, Qt doesn't have support for secure FTP transfers. Not sure what other info. would be useful to make开发者_开发技巧 the question any clearer but any advice or help pointing me in the right direction will be most welcomed.

EDIT I'm also Java competent so a Java solution will work just as well...


As Martin wrote, you can wrap client. But if you don't want to do that, you can use libssh.


I searched for some sort of solution to this for a couple days and then forgot about the problem. Then today I stumbled across this little gem in the Qt-Creator source Utils::ssh, includes support for SFTP, plain-old SSH, and all sorts of goodies.

Disentangling stuff from Qt-Creator can be a pain, but having gone through this process it amounts to grabbing Botan (one of the other libs in QT-Creator) + Utils.

When it rains, it pours, I find two solutions to this problem in an hour - http://nullget.sourceforge.net/ (Requires Chinese translation), but from their summary:

NullGet is written with Qt, runs on multiple platforms, the GUI interface of the multi-threaded multi-protocol HTTP download software. Use NullGet can easily download a variety of network protocol data stream, faster download speeds, support for HTTP, the protocol currently supported are: HTTP, HTTPS, FTP, MMS, RTSP. And it can run on most current popular operating systems including Windows, Linux, FreeBSD and so on.


Easiest way would be to just wrap a commandline sftp client with a Qt front end.

On the server any ftp server should do sftp pretty much out of the box.


As Synthesizerpatel says Qt Creator implements SFTP. So I have isolated the library that contains SSH and SFTP and I have created a new project named QSsh in Github (https://github.com/lvklabs/QSsh). The aim of the project is to provide SSH and SFTP support for any Qt Application.

I have written an example on how to upload a file using SFTP in examples/SecureUploader/

I hope it might be helpful

0

精彩评论

暂无评论...
验证码 换一张
取 消