Go Back  Xtreme Visual Basic Talk > Other Languages > Web Programming > Running Calculation


Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2004, 10:26 PM
Lintz's Avatar
Lintz Lintz is offline
Senior Contributor
 
Join Date: Mar 2003
Location: The 19th Hole
Posts: 989
Default Running Calculation


After a user installs my app they need to login to my site and register their copy. They enter an "ID" number then click a button to generate a registration key based on the ID the user has entered.

My question is: What is the best way to do the necessary calculation to gererate the registration key without the user being able to view the code for calculating the key. eg. Clicking View --> Source in IE.

Thanks.
Reply With Quote
  #2  
Old 08-09-2004, 11:24 PM
Random Random is offline
Contributor
 
Join Date: Oct 2003
Posts: 747
Default

Well, if the user is going to submit something to your webpage, it will be useless unless it goes to your server for either storage or processing.

A server-side script, such as PHP, ASP, etc. can process the ID given, and spit out a registration code for you. Then, the server will put together the HTML page that the user will see, and sends that to the user. No server-side code ever gets exposed to the user, provided you don't make a stupid mistake.

Other than the use of JavaScript (which I believe would be just stupid), that is the only option available to you.

Of course, if you want to use JavaScript to do this, go for your life. The problem there is that people can view the source.
Reply With Quote
  #3  
Old 08-10-2004, 12:14 AM
PWNettle PWNettle is offline
Verbose Coder

Retired Moderator
* Guru *
 
Join Date: Dec 1999
Location: Phoenix, Arizona
Posts: 3,011
Default

To elaborate or restate. As Random indicated it's most likely that your registration stuff is being handled server-side by something like asp, php, etc.

A person who views source would be seeing the html source that was created by your server-side technology (asp, php). Usually it's exceptionally difficult/impossible to view the source for the actualy asp/php/whatever. And you could go one step further (with asp/asp.net) at least and use a compiled component to do the registration logic and tap into that component from your asp - so that even if they did get the source for your server-side script they surely wouldn't be able to get at the component source (unless you have a horrifically compromised web server setup - and you'd have to go way out of your way to make yourself THAT unsecure).

Also, it's most likely that your registration stuff is stored somehow - like in a database, file, or something. I'd imagine you keep track of this stuff over time. These types of resources are also usually "hidden" from prying internet eyes, adding another layer of protection.

Paul
Reply With Quote
  #4  
Old 08-10-2004, 02:16 AM
Lintz's Avatar
Lintz Lintz is offline
Senior Contributor
 
Join Date: Mar 2003
Location: The 19th Hole
Posts: 989
Default

Thanks for the reply. As i'm new to PHP and MYSQL could someone reply to see if i'm on the right track.

After the user enters their "ID" they press a button called Generate. I then call another PHP page which contains the code for calculating the registration key and once the calculation is complete display the result?

The registration key is then saved into MYSQL database I've got set up.
Reply With Quote
  #5  
Old 08-10-2004, 02:23 AM
PWNettle PWNettle is offline
Verbose Coder

Retired Moderator
* Guru *
 
Join Date: Dec 1999
Location: Phoenix, Arizona
Posts: 3,011
Default

My comment would be that in pretty much every sign-up or registration type of scenario I've encountered in recent internet history usually the way it's done is that you submit some info about yourself or some identifying factor for a product, account, or whatever, and then the registration process sends whatever you need (registration info in your case) via email, rather than displaying it.

I'm no hacker and I'm not overly familiar with all of their ways but I think there's ways people could abuse, hack, or spoof your registration process to attempt to get registered. The email thing seems to be a good way to avoid a lot of potential problems.

So, while your setup will be somewhat secure and will hide the details of the registration implementation it could still be somewhat insecure. Depending on the nature of your website and how truly secure you want it to be you might consider emailing your computed registration info rather than displaying it.

Paul
Reply With Quote
  #6  
Old 08-10-2004, 02:32 AM
Lintz's Avatar
Lintz Lintz is offline
Senior Contributor
 
Join Date: Mar 2003
Location: The 19th Hole
Posts: 989
Default

Thanks Paul. I'll look into that option. I already have users email addresses in my database from when they signed up so I can easily email them the registration key.
Reply With Quote
  #7  
Old 08-10-2004, 06:16 AM
Random Random is offline
Contributor
 
Join Date: Oct 2003
Posts: 747
Default

Quote:
Originally Posted by PWNettle
To elaborate or restate.
Thank you.
Reply With Quote
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->