| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Nov 18, 2004 7:33 am Post subject: Is it a bad idea to add passwords inside the program? |
|
|
I'm working on a larger project, and in a part of the program I want to upload images to my server. I want to do this using ftp, so I will need to add the server name, username and password into variables in the program. Is this a bad idea? Is it easy to crack and find the password? Also, is there a way to check if the images selected are actually real images and not just checking the extenions? _________________
 |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Nov 18, 2004 10:07 am Post subject: |
|
|
FTP is an inherently insecure protocol anyway, since passwords are sent in clear over the Internet. The chances are your program will be stored in a safe place.
Examine the first few bytes of image files: you'll find that they all have a signature that tells what type they are, although it won't tell you if the file as a whole is valid. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Nov 18, 2004 11:51 am Post subject: |
|
|
Well, the idea is to publish the program so members on my forum can use it. That's why I need some ideas about this problem.
Been thinking about using a PHP script to handle the uploading and checking, that way it won't need a password to be sent using ftp. But for that to work and without displaying the users browser I would need the ability to use a SERVER or POST method. _________________
 |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1566
|
Posted: Thu Nov 18, 2004 4:14 pm Post subject: |
|
|
| Quote: | I want to do this using ftp, so I will need to add the server name, username and password into variables in the program. Is this a bad idea? Is it easy to crack and find the password? Also, is there a way to check if the images selected are actually real images and not just checking the extenions?
|
First question: your website will be hacked within 24 hours if you do that. Takes a very simple packet sniffer to see what data is being transfered from a computer; even some firewall will do this. Ftp sends data plain text so you are very vunerable.
Second question: possibly yes. One way is to load an image into an image container then by taking a screenshot and looking at the top/left of the image container you can see if their is any pixels colored - that will let you know that some sort of image was loaded.
I would honestly suggest using HTTP POST method with a php script, and you can check the MIME type when uploading. This would be the safest and not allow anyone to ever see your passwords and make certain only images are uploaded. |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Thu Nov 18, 2004 5:06 pm Post subject: |
|
|
Thanks for your input PGWARE.
I'm not too excperienced with the ftp protocols since all I use it for is managing the server space. But it does sound like a bad idea when you put it that way.
I think I'm gonna write a seperate small dll program in another language that will do the uploading. Purebasic has alot of great libs that supports POST  _________________
 |
|
| Back to top |
|
 |
|