I agree that it does not appear to be a valid SSHA256 hash but it would help if we knew the salt. Here's what I came up with after some searching.

#!/bin/env perl use strict; use warnings; use MIME::Base64; use Digest::SHA qw( sha256 ); # Only the first one can be validated... my @passwords = ( { encoded => 'M8Nbe/nfLJeVbV3XdvaLD44uxK77eAhJWEx1tIDLBCFteV +9zYWx0Xw==', password => 'P@ssw0rd!', salt => 'my_salt_', }, { encoded => 'B6HO7UNHVi5fglh1RpJXX4z1maGJ9lcicTVcy94ztsmzAe +kseg==', password => 'Passw0rd!', }, { encoded => 'KGOnPYya2qwhF9w4xK157EZZ/RqIxParohltZWU7h2T/VG +jNRA==', password => 'VMware1234!', } ); for my $pass ( @passwords ) { print "encoded: $pass->{encoded}\n"; my $decoded = MIME::Base64::decode_base64( $pass->{encoded} ); print "decoded: $decoded\n"; # Find digest and salt my @salt = unpack( 'C*', $decoded ); my @pass; push @pass, shift @salt for ( 1 .. 32 ); # shift the password off +leaving just the salt behind my $pw = pack( 'C32', @pass ); my $salt = pack( 'C*', @salt ); print "password digest: $pw\n"; print "salt: $salt\n"; print " salt matches what is stored\n" if ( defined $pass->{sa +lt} && $salt eq $pass->{salt} ); # Create a new password digest my $digest = sha256( $pass->{password} . $salt ); print "digest: $digest\n"; my $reencoded = MIME::Base64::encode_base64( $digest . $salt ); chomp $reencoded; print "reencoded (SSHA256): $reencoded\n"; print " reencoded matches the original encoded value!\n" if ( +$reencoded eq $pass->{encoded} ); print "\n\n"; }

In reply to Re: How to encode/decode an SSHA256 hash? by Mr. Muskrat
in thread How to encode/decode an SSHA256 hash? by FloydATC

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.