Ignore:
Timestamp:
2007-08-14T12:41:24+12:00 (15 years ago)
Author:
qq6
Message:

added a rot13() to encrypt the password

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI4gs3.pm

    r14363 r14368  
    321321}
    322322
     323sub rot13()
     324{
     325    my $self = shift @_;
     326    my ($password)=@_;
     327    my @password_arr=split(//,$password);
     328   
     329    my @encrypt_password;
     330    foreach my $str (@password_arr){
     331    my $char=unpack("c",$str);
     332    if ($char>=97 && $char<=109){
     333        $char+=13;
     334    }elsif ($char>=110 && $char<=122){
     335        $char-=13;
     336    }elsif ($char>=65 && $char<=77){
     337        $char+=13;
     338    }elsif ($char>=78 && $char<=90){
     339        $char-=13;
     340    }
     341    $char=pack("c",$char);
     342    push(@encrypt_password,$char);
     343    }
     344    return join("",@encrypt_password);
     345}
     346
    3233471;
    324348
Note: See TracChangeset for help on using the changeset viewer.