473,396 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to hide username / password when using FTP functions

Hi,

I'm part of a 5-person team that develops websites for our company. I
need to use the ftp_* functions to find some files on another file
server. I need to authenticate to the file server using my username &
password but I don't want to have it right there in the script in plain
text.

Any suggestions?

Oct 3 '06 #1
5 4125
If the remote host has ssh access, you could setup key-based
authentication and transfer files over ssh:

http://software.newsforge.com/softwa...5/211214.shtml

You could also store the password (or a key to decrypt the password) in
a file that no one else has access to, or supply the password to the
script each time you connect to the remote site.

livefreeordie wrote:
Hi,

I'm part of a 5-person team that develops websites for our company. I
need to use the ftp_* functions to find some files on another file
server. I need to authenticate to the file server using my username &
password but I don't want to have it right there in the script in plain
text.

Any suggestions?
Oct 3 '06 #2

"livefreeordie" <jp*******@gmail.comwrote in message
news:11*********************@c28g2000cwb.googlegro ups.com...
Hi,

I'm part of a 5-person team that develops websites for our company. I
need to use the ftp_* functions to find some files on another file
server. I need to authenticate to the file server using my username &
password but I don't want to have it right there in the script in plain
text.

Any suggestions?
if you are trying to hide from your team members then best to take input
from a form and feed those to your script
making an include to another file with the passwords etc won't help if the
perople you are hiding this info from have access to the same directories.
Oct 3 '06 #3
livefreeordie wrote:
Hi,

I'm part of a 5-person team that develops websites for our company. I
need to use the ftp_* functions to find some files on another file
server. I need to authenticate to the file server using my username &
password but I don't want to have it right there in the script in plain
text.

Any suggestions?
Encrypt the password and decrypt it just before sending it. Not really
safe; if someone else has access to the encrypted password and the
decrypt code they can easily decrypt it.

Or you could force the user to enter it in a browser.

But there's not a lot you can do to protect passwords when others have
access to the source code, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 3 '06 #4
Zebrawszy mysli livefreeordie <jp*******@gmail.comwyklepal:
Any suggestions?
ofc :)

hi, you can store it in plain text, no problem (ofc if some1 has a time he
can broke it but perhaps it will be waste of time)
1. make your own pass for example: $pass = test
2. use js or php function and do that action:

$encryptedPassword = 1;

for($i = 0; $i < strlen($pass); $i++)
$encryptedPassword *= ord($pass[$i]);

3. you will have big nuber (ofc if you will use more then 3 letters in
password :) )
4. put this number into your file and make form - only password of if you
want pass and username too
5. use same function to convert post data to number
6. try to compare stored password with that what you will have from post

OFC you have to make your passord offline and put it like a CONST or other
static variable in your file

have fun :)
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ikciu | gg: 718845 | www: www.e-irsa.pl

2be || !2be $this =mysql_query();
Oct 3 '06 #5
Johnny wrote:
"livefreeordie" <jp*******@gmail.comwrote in message
news:11*********************@c28g2000cwb.googlegro ups.com...
Hi,

I'm part of a 5-person team that develops websites for our company. I
need to use the ftp_* functions to find some files on another file
server. I need to authenticate to the file server using my username &
password but I don't want to have it right there in the script in plain
text.

Any suggestions?

if you are trying to hide from your team members then best to take input
from a form and feed those to your script.
Well this is part of a tool that is run by the user community - it just
access files on another server. I really don't want to make each user
enter another username and password - I want to just use my own
credentials.
making an include to another file with the passwords etc won't help if the
perople you are hiding this info from have access to the same directories.
Exactly. I've temporarily solved the problem by making the include
file owned by user 'nobody' - under which the web server runs, and
changing the mods to 600 . I have sudo privs to do this -
unfortunately so do other people on the team - so if they really wanted
to , they could get at my pwd. But I'm not entirely sure they would
know how. ;)

We're moving to a new server where the Apache will run under a
dedicated username. When we do that, I can just use its own username &
password since it's known among our web team anyway.

Oct 9 '06 #6

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

Similar topics

3
by: Oren | last post by:
Hi, Is there a way to hide the connection information of linked SQL Server tables from users? It's easy to open a system table and find the connection info, and if the username and password are...
12
by: Sharon | last post by:
I wrote an assembly in C#/.NET that includes some personal information. But this information can be revealed by opening the assembly in tools like the ‘Microsoft .NET Framework IL DASM’ and...
0
by: Kirk | last post by:
The following C# web service works fine until you uncomment the lines setting UserName and Password. Then, Process.Start throws an Access is Denied Exception. This is with .NET 2.0, of course...
2
by: K B | last post by:
Hi, Is there ANY WAY to hide a row/field in a DetailsView based on meeting a condition at the ItemCreated or ModeChanging event -- or any other way? There appears not to be, but I was hoping for...
5
by: libra786 | last post by:
I have created a blog and have added a login box which prompts the user for login and id before posting- The username and password have been stored in the database, however when i enter the username...
3
by: Minkle555 | last post by:
Hi, i am trying to create a program that needs to be logged into before you can access the functions. The user currently has to enter a username and password. However, if they would like change...
7
by: cefrancke | last post by:
I have a few tables with sensitive user information (passwords, etc.) and I would like to prevent someone from opening a blank database and importing those tables. Is there a way to "hide" or...
8
by: Elliot | last post by:
My codes contain several URLs which are supposed to be not disclosed. As some programs such as Luxx Roxxxx's .NET Reflector can 'disclose' my codes almost completely. Any suggestion to 'hide'...
2
by: ziycon | last post by:
This function is in a class file, can't get the frmLogin form to hide when a user logins in, the frmMain will open fine though!??? public void login(string username,string password) { ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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,...

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.