{"id":5137,"date":"2015-08-16T20:16:49","date_gmt":"2015-08-16T12:16:49","guid":{"rendered":"http:\/\/rmohan.com\/?p=5137"},"modified":"2015-08-16T20:16:49","modified_gmt":"2015-08-16T12:16:49","slug":"decrypt-ibm-stash-files","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5137","title":{"rendered":"Decrypt IBM stash files"},"content":{"rendered":"<div class=\"article-header\">\n<h1 class=\"title entry-title\"><a href=\"http:\/\/www.abhijeet-kumar.com\/2011\/07\/decrypt-ibm-stash-files.html\" rel=\"bookmark\" data-id=\"6022719889129879091\" data-item-type=\"post\">Decrypt IBM stash files<\/a><\/h1>\n<\/div>\n<div class=\"article-content entry-content\">\n<div dir=\"ltr\">If you are working on Websphere set of products for a while then I am sure you have been in situations where you don&#8217;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:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#!\/usr\/bin\/perl<\/p>\n<p>#usage perl unstash.pl &lt;Stash file name ex stash.sth&gt;<\/p>\n<p>use strict;<\/p>\n<p><tt>die \"Usage: $0 &lt;stash file&gt;\\n\" if $#ARGV != 0;<\/tt><\/p>\n<p><tt>my $file=$ARGV[0];<\/tt><br \/>\n<tt>open(F,$file) || die \"Can't open $file: $!\";<\/tt><\/p>\n<p><tt>my $stash;<\/tt><br \/>\n<tt>read F,$stash,1024;<\/tt><\/p>\n<p><tt>my @unstash=map { $_^0xf5 } unpack(\"C*\",$stash);<\/tt><\/p>\n<p><tt>foreach my $c (@unstash) {<\/tt><br \/>\n<tt>\u00a0 \u00a0last if $c eq 0;<\/tt><br \/>\n<tt>\u00a0 \u00a0printf \"%c\",$c;<\/tt><br \/>\n<tt>}<\/tt><br \/>\n<tt>-----------------------------------------<\/tt><\/p>\n<p><tt>Stash logic is same for IBM http server, Websphere application server or websphere mq. I have tested this for both gs6cmd and gsk7cmd.<\/tt><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p> 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&#8217;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 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5137"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5137"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5137\/revisions"}],"predecessor-version":[{"id":5138,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5137\/revisions\/5138"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}