Author Topic: hex.pl - alpha-numeric to hexadecimal converter  (Read 2661 times)

0 Members and 1 Guest are viewing this topic.

Z3R0

  • Guest
hex.pl - alpha-numeric to hexadecimal converter
« on: February 06, 2011, 07:17:20 pm »
Code: [Select]
#!/usr/bin/perl
print "Enter characters here: ";
$string_x = <STDIN>;
$hex_x = unpack('H*', "$string_x");
print "\n\n";
print "[+] String $string_x";
print "has been converted to\n[+] ";
print '0x';
for ($i = 0; $i < length $hex_x; $i += 1) {
        print substr $hex_x, $i, 1;
}
print "\n";
Someone else wrote most of this, I've only modded it so perl uses a different hex encoding call because with the previous code it was only capable of encoding text. but now it encodes text and numbers. I dont know how this would be useful to anyone, but nonetheless the Perl section has a small amount of content.

Cheers :)