Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- hide information from the view "source"
October 14, 2009, 6:00 pm
rate this thread
It is the problem with my entire Perl code; I wrote the Perl script to
retrieve the questions and answers from the database. It is possible
that the user can view "source" and retrieve the questions and answer
from the "view source" which is the pain html. At this point, I want
to convert my program into Java Applet, it is solve the problems. But,
before I do that, I hope that anyone here can give me some hint to
solve my problem.
Re: hide information from the view "source"
I am assuming that you are talking about a web application (you didn't
say), using CGI (you didn't say), where your Perl code creates an HTTP
response aka web page.
And the problem is (you didn't say) that you coded all questions and
answers into that single HTTP response object and thus a user can see
them when reading the HTTP response directly ("View Source").
You do not have a Perl problem. You would have exactly the same problem
no matter which programming language you had chosen to write the CGI
Also you do not have a CGI or programming problem in general, either.
Your problem is caused by a poor design of your system.
The solution is very simple: don't do that. Do not code all questions
and answers into the HTTP response. Instead do round-trips to the web
server for each answer and check the answer server-side only. Yes, that
does increase traffic quite a bit. Yes, it does introduce potentially
significant delays for each round-trip. But is the only way to not hand
out all questions and answers to the user because as soon as you send
them the user can read them one way or the other.
Or you might try to encode/encrypt the data and have some client-side
process to decode it. That may deter the casual user, but it won't stop
a dedicated cracker because after all he is supposed to see the data in
clear text eventually, therefore you cannot block access to it totally.