Embedding perl in Java

S

Shalini Joshi

Hi!

I found out about the JPL module that allows us to write perl code
within a java program and vice versa.

The reason I'd be interested in this particular thing is that we dont
want our clients to actually see the source code(i am guessing there
is no way to hide a perl script from a user and just give an
executable kind-of, since it's a script). So to actually produce a
product we thought of embedding the script in a java program and
compiling it and then the byte code could be supplied to the client.

Is this reasoning/line of thought correct? And if so, how do I go
about using jpl and designing the program?

I have gotten various helpful tips from this group and would really
appreciate help on this one too.


THanks a lot!

Regards,

Shalini
 
B

Ben Morrow

Quoth (e-mail address removed) (Shalini Joshi):
I found out about the JPL module that allows us to write perl code
within a java program and vice versa.

The reason I'd be interested in this particular thing is that we dont
want our clients to actually see the source code(i am guessing there
is no way to hide a perl script from a user and just give an
executable kind-of, since it's a script). So to actually produce a
product we thought of embedding the script in a java program and
compiling it and then the byte code could be supplied to the client.

Is this reasoning/line of thought correct? And if so, how do I go
about using jpl and designing the program?

No. The Perl source would still be visible; the user would still need
Perl installed.

For advice on (the futility of) concealing Perl code in general, see
perldoc -q hide.

Ben
 
S

Shalini Joshi

Ben Morrow said:
No. The Perl source would still be visible; the user would still need
Perl installed.

For advice on (the futility of) concealing Perl code in general, see
perldoc -q hide.

Ben



Hi.

Thanks a lot Ben for this information. All this while we were really
feeling smart thinking we could actually solve the problem of hiding
the source by embedding perl in java. Is there a solution to this
problem? Do u mean to say that no commercial product makes use of Perl
as a source language??

So since most of the work involved in this project deals with text
parsing, would it be advisable to use perl now, since we wouldn't be
able to keep the source code to ourselves? We are thinking of
licensing the product rather than provide services.

I am an intern and most of this business and product concept is very
new to me as am mostly used to just rattling off code and making
applications, and have never done the product or source code hiding
thiing before. I'd really appreciate any help in this regard. Needless
to say, the group has helped me out a lot already and would like to
thank you for that :)..

Regards,

Shalini.
 
B

Ben Morrow

Quoth (e-mail address removed) (Shalini Joshi):
Thanks a lot Ben for this information. All this while we were really
feeling smart thinking we could actually solve the problem of hiding
the source by embedding perl in java. Is there a solution to this
problem? Do u mean to say that no commercial product makes use of Perl
as a source language??

Have you read that faq? There are a variety of solutions, none of them
secure. It doesn't matter, though, as source code hiding never works
anyway and all you need to do is slap a big fat copyright notice on it
and noone can steal it.

You would need to talk to your company lawyers, of course.

Ben
 
S

Shalini Joshi

Hey!

Yeah Ben, thanks again..i managed to use perlcc to produce an
executable on the unix system. It didnt work on windows though(like it
had been pointed out in the doc)so used the B module to produce the
bytecode.

Yeah will let my boss know about the source code hiding issues..thanks
again.

--Shalini
 
J

Joe Smith

Shalini said:
.. All this while we were really
feeling smart thinking we could actually solve the problem of hiding
the source by embedding perl in java. Is there a solution to this
problem? Do u mean to say that no commercial product makes use of Perl
as a source language??

There are many commercial products that use Perl.
Including the source code does not make a product non-commercial.

You could store the Perl part as an encrypted string, then have
Java decrypt the string before feeding it to the embedded Perl
interpreter. But that has the same flaw as others; by monitoring
the Java program as it runs, the decryption process is revealed.
-Joe
 
S

Shalini Joshi

Hey!

Thanks a lot for the information.

I appreciate it..

Regards

shalini
Lincoln Yeoh said:
Hey!

Yeah Ben, thanks again..i managed to use perlcc to produce an
executable on the unix system. It didnt work on windows though(like it
had been pointed out in the doc)so used the B module to produce the
bytecode.

Yeah will let my boss know about the source code hiding issues..thanks
again.

For windows - try par and for executable compression try upx

http://search.cpan.org/~autrijus/PAR/lib/PAR.pm

There are many commercial products that use perl. Often without
obfuscation. Whether people have the source code or not doesn't stop
them from copying your stuff and using it. I use UPX+PAR just coz it
bundles things up in a single convenient file and users do not need to
install perl. But some AV scanners[1] seem to take a bit longer to
scan stuff like this.

It only makes it harder for people to figure out or extend/modify it.
It doesn't make it impossible.

The people who don't pay and bother to figure out your source code
often aren't going to pay for it - they either have less need for it
(they're smart enough to write much of it themselves), or they aren't
going to pay for it anyway.

Whereas the people who've already paid for it may regard having the
source code as a big plus. I'd personally prefer buying a program
that's easy to fix and modify, coz often programs outlast support from
the vendors that supply them.

Given a suitably viral license it may be disadvantageous for people to
copy and reuse your code without permission. You may wish to consult
your lawyers about that.

That said, I'm not too fond about these license things. What are the
limits of such things anyway? How valid are they? Someone should
implement a software license that requires users to howl at the moon
_publicly_ every month or brush their teeth after every meal.

[1] I wonder how AV scanners deal with obfuscated polymorphic
perl/lisp/etc viruses/worms...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top