User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 373,936 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,724 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 269 | Replies: 3 | Solved
Reply
Join Date: Mar 2007
Location: RI
Posts: 146
Reputation: Dsiembab is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
Dsiembab's Avatar
Dsiembab Dsiembab is offline Offline
Junior Poster

another question about securing and passing variables

  #1  
Mar 27th, 2008
Good afternoon,
Quick question, this may not make any sense but it is a thought, I was thinking, like I usually like to do, when you pass variables over a browser would it be crazy to md5 hash and salt the variables id and keep them in a db table and md5 hash the equal sign too. what I mean is instead of
http:www.mywebsite.com/authenticate.php?user=username&pass=password
you could get something like this
http:www.mywebsite.com/authenticate.php?151f151f15615f16054f6515165fv16ds1g1s1f6s151g151681f5d16
before this is implemented though you could make the "=" sign equal to a alphanumeric like k3 or something and md5 pass and user with a salt and add an array to the subsequent hash like putting a set of letters or numbers in the string at certain positions. therefore you would have the original hash of dgdf5fd54f6dg654dfg1f1d8fd1fd1g68df11fd1fd1618e161g61fd61d651d6f16df1f but lets say at a certain amount of digits you put your broken up array like at the third digit you put a 2 or an f and at the fifth you put a 6 depending on how many equal signs you have you could subtract the equal signs from 32 and add that many digits to the incoming variable so if anyone tries to break your variable dividing it by 32 digits they would not be able to come up with a formula. so for every id and value you would have 32 digits plus the (equal variable - 32=variable)variable. which would make an ugly get or post. on the input side you would have the encryption and on the logic side the decryption.
  • the user goes to your website
  • enters the authentication method ie username and password
  • the php takes the username and password takes the URL that is going to be sent and finds the ids and the values.
  • md5's the ids, the username and the passwords with the salt
  • puts in the php defined salt array minus the equal signs which is an alpha numerical two digit
  • this gets sent over to the authenticate php
  • the php desalts the post or get
  • passes the variables to the database
  • decides if OK or otherwise
I don't know does this make any sense I'm just thinking about it. You can thank live http headers for this thought.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: another question about securing and passing variables

  #2  
Mar 27th, 2008
Instead of using $_GET variables use $_POST. Any such transaction should be over a secure SSL connection. I don't see any reason to be passing username and password at all other than a login page. Once logged in, you should be using $user_id which would be registered in $_SESSION or $_COOKIE.


Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Reply With Quote  
Join Date: Mar 2007
Location: RI
Posts: 146
Reputation: Dsiembab is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
Dsiembab's Avatar
Dsiembab Dsiembab is offline Offline
Junior Poster

Re: another question about securing and passing variables

  #3  
Mar 28th, 2008
thanks for the reply. I should have asked is their a way to still keep your variables secure without a ssl? or openssl? more of a way to encrypt passing variables with a homemade formula kind of like a md5 of time (to the 10 minute mark) that is salted in the encrypted variable?with the page of decryption above the web root? of course with the equal sign keyed to a an array that was based on the time of the query.
Last edited by Dsiembab : Mar 28th, 2008 at 3:46 am.
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: another question about securing and passing variables

  #4  
Mar 28th, 2008
No, its not possible without SSL, since the communication between the user's browser and the web server can be intercepted. SSL is very cheap these days, with most hosts providing a free shared cert. if your budget is really tight.


Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:30 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC