Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

how to use this script

by supercisco (Initiate)
on Apr 10, 2013 at 08:05 UTC ( #1027925=perlquestion: print w/replies, xml ) Need Help??
supercisco has asked for the wisdom of the Perl Monks concerning the following question:


i have the script but i do not know how to use it what is the input and the output, the script intends to replace hex value

#!/usr/bin/perl @xlat = ( 0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f, 0x41, 0x2c, 0x2e, 0x69, 0x79, 0x65, 0x77, 0x72, 0x6b, 0x6c, 0x64, 0x4a, 0x4b, 0x44, 0x48, 0x53 , 0x55, 0x42 ); $in = $ARGV[0]; $ep = $in; $dp = ""; ($s, $e) = ($in =~ /^(..)(.+)/o); for ($i = 0; $i < length($e); $i+=2) { $dp .= sprintf "%c",hex(substr($e,$i,2))^$xlat[$s++]; } print "\n$dp\n\n";

Replies are listed 'Best First'.
Re: how to use this script
by marto (Bishop) on Apr 10, 2013 at 08:44 UTC

    It looks like someone used this old script, and removed some comments. if in doubt ask the person who gave you the script, read what it's doing or use a search engine to find it.

    Update: Fixed link

      :) You're really good a links
Re: how to use this script
by tobias_hofer (Friar) on Apr 10, 2013 at 08:33 UTC


    I was giving a try on the script by passing it any folder string, i.e: c:\I\wonder\what\its\used\for\
    In the end it seems to split the drive name 'C:' from the path '\I\wonder\what\its\used\for\' and takes this for doing grabing some of the hex values in @xlat and convert hex->Ascii and creates a string, which will be printed.

    i.e. 'dsfd;kfo'
    Possible usage is to encrypt pathnames or to encrypt anything else you can provide on the command line to the script.

    However, the line hex(substr($e,$i,2))^$xlat[$s++] is taking a substring and does a binary XOR with the hex value - selected by $s which will be postincremeted. So to me it looks like simple encrypting text..

    But I am just guessing!


Re: how to use this script
by prashantktyagi (Scribe) on Apr 10, 2013 at 08:24 UTC
    how to use it what is the input and the output
    input is one cmdline arg $ARGV[0] ( char or number ).Run script and observe the output.
    what are trying to achieve or simply you are analyzing someone else code ?
Re: how to use this script
by VinsWorldcom (Parson) on Apr 10, 2013 at 14:19 UTC

    The script is a Cisco type 7 password decrypter. It is incomplete. For a working solution, see Cisco::Management.

Re: how to use this script
by Anonymous Monk on Apr 10, 2013 at 08:10 UTC

    Where did you get this script?

    What is its purpose?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1027925]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-02-18 06:01 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (250 votes). Check out past polls.