Re: Hide source code
Ira Baxter wrote:[color=blue]
> Richard Cornford wrote:[/color]
<snip>[color=blue]
> Sure. I repeat, once again that obfuscation (and any kind of
> "protection ") offers NO GUARANTEES. Obfuscation simply
> provides a level of defense that requires effort on the part of
> a thief.[/color]
If I go to google groups and view this thread google's clever
advertising software notices the subject and puts up an advert that
reads:-
<quote cite=" www.semanticdesigns.com advertisement on
groups.google.c om, 2005-05-06">
Protect JavaScript code
Prevent reverse engineering scripts
Works with HTML, XML, ASP, JSP, PHP
</quote>
While it may be argued that "protection " is a relative term, "prevent"
certainly is not. You either can prevent reverse engineering or you can
not, and you can not. If even you are admitting that your company's own
advertising if making a false statement you can hardly be surprised if
we find your vested interest and repeated baseless assertions highly
suspect.
[color=blue]
> Once the economics from the theif's point of view
> are poor, you've won.[/color]
Economics? How do the economics pan out when you spend money on software
that claims to "prevent reverse engineering" but does no such thing?
Haven't you lost before the game has even started?
[color=blue]
> Reformatting isn't particularly hard, granted.[/color]
A few seconds exposing the code to suitable re-formatting software.
[color=blue]
> Nontheless, the results still look scary (even if they
> aren't in a technical sense), and that chases off some
> of the potential thieves. No, don't repeat your argument
> about chasing off only dumb theives, we've all heard it.
> Chasing off dumb theives is still valuable, and this isn't
> the only defense.[/color]
Why not repeat it, you appear to have missed the point. Which is that
these "dumb thieves" are not thieves at all. They may want to be
thieves, they may have an intention to steal, but if they are not
capable of comprehending the source code they intend to steal, even in
its original form, they cannot do anything with it. So they are just
people who download scripts from the internet, and are no more harmful
than anyone else who visits a web page and downloads its accompanying
scripts as part of the process.
Being in possession of copyrighted script source code is not theft (else
every Internet user would be a thief), to be a thief the culprit must do
something with that script (without the permission of the copyright
holder). And with a non-trivial script they must understand it in order
to do something with it. (And to reverse engineer it they certainly are
going to need to fully comprehend it).
So I repeat: effort and expense would be squandered in pursuit of
protection against "dumb thieves".
<snip>[color=blue][color=green]
>> You are yet to get a single regular
>> contributor to this group to agree with it.[/color]
>
> I doubt if my customers want to spend a lot of
> time in this kind of discussion.[/color]
And I doubt you want your customers to be aware that the issue is
debated at all. Which makes me wonder why you persist in trying to
promoting you dubious product on comp.lang.javas cirpt at all.
[color=blue]
> There have been several other defenders of
> the utility of obfuscation involved in these
> threads (Matt Kruse in this one).[/color]
Matt's comments hardly represented a defence of obfuscates (though that
may have been his intention, it's difficult to tell).
[color=blue]
> I don't know if he is a "regular contributor",[/color]
No, not in any sense.
[color=blue]
> and I don't see why "regular
> contributor" should carry specific weight.[/color]
Surprising as you may find the notion, regular contributors to technical
Usenet newsgroups represent considerable expertise in the group's
subject. They have little choice because Usenet is traditionally a harsh
and critical environment, so if you hang around contributing to these
groups for any length of time you either have the expertise to start
with, or pick it up pretty quickly, because errors mistakes and
misconceptions will be pointed out, very publicly. And any contributor
to this group reads 30,000+ posts per year, exposing themselves to a
range of knowledge, options, problems, situations and questions that
they could not experience in a single work situation.
So the opinions of regular contributors matter because if you cannot
persuade any of the experts in a subject that a particular cause of
action is a good idea (by reasoned argument, demonstration or even
rhetoric) then it probably isn't a good idea. And being able to persuade
any number of people who don't know any better that it is a good idea
doesn't change that.
[color=blue]
> We all have our opinions.[/color]
And we all get to weight the opinions of others and consider there real
worth.
[color=blue]
> Reasoned dicussions seem fine.[/color]
"We all have our opinions": reasoned discussion, or the last defence of
a position that has been demonstrated as untenable?
<snip>[color=blue][color=green][color=darkred]
>>> ... . You obfuscate the code
>>> just before you go live with it in production,[/color][/color]
>[color=green]
>> You absolutely do not obfuscate code just before you go
>> live with it. ...[/color][/color]
<snip>[color=blue]
>
> Yes, the way I stated could be interpreted as
> "obuscate-then-ship-in-2-nanoseconds".[/color]
You are exaggerating my interpretation of "just before", but that is
basically what you wrote.
[color=blue]
> I meant it in "do your development, then finish up your
> usual way (including test if you have any sense), and
> then ship."[/color]
So this time the code never gets obfuscated? Why don't you just write
down how the obfuscation stage should be integrated into development?
Perhaps because doing so would make it obvious that Douglas Crockford's
"It will increase development costs" hit the nail on the head.
[color=blue]
> If you didn't have your own point of view to push,
> I think you reasonably might have interpreted this
> a bit more loosely.[/color]
I read a proposal that lies somewhere between a bad idea and
catastrophicall y harmful and you want me to let it propagate around the
world uncommented?
[color=blue]
> We're not trying to prove theorems here.[/color]
But we may be trying to refute one.
[color=blue][color=green]
>> Of course it is possible that semdesigns.com don't do QA
>> so you don't realise the need for this.[/color]
>
> Yes, it is *possible*. It is *possible* you are an axe
> murderer. Then again, perhaps we actually do QA, and you
> are not. Ad hominem attacks don't contribute to this
> discussion.[/color]
If you propose a cause of actions that is self evidently stupid I don't
see why I shouldn't speculate on the reasons that prevent you from
seeing that it was a stupid suggestion, or seeing the stupidity propose
it anyway.
(Oh, and sensible behaviour for axe murderers is never to admit it, or
comment upon it, in public ;)
[color=blue][color=green]
>> The premise that identifier names need to be meaningful for
>> code to be understood is utterly wrong.[/color]
>
> For small codes, sure. For larger codes... almost everybody
> on the planet agrees that maintaining somebody else's code
> is difficult; see any software engineering textbook.
> The usual recommendation is that an engineer(!) design carefully,
> code carefully, choose meaningful names, and document it all.[/color]
Yes, meaningful identifier names, in the readers native language (or a
language in which they are fluent) make life easier. And good
documentation also helps a great deal, but our prospective thief was
never going to get access to the documentation anyway.
[color=blue]
> The usual practice seems much worse, and almost all
> maintenance is based on reading the existing code and
> praying the last guy at least used sensible names.[/color]
The usual practice is worse, the code is badly and inconstantly
formatted, the original author was French, or German, or Indian, and
identifier names that are in English don't quite correspond with their
conceptual role in the program, or are personal abbreviations, or
whatever. And yet we cope. We cope because while meaningful identifier
names are obviously helpful they are ultimately arbitrary; distinct
slots into which values are placed. In the perception of an experienced
programmer an identifier name that conveys no additional meaning is in
no way a barrier to understanding the behaviour of the code that uses
it. If it were how would anyone cope with assembly language programming?
[color=blue]
> If he hasn't done that, then
> working out what the code
> does tends to be much harder.[/color]
You cannot persuade any javascript experts that there is any value in
obfuscation by saying "much harder" and "looks scary" because that is
not their perception of the situation. You can mangle the identifier
names any way you like but whatever you do they must remain distinct.
That distinctness is all the experienced programmer needs, and so the
results will only be _slightly_ harder to undersigned than they would
have been before. And it won't "look scary" at all, because those
meaningless identifier names are surrounded by self-evident operators,
expressions, statements, function calls, DOM property accessors, etc,
etc (and all syntax highlighted to exaggerate their role in the code).
It is an open book once you know how to read it.
You may perceive that transformation as rendering code much harder to
comprehend and looking impressively scary, and there may be many
thousands (even hundreds of thousands) of others with a similar
perception, but they were never a threat to start with. The threat comes
(and always will come) from individuals who are not at all put off by a
task that has been rendered just slightly harder.
There is a reason that ex-hackers (in the 'breaking into computer
systems' sense) easily find legitimate employment as network security
experts; sensible people seek the opinions of those who understand the
reality.
Richard.
Ira Baxter wrote:[color=blue]
> Richard Cornford wrote:[/color]
<snip>[color=blue]
> Sure. I repeat, once again that obfuscation (and any kind of
> "protection ") offers NO GUARANTEES. Obfuscation simply
> provides a level of defense that requires effort on the part of
> a thief.[/color]
If I go to google groups and view this thread google's clever
advertising software notices the subject and puts up an advert that
reads:-
<quote cite=" www.semanticdesigns.com advertisement on
groups.google.c om, 2005-05-06">
Protect JavaScript code
Prevent reverse engineering scripts
Works with HTML, XML, ASP, JSP, PHP
</quote>
While it may be argued that "protection " is a relative term, "prevent"
certainly is not. You either can prevent reverse engineering or you can
not, and you can not. If even you are admitting that your company's own
advertising if making a false statement you can hardly be surprised if
we find your vested interest and repeated baseless assertions highly
suspect.
[color=blue]
> Once the economics from the theif's point of view
> are poor, you've won.[/color]
Economics? How do the economics pan out when you spend money on software
that claims to "prevent reverse engineering" but does no such thing?
Haven't you lost before the game has even started?
[color=blue]
> Reformatting isn't particularly hard, granted.[/color]
A few seconds exposing the code to suitable re-formatting software.
[color=blue]
> Nontheless, the results still look scary (even if they
> aren't in a technical sense), and that chases off some
> of the potential thieves. No, don't repeat your argument
> about chasing off only dumb theives, we've all heard it.
> Chasing off dumb theives is still valuable, and this isn't
> the only defense.[/color]
Why not repeat it, you appear to have missed the point. Which is that
these "dumb thieves" are not thieves at all. They may want to be
thieves, they may have an intention to steal, but if they are not
capable of comprehending the source code they intend to steal, even in
its original form, they cannot do anything with it. So they are just
people who download scripts from the internet, and are no more harmful
than anyone else who visits a web page and downloads its accompanying
scripts as part of the process.
Being in possession of copyrighted script source code is not theft (else
every Internet user would be a thief), to be a thief the culprit must do
something with that script (without the permission of the copyright
holder). And with a non-trivial script they must understand it in order
to do something with it. (And to reverse engineer it they certainly are
going to need to fully comprehend it).
So I repeat: effort and expense would be squandered in pursuit of
protection against "dumb thieves".
<snip>[color=blue][color=green]
>> You are yet to get a single regular
>> contributor to this group to agree with it.[/color]
>
> I doubt if my customers want to spend a lot of
> time in this kind of discussion.[/color]
And I doubt you want your customers to be aware that the issue is
debated at all. Which makes me wonder why you persist in trying to
promoting you dubious product on comp.lang.javas cirpt at all.
[color=blue]
> There have been several other defenders of
> the utility of obfuscation involved in these
> threads (Matt Kruse in this one).[/color]
Matt's comments hardly represented a defence of obfuscates (though that
may have been his intention, it's difficult to tell).
[color=blue]
> I don't know if he is a "regular contributor",[/color]
No, not in any sense.
[color=blue]
> and I don't see why "regular
> contributor" should carry specific weight.[/color]
Surprising as you may find the notion, regular contributors to technical
Usenet newsgroups represent considerable expertise in the group's
subject. They have little choice because Usenet is traditionally a harsh
and critical environment, so if you hang around contributing to these
groups for any length of time you either have the expertise to start
with, or pick it up pretty quickly, because errors mistakes and
misconceptions will be pointed out, very publicly. And any contributor
to this group reads 30,000+ posts per year, exposing themselves to a
range of knowledge, options, problems, situations and questions that
they could not experience in a single work situation.
So the opinions of regular contributors matter because if you cannot
persuade any of the experts in a subject that a particular cause of
action is a good idea (by reasoned argument, demonstration or even
rhetoric) then it probably isn't a good idea. And being able to persuade
any number of people who don't know any better that it is a good idea
doesn't change that.
[color=blue]
> We all have our opinions.[/color]
And we all get to weight the opinions of others and consider there real
worth.
[color=blue]
> Reasoned dicussions seem fine.[/color]
"We all have our opinions": reasoned discussion, or the last defence of
a position that has been demonstrated as untenable?
<snip>[color=blue][color=green][color=darkred]
>>> ... . You obfuscate the code
>>> just before you go live with it in production,[/color][/color]
>[color=green]
>> You absolutely do not obfuscate code just before you go
>> live with it. ...[/color][/color]
<snip>[color=blue]
>
> Yes, the way I stated could be interpreted as
> "obuscate-then-ship-in-2-nanoseconds".[/color]
You are exaggerating my interpretation of "just before", but that is
basically what you wrote.
[color=blue]
> I meant it in "do your development, then finish up your
> usual way (including test if you have any sense), and
> then ship."[/color]
So this time the code never gets obfuscated? Why don't you just write
down how the obfuscation stage should be integrated into development?
Perhaps because doing so would make it obvious that Douglas Crockford's
"It will increase development costs" hit the nail on the head.
[color=blue]
> If you didn't have your own point of view to push,
> I think you reasonably might have interpreted this
> a bit more loosely.[/color]
I read a proposal that lies somewhere between a bad idea and
catastrophicall y harmful and you want me to let it propagate around the
world uncommented?
[color=blue]
> We're not trying to prove theorems here.[/color]
But we may be trying to refute one.
[color=blue][color=green]
>> Of course it is possible that semdesigns.com don't do QA
>> so you don't realise the need for this.[/color]
>
> Yes, it is *possible*. It is *possible* you are an axe
> murderer. Then again, perhaps we actually do QA, and you
> are not. Ad hominem attacks don't contribute to this
> discussion.[/color]
If you propose a cause of actions that is self evidently stupid I don't
see why I shouldn't speculate on the reasons that prevent you from
seeing that it was a stupid suggestion, or seeing the stupidity propose
it anyway.
(Oh, and sensible behaviour for axe murderers is never to admit it, or
comment upon it, in public ;)
[color=blue][color=green]
>> The premise that identifier names need to be meaningful for
>> code to be understood is utterly wrong.[/color]
>
> For small codes, sure. For larger codes... almost everybody
> on the planet agrees that maintaining somebody else's code
> is difficult; see any software engineering textbook.
> The usual recommendation is that an engineer(!) design carefully,
> code carefully, choose meaningful names, and document it all.[/color]
Yes, meaningful identifier names, in the readers native language (or a
language in which they are fluent) make life easier. And good
documentation also helps a great deal, but our prospective thief was
never going to get access to the documentation anyway.
[color=blue]
> The usual practice seems much worse, and almost all
> maintenance is based on reading the existing code and
> praying the last guy at least used sensible names.[/color]
The usual practice is worse, the code is badly and inconstantly
formatted, the original author was French, or German, or Indian, and
identifier names that are in English don't quite correspond with their
conceptual role in the program, or are personal abbreviations, or
whatever. And yet we cope. We cope because while meaningful identifier
names are obviously helpful they are ultimately arbitrary; distinct
slots into which values are placed. In the perception of an experienced
programmer an identifier name that conveys no additional meaning is in
no way a barrier to understanding the behaviour of the code that uses
it. If it were how would anyone cope with assembly language programming?
[color=blue]
> If he hasn't done that, then
> working out what the code
> does tends to be much harder.[/color]
You cannot persuade any javascript experts that there is any value in
obfuscation by saying "much harder" and "looks scary" because that is
not their perception of the situation. You can mangle the identifier
names any way you like but whatever you do they must remain distinct.
That distinctness is all the experienced programmer needs, and so the
results will only be _slightly_ harder to undersigned than they would
have been before. And it won't "look scary" at all, because those
meaningless identifier names are surrounded by self-evident operators,
expressions, statements, function calls, DOM property accessors, etc,
etc (and all syntax highlighted to exaggerate their role in the code).
It is an open book once you know how to read it.
You may perceive that transformation as rendering code much harder to
comprehend and looking impressively scary, and there may be many
thousands (even hundreds of thousands) of others with a similar
perception, but they were never a threat to start with. The threat comes
(and always will come) from individuals who are not at all put off by a
task that has been rendered just slightly harder.
There is a reason that ex-hackers (in the 'breaking into computer
systems' sense) easily find legitimate employment as network security
experts; sensible people seek the opinions of those who understand the
reality.
Richard.
Comment