View previous topic :: View next topic |
Author |
Message |
Sujao l33t
Joined: 25 Sep 2004 Posts: 677 Location: Germany
|
Posted: Tue May 10, 2005 4:42 pm Post subject: confusion with hashes and charset(?) |
|
|
Hi all,
another crypt/hash questions from me. I made some hashes with sha256 or hashalot and the output was not what I expected. Afaik the hash output shuold be ASCII but its not. For example:
Code: | bash-2.05b# echo "helloworld" | hashalot sha256
j\ª¢f»ËxÍs+
2ëD»o¯bash-2.05b#
|
Some chars looked different on the bash. This isnt supposed to happen, is it? I also tried to set LANG and LC_CTYPE to "C", "en_EN" or "UTF-8" but it didnt help. Usually my bashrc looks like this:
Code: | export LC_TIME="de_DE"
export LC_CTYPE="de_DE@euro" |
Any ideas? |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Wed May 11, 2005 4:04 am Post subject: |
|
|
man hashalot wrote: | OPTIONS
....
If the -x option is given then the hash will be printed as a string of hexadecimal digits. |
_________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
Sujao l33t
Joined: 25 Sep 2004 Posts: 677 Location: Germany
|
Posted: Wed May 11, 2005 4:11 am Post subject: |
|
|
Yes but what to do if I need ASCII? I wouldnt like convert the hex to ascii with some other tool. Can you confirm that normal output should be ASCII? |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Wed May 11, 2005 4:36 am Post subject: |
|
|
I can infirm that. Normal output is not ASCII but it's the raw hash bytes. Which makes sense - how would hashalot know how to map values lower than 32 or higher than 127 to ASCII? Conversely, there is no hash function that would output only values between 32 and 127. Use -x or pipe the output from hashalot through uuencode, for example. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
Sujao l33t
Joined: 25 Sep 2004 Posts: 677 Location: Germany
|
Posted: Wed May 11, 2005 5:10 am Post subject: |
|
|
Hmm, indeed...I forgot that ASCII is actually a 7bit codec...so this wouldnt fit to the lenght of the output string and had to be twice the lenght. BTW, which format is in /etc/shadow? MD5?
Last edited by Sujao on Wed May 11, 2005 11:22 pm; edited 2 times in total |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Wed May 11, 2005 5:14 am Post subject: |
|
|
Sujao wrote: | BTW, which format is in /etc/shadow? MD5? | /etc/shadow is a colon-separated flat file database. The password column contains base64-encoded MD5 hashes with a $1$ magic string tacked to the front. See this thread for more info: https://forums.gentoo.org/viewtopic-t-333903.html _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
|