473,503 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FTP over SSL (explicit encryption)

I am looking for a pure Python secure ftp solution.
Does it exist?

I would have thought that the existence of OpenSSL
would imply "yes" but I cannot find anything.

ftplib does not seem to provide any secure services.

I know about fptutil
http://codespeak.net/mailman/listinfo/ftputil
but that does not seem to provide any secure services.
(Btw, Matt Croydon's intro is helpful for newbies:
http://postneo.com/stories/2003/01/0...ibExample.html
)

I know about M2Crypto
http://sandbox.rulemaker.net/ngps/m2/
but that requires installing SWIG and OpenSSL.
(If someone tells me they have found this trivial
under Windows, I am willing to try ... )

I would have thought that this was a common need with
a standard Python solution, so I suspect I'm overlooking
something obvious.

Hoping,
Alan Isaac
Aug 10 '05 #1
8 5221
David Isaac wrote:
I am looking for a pure Python secure ftp solution.
Does it exist? Do you want SFTP or FTP/S?
I would have thought that the existence of OpenSSL
would imply "yes" but I cannot find anything.

ftplib does not seem to provide any secure services. Indeed. If you want SFTP, just make a copy of ftplib and modify so it
will use an SSL socket instead of a normal socket. After that, only
some minor point may remain.
[...]I know about M2Crypto
http://sandbox.rulemaker.net/ngps/m2/
but that requires installing SWIG and OpenSSL.
(If someone tells me they have found this trivial
under Windows, I am willing to try ... ) I guess SFTP should work on Windows as well.
I would have thought that this was a common need with
a standard Python solution, so I suspect I'm overlooking
something obvious.

AFAIK you're not. I'm having a look at FTP/S right now. That's a little
more complicated, but it seems doable.
If I succeed, I guess I'll donate the stuff as an extension to ftplib.

--eric

Aug 10 '05 #2

"Eric Nieuwland" <er************@xs4all.nl> wrote in message
news:ma***************************************@pyt hon.org...
Do you want SFTP or FTP/S?
The latter.
I'm having a look at FTP/S right now. That's a little
more complicated, but it seems doable.
If I succeed, I guess I'll donate the stuff as an extension to ftplib.


Great!
Please post a link as soon as it is usable!

Thanks,
Alan Isaac
Aug 10 '05 #3
David Isaac wrote:
I am looking for a pure Python secure ftp solution.
Does it exist?


I recall coming across an extension package (pretty sure it wasn't pure
Python anyway, certainly not for the SSL bits) with SFTP - I think the
name was Paramiko or something like that.

-------------------------------------------------------------------------
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: an*****@bullseye.apana.org.au (pref) | Snail: PO Box 370
an*****@pcug.org.au (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia
Aug 11 '05 #4
> David Isaac wrote:
I am looking for a pure Python secure ftp solution.
Does it exist?

"Andrew MacIntyre" <an*****@bullseye.apana.org.au> wrote in message
news:ma***************************************@pyt hon.org... I recall coming across an extension package (pretty sure it wasn't pure
Python anyway, certainly not for the SSL bits) with SFTP - I think the
name was Paramiko or something like that.


Unfortunately that's SSH2 only.
It is indeed pure Python
http://www.lag.net/paramiko/
However it requires the PyCrypto module.
http://www.amk.ca/python/code/crypto

Can you briefly outline how to use this as a client
to upload and down files from a server using SFTP?

Thanks,
Alan Isaac
Aug 12 '05 #5
"Alan Isaac" <ai*****@verizon.net> wrote in message
news:CMTKe.6597$0d.5053@trnddc03...
http://www.lag.net/paramiko/
However it requires the PyCrypto module.
http://www.amk.ca/python/code/crypto

Can you briefly outline how to use this as a client
to upload and down files from a server using SFTP?

OK, the mechanics are pretty easy.

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(20)
sock.connect((hostname, port))
my_t = paramiko.Transport(sock)
my_t.connect(hostkey=None ,username=username, password=password, pkey=None)
my_chan = my_t.open_session()
my_chan.get_pty()
my_chan.invoke_shell()
my_sftp = paramiko.SFTP.from_transport(my_t)

Now my_sftp is a paramiko sftp_client.
See paramiko's sftp_client.py to see what it can do.

Alan Isaac
Aug 12 '05 #6
"Eric Nieuwland" <er************@xs4all.nl> wrote in message
news:ma***************************************@pyt hon.org...
I'm having a look at FTP/S right now. That's a little
more complicated, but it seems doable.
If I succeed, I guess I'll donate the stuff as an extension to ftplib.

Just found this:
http://trevp.net/tlslite/
I haven't even had time to try it,
but I thought you'd want to know.

Cheers,
Alan Isaac
Aug 14 '05 #7
> > http://www.lag.net/paramiko/

"Alan Isaac" <ai*****@verizon.net> wrote in message
news:S04Le.303$Rp5.100@trnddc03...
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(20)
sock.connect((hostname, port))
my_t = paramiko.Transport(sock)
my_t.connect(hostkey=None ,username=username, password=password, pkey=None) my_chan = my_t.open_session()
my_chan.get_pty()
my_chan.invoke_shell()
my_sftp = paramiko.SFTP.from_transport(my_t)

Now my_sftp is a paramiko sftp_client.
See paramiko's sftp_client.py to see what it can do.

When it rains it pours. wxSFTP
http://home.gna.org/wxsftp/
uses paramiko and provides a GUI.

Cheers,
Alan Isaac
Aug 14 '05 #8
"David Isaac" <ai*****@verizon.net> writes:
Just found this:
http://trevp.net/tlslite/
I haven't even had time to try it,
but I thought you'd want to know.


Tlslite is a very well done and promising package, but in its present
form it's not really complete. It's missing important functionality
(the ability to validate certificates) that it relies on complex 3rd
party C libraries to provide. Hopefully tlslite will be able to do
this by itself sometime soon.
Aug 14 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7123
by: Cliff | last post by:
We are trying to connect to 3 different Oracle databases using MS Access as the front-end and ODBC as the connection. The problem that we are having is that 1 of the databases requires a...
113
12184
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
7
2227
by: Alan Silver | last post by:
Hello, I am writing a page where sensitive data is collected (over SSL) and stored in a database. I have been looking at the .NET encryption classes, but am a bit confused as to which is best...
2
1524
by: Sumit Gupta | last post by:
Can anyone please tell me how to encrpt string or any kind of Data. Also the Algorithm of Compression. Any Link tutorial etc. Like : Zip or RAR Formats etc.
9
5125
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
4
4124
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
1
3066
by: =?Utf-8?B?bWljcm9ob2Y=?= | last post by:
Short version: Is there a way to configure (preferably programmatically) the max encryption strength that will be used by the framework when connecting to a particular SSL-protected web service? ...
11
5015
by: John Williams | last post by:
I've written a simple program to do XOR encryption as my first foray into understanding how encryption works. The code compiles fine, however it segmentation faults on every run. using gdb to...
22
7620
by: j1mb0jay | last post by:
I have had to create a simple string encryption program for coursework, I have completed the task and now have to do a write up on how it could be improved at a later date. If you could look...
19
3270
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.