Jump to content

Interview question ..


lampstax

Recommended Posts

Hey guys,

 

I had a job interview today and I got asked a question that has been bothering me.  I don't think I am getting the job anyways, but I want to know the answer.

 

We all know user login should be over SSL for security purposes.

 

But what if the host did not have SSL but the client do not want you to transmit the form input via plain text.  How can you do this via PHP ?

 

I was stumped.  I know you can do it via Javascript, but Javascript should never be used for security.  LOLs.

 

I've been Googling and so far I have found stuff like Zend Auth, which ultimately uses Javascript ANYWAYS.

 

Any suggestions ?

Link to comment
Share on other sites

PHP can't do anything as long as you are still in the client-side, I guess. Well you can do some JS, that is, creating hash (with keys, implied with whatever way you can think of).

 

without SSL. I don't know that much then, unless with some JS and some PHP-side corrections. Aside from that I could use Flex instead (codes are not visible, well, not directly that is). Anyway, you can do it with JS but the data sent should not be final... PHP should do some finishing touches. :)

 

Somebody can give an input about this, I might be just intersted also.

Link to comment
Share on other sites

Surely you can't. PHP is server side. For the password to be encrypted from the client it needs to be done client side. That's PHP out the window...

 

As you say, use JS, but they've asked how to with PHP!

Link to comment
Share on other sites

Surely you can't. PHP is server side. For the password to be encrypted from the client it needs to be done client side. That's PHP out the window...

 

As you say, use JS, but they've asked how to with PHP!

 

i was thinkin of the same, eheh. I think I wanna know how it was asked rather than answering the question. I think the interviewer is quite aware of that and maybe trying to get the reaction of the user and how he (if lampstax is a guy that is) would deal with the problem.

Link to comment
Share on other sites

Well, I thought it might be a trick question too.  But I just had to make sure.  I said that the only way I can think of is to have some sort of Javascript to encrypt before sending over, but you never can assume you know every trick in the book. 

 

There just might be some obscure HTTP protocol out there that would do it and some special PHP native function that you would use once in your lifetime to access said protocol.  LOL.

Link to comment
Share on other sites

Hey guys,

 

I had a job interview today and I got asked a question that has been bothering me.   I don't think I am getting the job anyways, but I want to know the answer.

 

We all know user login should be over SSL for security purposes.

 

But what if the host did not have SSL but the client do not want you to transmit the form input via plain text.   How can you do this via PHP ?

 

I was stumped.   I know you can do it via Javascript, but Javascript should never be used for security.  LOLs.

 

I've been Googling and so far I have found stuff like Zend Auth, which ultimately uses Javascript ANYWAYS.

 

Any suggestions ?

 

Switch hosts? :P

 

In all seriousness, that is a toughy.  The only thing I've thought of, off the top of my head, is to use JavaScript to hash the inputed values before they're transmitted to the server.  Like you say, that's hardly a safe/secure way of doing things, though.  Does SSH require SSL?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.