Did something in the hashes change from 6 to 8?

Christian Baer christian.baer at uni-dortmund.de
Tue Mar 2 15:47:57 UTC 2010


Mellow greetings!

On a box running FreeBSD 6.something (probably 6.4) the boot drive died.
I had never bothered to update it to 7 or 8, since I was planning to
build a new computer anyway. Since I hadn't done that yet and I still
needed the work of this machine, I just put in a new drive and installed
8.0.

The deal is that a script I restored from backup doesn't quite work as I
think it should. This is the part that somehow causes problems:

  !/bin/sh
  stty -echo
  read -p "Enter passphrase: " passphrase
  stty echo
  main=`echo "${passphrase}" | sha256 | cut -c 1-5`
  if [ "${main}" != "ddfab" ]; then
    echo "Wrong passphrase!"
    exit
  fi

I have typed the password in question about a gazillion times, so I am
pretty sure I got it right. But somehow the 'if' keeps kicking in.

There are two possible reasons for this:

1. I have Alzheimer's.
2. Something about the way sha256(1) and/or digest(1) or one of the
   other commands in the script react differenly than before.

Maybe there is another reason that I just don't see?

Can someone help me out here?

Regards,
Chris

-- 
Ich kam.
Ich ging.
Und ich war da gewesen.


More information about the freebsd-questions mailing list