Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
confusion with hashes and charset(?)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Sujao
l33t
l33t


Joined: 25 Sep 2004
Posts: 677
Location: Germany

PostPosted: Tue May 10, 2005 4:42 pm    Post subject: confusion with hashes and charset(?) Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Wed May 11, 2005 4:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Sujao
l33t
l33t


Joined: 25 Sep 2004
Posts: 677
Location: Germany

PostPosted: Wed May 11, 2005 4:11 am    Post subject: Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Wed May 11, 2005 4:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Sujao
l33t
l33t


Joined: 25 Sep 2004
Posts: 677
Location: Germany

PostPosted: Wed May 11, 2005 5:10 am    Post subject: Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Wed May 11, 2005 5:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum