Thursday, November 27, 2014

How to Recover a Lost IKeyman Key Password

Use the following perl script to recover a lost ikeyman key db password for IBM HTTP Server or Websphere:

server1:/opt/IBM/HTTPServer/SSL # cat unstash.pl
#!/usr/bin/perl -w
#for help mail to getwashelp@gmail.com
use strict;
die "Usage: $0 \n" if $#ARGV != 0;
my $file=$ARGV[0];
open(F,$file) || die "Can't open $file: $!";
my $stash;
read F,$stash,1024;
my @unstash=map { $_^0xf5 } unpack("C*",$stash);
foreach my $c (@unstash) {
    last if $c eq 0;
    printf "%c",$c;
}
printf "\n";

server1:/opt/IBM/HTTPServer/SSL # ./unstash.pl key.sth
passw0rd

No comments: