views:

106

answers:

2

Hello,

I've been trying to find a proper way to pass some information, such as password, to my applet. Since the code is executed on the client, I don't want to put that information in clear text in the "param".

I'm using php as script to generate the web page. So, I was wondering if there was already some kind of solution/mechanism? If not, I suppose the only way would be to encrypt the password in php, pass it as a param and decrypt in the applet? My only problem would be that the way to decrypt it would be in the client applet as well. For that I suppose that someone could decompile the applet and look for it? Or is it safe enouph?

Anyway, I'm looking for a good solutions, hope there is one?

Thanks in advance.

+2  A: 

There is no secure way to do this. Any data the applet has access to the user has access to. It is quite trivial to decompile Java applets, and even obfuscators only add a little delay.

Matthew Flaschen
Thanks for confirming my thought.
AngeDeLaMort
+1  A: 

An idea:

The applet can contact the server for the password (let's say using https). Then connect to the (s)ftp server.

Note that if you're using ftp and not sftp, maybe the password is passed in clear on the network.

Anthony
You've got a point. I totally forgot about ftp authentification.
AngeDeLaMort