Embedding perl in Java

Discussion in 'Perl Misc' started by Shalini Joshi, Jun 19, 2004.

  1. 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
    Shalini Joshi, Jun 19, 2004
    #1
    1. Advertising

  2. Shalini Joshi

    Ben Morrow Guest

    Quoth (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

    --
    perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
    qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
    1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
    2047502190/' #
    Ben Morrow, Jun 19, 2004
    #2
    1. Advertising

  3. Ben Morrow <> wrote in message
    >
    > 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.
    Shalini Joshi, Jun 20, 2004
    #3
  4. Shalini Joshi

    Ben Morrow Guest

    Quoth (Shalini Joshi):
    > Ben Morrow <> wrote in message
    > >
    > > For advice on (the futility of) concealing Perl code in general, see
    > > perldoc -q hide.

    >
    > 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

    --
    Outside of a dog, a book is a man's best friend.
    Inside of a dog, it's too dark to read.
    Groucho Marx
    Ben Morrow, Jun 20, 2004
    #4
  5. 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


    Ben Morrow <> wrote in message news:<cb4p8t$h7d$>...
    > Quoth (Shalini Joshi):
    > > Ben Morrow <> wrote in message
    > > >
    > > > For advice on (the futility of) concealing Perl code in general, see
    > > > perldoc -q hide.

    > >
    > > 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
    Shalini Joshi, Jun 21, 2004
    #5
  6. Shalini Joshi

    Joe Smith Guest

    Shalini Joshi wrote:

    > .. 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
    Joe Smith, Jun 21, 2004
    #6
  7. Hey!

    Thanks a lot for the information.

    I appreciate it..

    Regards

    shalini
    Lincoln Yeoh <> wrote in message news:<>...
    > On 20 Jun 2004 23:00:25 -0700, (Shalini Joshi)
    > wrote:
    >
    > >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...
    Shalini Joshi, Jun 27, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boris R.
    Replies:
    0
    Views:
    459
    Boris R.
    Oct 15, 2003
  2. David F. Skoll
    Replies:
    2
    Views:
    865
    David F. Skoll
    Nov 14, 2003
  3. Frank Iannarilli

    Embedding Perl into C: Why?

    Frank Iannarilli, Jun 2, 2004, in forum: Perl
    Replies:
    1
    Views:
    501
    Sean Lynch
    Jun 3, 2004
  4. /usr/ceo
    Replies:
    32
    Views:
    1,907
    Mark Space
    Sep 15, 2008
  5. suraj

    embedding perl within perl....

    suraj, Nov 6, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    112
    Al Tobey
    Nov 7, 2003
Loading...

Share This Page