in reply to convert hexadecimal value to encrypted string

It does not use pack/unpack, but does this return the encrypted string you need?
use strict; $_ = "639D879F224CA2A1BA73CC4884DBD362"; my @hexdata = /(\w{2})/g; my $str = join('', map { chr(hex $_) } @hexdata); print "$str\n";
Maybe, seeing this, someone may be able to give you a pack/unpack solution.