简体   繁体   中英

How to pass a parameter to an applet? (secure mode)

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM