November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Decrypt IBM stash files

Decrypt IBM stash files

If you are working on Websphere set of products for a while then I am sure you have been in situations where you don’t remember the password of your ssl key database file. In such a situation this perl script will help you and I am sure you will thank me but mind you this code is not mine but this is one piece of code I keep handy all the time:
——————————————————–
#!/usr/bin/perl

#usage perl unstash.pl <Stash file name ex stash.sth>

use strict;

die "Usage: $0 <stash file>\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;
}
-----------------------------------------

Stash logic is same for IBM http server, Websphere application server or websphere mq. I have tested this for both gs6cmd and gsk7cmd.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>