A
Andrew Poulos
I've built a javascript driven quiz. Given that client-side scripting is
not secure, is there a way to "obscure" answers so that they are
unavailable to the casual viewer? For example, If I have an external js
answer file with this in it:
quest["01"] = [true,false,false,false,false];
is there a way to "obscure" the value but still allow js to reveal it.
What I'm looking for, I guess, is some algorithm that works like this:
// Massage the answers
// set real value
quest["01"] = [true,false,false,false,false];
fObscure = function(oldVal) {
// do something
return newVal
}
quest["01"] = fObscure( quest["01"] );
// returns, say, 'qwerty' and this is the value I put into the
// js file that gets downloaded
// Then in the quiz
fReveal = function(newVal) {
// do something
return oldVal
}
quest["01"] = fReveal( quest["01"] );
// returns [true,false,false,false,false];
I've tried a few ways but I'm having trouble with the different data types.
Again it doesn't matter that I'm providing the key with the lock, it's
just the casual viewer I'm holding at bay. If they are clever,
persistent, or lucky enough to get the answers then "long life to them".
Andrew Poulos
not secure, is there a way to "obscure" answers so that they are
unavailable to the casual viewer? For example, If I have an external js
answer file with this in it:
quest["01"] = [true,false,false,false,false];
is there a way to "obscure" the value but still allow js to reveal it.
What I'm looking for, I guess, is some algorithm that works like this:
// Massage the answers
// set real value
quest["01"] = [true,false,false,false,false];
fObscure = function(oldVal) {
// do something
return newVal
}
quest["01"] = fObscure( quest["01"] );
// returns, say, 'qwerty' and this is the value I put into the
// js file that gets downloaded
// Then in the quiz
fReveal = function(newVal) {
// do something
return oldVal
}
quest["01"] = fReveal( quest["01"] );
// returns [true,false,false,false,false];
I've tried a few ways but I'm having trouble with the different data types.
Again it doesn't matter that I'm providing the key with the lock, it's
just the casual viewer I'm holding at bay. If they are clever,
persistent, or lucky enough to get the answers then "long life to them".
Andrew Poulos