Perl Code Hiding


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl Code Hiding
# 1  
Old 12-26-2001
Perl Code Hiding

Is there a way to hide the Perl script like we do in C and other languages?
Smilie
sskb
# 2  
Old 12-29-2001
Hello,
Can you give more detail about "hiding" it? Do you not want the users to see the code, know the name of the perl script, etc?
You could compile the perl as opposed to running it via the interpreter or you could change the perms on the file or directory so users either can't read it or can't even see it. What OS are you on?
TioTony
# 3  
Old 12-31-2001
exactly,
I just want to give the executable to others hiding the code from them.
I have not come across compiling a Perl script. I would like to know how I can do that.
I have always been running that.

changing permission would not probably do that I think. I am working on HP-Unix Ver 11.

Perl version 5

Wish you a Very Happy New Year!
Smilie
sskb
# 4  
Old 01-01-2002
Well, I'm no perl guru, but I know it IS possible to obfuscate the code enough that no one in their right mind could read it... for example:
Code:
#!/usr/bin/perl
@a=(Lbzjoftt,Inqbujfodf,
Hvcsjt); $b="Lbssz Wbmm"
;$b =~ y/b-z/a-z/ ; $c =
" Tif ". @a ." hsfbu wj"
."suvft pg b qsphsbnnfs"
. ":\n";$c =~y/b-y/a-z/;
print"\n\n$c ";for($i=0;
$i<@a; $i++) { $a[$i] =~
y/b-y/a-z/;if($a[$i]eq$a
[-1]){print"and $a[$i]."
;}else{ print"$a[$i], ";
}}print"\n\t\t--$b\n\n";

Try running that... Then try to figure it out...
# 5  
Old 01-02-2002
There are a few ways to compile perl that I know of. It depends on your perl vendor in most cases so check with the vendor to see what you should do or check www.perlmonks.org.

perlcc will convert your perl to C so you can compile it with a C compiler.

http://www.perl2exe.com/ has a way to make perl scripts into stand alone executables.

perl -MO=C option works pretty well in perl 5. You'll probably want to read more about this.

I am sure there are more but you will have to do some digging to find them. Hopefully this will point you in the right direction. I have used the www.perl2exe.com stuff before and it works pretty well.
# 6  
Old 01-02-2002
Thanks LivinFree and Tony, i got the perl2exe. it is working fine. but it takes a lot of space anyway.

Smilie

and Guru!
the script is superb!!
but my bad, I'm not too brainy to do one like that!

Thanks again
Smilie
sskb
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Hiding shell script code

How can we share a script without actually sharing the code? I have 4 scripts in my system. The end user has to execute the first file and based on the inputs (I am reading 1, 2 , 3 as options) my shell script will execute respective script files. Now I dont want to share all the 4 script... (3 Replies)
Discussion started by: Dish
3 Replies

2. Programming

Perl- How to catch the file in perl code?

Hi, plz see the below code , i have catch the file "Orders.20110714.out "file as a Orders*.out. but it giving me an error .it does not open the file. if the same thing i have done by code code-> ls Orders*.out then it gives me the output Orders.20110714.out i am trying apply the... (1 Reply)
Discussion started by: pspriyanka
1 Replies

3. Shell Programming and Scripting

perl: a way to see a sub code in debug mode: perl -de 0 ?

Is there a way to see or print a sub code? Sometime a sub could be already defined, but in the debug mode (so, interactively) it could be already out of screen. So, I would think about a way to check if the sub is defined (just 'defined' is not a problem) and how it is defined. Also, if... (4 Replies)
Discussion started by: alex_5161
4 Replies

4. Programming

C++ overriding Vs hiding

class B { public: void fns(void){//base def;} }; class D:public B { public: void fns(void) {//new def;} }; I was thinking the above is overriding but somewhere else i found the above is just hiding.Only virtual functions can be considered as overriding? This is the exact statement ... (1 Reply)
Discussion started by: johnbach
1 Replies

5. UNIX for Dummies Questions & Answers

Hiding Password

Hello. A bit of a puzzle here: I have a 3rd party executable, which requires the following parameters: parm1 = program_name, parm2=userid/password, parm3=additional flags. We tried passing password as a variable, but you can do grep, and see what the password actually is I found a bit... (2 Replies)
Discussion started by: Kishinevetz
2 Replies

6. Shell Programming and Scripting

Hiding the Directory

Hi, I have a directory i want to just hide this directory. Could you please tell me the command to hide directory. (2 Replies)
Discussion started by: shivanete
2 Replies

7. Shell Programming and Scripting

Hiding PHP code on the server

Hi all, Sometime back, had put up a Q regarding hiding perl code. A: There is a utility known as 'pp' which comes along with PAR. Downloaded from CPAN. These people have done wonderful work I must say. Cool executables from perl scripts. Have one more... (4 Replies)
Discussion started by: sudhir_onweb
4 Replies

8. Shell Programming and Scripting

Hiding perl-cgi code

Hi all, This is my first post in this forum. Searched the threads, couldn't get information about this. I have developed a web-based tool using CGI. The code consists of cgi files (.cgi) and functions written as Perl Modules( .pm files). As it is the tool works perfect. Now is there... (4 Replies)
Discussion started by: sudhir_onweb
4 Replies

9. IP Networking

Hiding an IP address

Is there anyone who knows how to hide an IP from being logged by the site you are visiting. I know of some paid companies but I am looking for a different solution. Is there some way in UNIX to mask the ip. Help this is urgent. Datopdog (1 Reply)
Discussion started by: datopdog
1 Replies

10. Shell Programming and Scripting

Hiding password from ps

I'm calling a program with a command line arguement containing a password. while the process is running anyone on the system can ps -ef and see the password. Is there a way to prevent this from happening. example PROGRAM USERNAME/PASSWD I've also tried PROGRAM `cat passfile` ... (7 Replies)
Discussion started by: sudojo
7 Replies
Login or Register to Ask a Question