Hi guys
I want to do a function for encriptpass for chilli in awk, but I can´t because I don't know how
I have the function in php and the original of chilli, two functions work ok, but i need one for awk
Here is the php code
function encriptpass(){
$hexchal = pack ("H32", $_GET['chal']);
if (isset ($this->uamsecret)) {
$newchal = pack ("H*", md5($hexchal . $this->uamsecret));
} else {
$newchal = $hexchal;
}
$response = md5("\0" . $_GET['Password'] . $newchal);
$newpwd = pack("a32", $_GET['Password']);
$pappassword = implode ("", unpack("H32", ($newpwd ^ $newchal)));
.......
And this is from chilli
#!/usr/bin/perl
......
.....
$userurldecode = $userurl;
$userurldecode =~ s/\+/ /g;
$userurldecode =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
$redirurldecode = $redirurl;
$redirurldecode =~ s/\+/ /g;
$redirurldecode =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
$password =~ s/\+/ /g;
$password =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
# If attempt to login
if ($button =~ /^Login$/) {
$hexchal = pack "H32", $challenge;
if (defined $uamsecret) {
$newchal = md5($hexchal, $uamsecret);
}
else {
$newchal = $hexchal;
}
$response = md5_hex("\0", $password, $newchal);
$pappassword = unpack "H32", ($password ^ $newchal);
.....
.....
If somebody can write this function in awk, please tell me how.
Thaks