Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7765641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:12:56+00:00 2026-06-01T15:12:56+00:00

I have this script, works ok: #!/usr/bin/perl $key = pack(H*,3cb37efae7f4f376ebbd76cd); $str = &4\=80CHB’; $dec

  • 0

I have this script, works ok:

#!/usr/bin/perl

$key = pack("H*","3cb37efae7f4f376ebbd76cd");

$str = "&4\=80CHB'";
$dec = decode($str);
print "Decoded string value: $dec\n";

sub decode{ #Sub to decode
    @subvar=@_;
    my $sqlstr = $subvar[0];
    $cipher = unpack("u", $sqlstr);
    $plain = $cipher^$key;
    return substr($plain, 0, length($cipher));
}

If I alter it to get the $str variable from STDIN, it messes up all the result:

#!/usr/bin/perl

$key = pack("H*","3cb37efae7f4f376ebbd76cd");

print "Enter string to decode: ";
$str=<STDIN>;chomp $str;
$dec = decode($str);
print "Decoded string value: $dec\n";

sub decode{ #Sub to decode
    @subvar=@_;
    my $sqlstr = $subvar[0];
    $cipher = unpack("u", $sqlstr);
    $plain = $cipher^$key;
    return substr($plain, 0, length($cipher));
}

First script gets it ok, result is:

Decoded string value: mentos

Second script is bad:

Decoded string value: ot&¸ÝÖóvë½vÍ

Any idea on what I do wrong? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:12:58+00:00Added an answer on June 1, 2026 at 3:12 pm

    You original code has

    $str = "&4\=80CHB'";
    

    which for some reason contains an escaped equals sign. It is the same as

    $str = "&4=80CHB'";
    

    so you need to enter &4=80CHB' to your modified code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script: #!/usr/bin/perl $LOGFILE = Soccer.txt; open(LOGFILE) or die(Could not open log
This is my first Perl script. Ever: #!/usr/bin/perl if ($#ARGV < 1) { die(usage:
I have following perl script #!/usr/bin/perl $userinput = <STDIN>; chomp ($userinput); while ( $userinput
When I have this PHP script. <?php exec('/usr/local/bin/mate hello.txt'); ?> It doesn't work on
I have such script: (Script.pl) #!/usr/bin/perl use strict; use warnings; use encoding 'utf-8'; use
I have this script that works, but I need to change the format of
I have this script to generate an XML file for an RSS feed. Works
I have this RewriteRule that works too well :-) RewriteRule ^([^/]*)/$ /script.html?id=$1 [L] The
We currently have a working php mail script, this works fine and as we
I have a script that's written in perl, and executed as CGI. It works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.