473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I decrypt an perl script?

The script starts like this.

use Filter :: decrypt ;

This is a script used by our company and the technician left so know I need to find out what it does and how it works. Tried perl -MO=Deparse "script" but it threws an error Compilation failed in tequire at "script name" line2. Begin failed -- compilation aborted at "script name" line 2 use Filter :: decrypt ;.

Can anyone help me?
Jan 5 '11 #1
7 5465
589 Expert Mod 512MB
Remove the unwanted spaces, they are causing the compilation error.

Expand|Select|Wrap|Line Numbers
  1. use Filter::decrypt;
Jan 5 '11 #2
Do I just remove the spaces and then run the Deparse?
I removed the spaces and lets assume the script name is eric
I ran perl -MO=Deparse eric and it ran saying eric syntax OK,
but how can I decrypt the scrypt so I can read it?
Because I need to be able to read it, edit it and then encrypt it and run it again.
Could you please tell me how I should do this?
Jan 6 '11 #3
3,509 Expert Mod 2GB
Personally I have never used this module (or had a use for it), so I am unfamiliar with its caveats and workings.

That said, after you ran the deparse, did it produce a decrypted version of the file? It sounds like you were expecting it to write to screen, but that may not be the case.

Why are you encrypting your Perl script? Even the text of this 16 year old module says that its not totally secure and that the algorithm is quite simple. If its reading the source you are worried about, you may have better luck producing an executable binary version of your Perl script instead.


Jan 6 '11 #4
589 Expert Mod 512MB
You've stated that the script starts out with those 2 plain text lines.

Are you saying that the rest of the script is encrypted?

Did you simply add those 2 lines to an already encrypted script?
Jan 6 '11 #5
All the scripts start with those 2 lines, I think the previous person added them. And all the scripts are encrypted. I need to get the encrypted scripts that start with those 2 line, decrypted and user readeble and then a way to re-encrypt them and make them executable.
Jan 7 '11 #6
3,509 Expert Mod 2GB
I still don't get the need for the encryption of the scripts. Simply converting them to executable binaries should be enough. You distribute the binaries and keep the source files.

Are we to understand that you only have the encrypted versions of these files and do not have the text version?
Jan 7 '11 #7
12,516 Expert Mod 8TB
I don't know perl but I took a look at the source code and as far as I can tell, the encryption algorithm is dead simple. Basically it XORs everything against the key 'perl'. As long as the person who first who wrote it didn't mess with the algorithm, you just need to XOR every 4 bytes against the key 'perl' and that will decrypt it for you.
Jan 7 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
by: Martin Foster | last post by:
Hi. I would like to be able to mimic the unix tool 'uniq' within a Perl script. I have a file with entries that look like this 4 10 21 37 58 83 111 145 184 226...
by: PzYon | last post by:
Hey 2gether! I'm trying to execute a PERL script on the web server when the user presses a button in an ASP.NET Web Application using Visual Basic. The most obvious solution for me seemed to be...
by: Richard Trahan | last post by:
I want a js function to call a Perl script residing on a server. The Perl script will return a string, to be used by the js. Pseudo code: <script> stringvar = perlfunc_on_server(stringarg)...
by: benwylie | last post by:
I am running IIS 6.0 on Windows 2003. I would like to be able to run a perl script from a web page and include the output. I have tried doing it with an ssi: <form action='docsearch.shtml'...
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
by: vermarajeev | last post by:
Hi guys, I have written code to encrypt and decrypt files using perl script. Please help me to port below code to crypto++ library. //ENCRYPTION my $cipher = Crypt::CBC->new( -cipher =>...
by: IvanIV | last post by:
Hi All, I have trouble with embedding a Perl interpreter into a C program. I would like to replace some subroutine in a Perl script without changing this script from my C program. I need...
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.