How to use GnuPG to generate sha512sum hash?

2007-08-31 Thread Moses
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

I want hash some strings by using GnuPG, I know GPG have hash
function, but I can't find how to do it in the manuals or other
documentations on the official website. What's parameters used by GPG
for hash?

Furthermore, I would like use sha-512 hash strings from standard
input, rather than from files, is it possible? If not, is there any
other app can do this for me?

Thanks and best regards.


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: http://firegpg.tuxfamily.org

iD8DBQFG17D0HuqxyCZQdwkRAuJ+AJ9W4jMKzUrCofxp5TMGRUMSwTZ0XgCggAAh
8uIJNLUxueNC+gEVhUK9h0Y=
=Iacf
-END PGP SIGNATURE-

___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: How to use GnuPG to generate sha512sum hash?

2007-08-31 Thread Todd Zullinger
Moses wrote:
 I want hash some strings by using GnuPG, I know GPG have hash
 function, but I can't find how to do it in the manuals or other
 documentations on the official website. What's parameters used by
 GPG for hash?
 
 Furthermore, I would like use sha-512 hash strings from standard
 input, rather than from files, is it possible? If not, is there any
 other app can do this for me?

Perhaps this:

echo some string | gpg --print-md SHA512

is what you're looking for?

-- 
ToddOpenPGP - KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
The best cure for insomnia is to get a lot of sleep.
-- W.C. Fields



pgpC3keMX14M2.pgp
Description: PGP signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: How to use GnuPG to generate sha512sum hash?

2007-08-31 Thread Moses
Hi,

(Sorry for last mail, FireGPG truncated my mail...so here it should be)

Thank you for your reply, it works. But hash results that I got from
GPG is different from some web based hash calculator, such as,
http://www.johnmaguire.us/tools/hashcalc/ or
http://people.eku.edu/styere/Encrypt/JS-SHA1.html

e.g. for AAA,
web based SHA1 result is:
606ec6e9bd8a8ff2ad14e5fade3f264471e82251
, and SHA512 result is:
8d708d18b54df3962d696f069ad42dad7762b5d4d3c97ee5fa2dae0673ed46545164c078b8db3d59c4b96020e4316f17bb3d91bf1f6bc0896bbe75416eb8c385

but GPG's result is:
 echo AAA | gpg --print-md SHA1
1AE0 9EE3 43FA 9C61 8DE7  C5C1 770E F4E4 90B2 4ADA

 echo AAA | gpg --print-md SHA512
1CD99029 6017D85F 8B909505 21AE360D C8D907C3 A09B14AB 5B273F85
7BC2F166 B90B3889 07DF7A7C A383D585 D555F383 92B1101E 0A2B1829
0D966F54 25036FDB

Due to I have try more than one web-based cryptographic hash
calculator. I don't think online results are wrong. All of them
generates the same results except GPG.

Did I miss something? Or it's a issue of my GPG installation?


Best regards.








On 8/31/07, Todd Zullinger [EMAIL PROTECTED] wrote:
 Moses wrote:
  I want hash some strings by using GnuPG, I know GPG have hash
  function, but I can't find how to do it in the manuals or other
  documentations on the official website. What's parameters used by
  GPG for hash?
 
  Furthermore, I would like use sha-512 hash strings from standard
  input, rather than from files, is it possible? If not, is there any
  other app can do this for me?

 Perhaps this:

 echo some string | gpg --print-md SHA512

 is what you're looking for?

 --
 ToddOpenPGP - KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
 ~~
 The best cure for insomnia is to get a lot of sleep.
 -- W.C. Fields


 ___
 Gnupg-users mailing list
 Gnupg-users@gnupg.org
 http://lists.gnupg.org/mailman/listinfo/gnupg-users




___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: How to use GnuPG to generate sha512sum hash?

2007-08-31 Thread David Shaw
On Fri, Aug 31, 2007 at 07:22:00PM +0800, Moses wrote:
 Hi,
 
 (Sorry for last mail, FireGPG truncated my mail...so here it should be)
 
 Thank you for your reply, it works. But hash results that I got from
 GPG is different from some web based hash calculator, such as,
 http://www.johnmaguire.us/tools/hashcalc/ or
 http://people.eku.edu/styere/Encrypt/JS-SHA1.html
 
 e.g. for AAA,
 web based SHA1 result is:
 606ec6e9bd8a8ff2ad14e5fade3f264471e82251
 , and SHA512 result is:
 8d708d18b54df3962d696f069ad42dad7762b5d4d3c97ee5fa2dae0673ed46545164c078b8db3d59c4b96020e4316f17bb3d91bf1f6bc0896bbe75416eb8c385
 
 but GPG's result is:
  echo AAA | gpg --print-md SHA1
 1AE0 9EE3 43FA 9C61 8DE7  C5C1 770E F4E4 90B2 4ADA
 
  echo AAA | gpg --print-md SHA512
 1CD99029 6017D85F 8B909505 21AE360D C8D907C3 A09B14AB 5B273F85
 7BC2F166 B90B3889 07DF7A7C A383D585 D555F383 92B1101E 0A2B1829
 0D966F54 25036FDB
 
 Due to I have try more than one web-based cryptographic hash
 calculator. I don't think online results are wrong. All of them
 generates the same results except GPG.

You are making a mistake with echo.  By default, echo adds a newline
at the end of what it prints.  You are hashing AAA on the website,
and AAA\n with GPG, so naturally they don't match.

Add the -n flag to echo to tell it to not add a newline, and you
will see the results match:

  echo -n AAA | gpg --print-md sha512

David

___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: How to use GnuPG to generate sha512sum hash?

2007-08-31 Thread Moses
O...I see.
I've get the correct hash on Linux..., thank you all! :-)

The problem remains now is how to get the same hashing on Windows,
because echo on windows does not have -n flag:
  echo -n AAA
 -n AAA
so, on windows echo -n AAA | gpg --print-md sha1 is actually hashing
-n AAA\n but not AAA...   :-\

Is there a easy way to get rid of the newline on windows system?

Best regards.







On 8/31/07, David Shaw [EMAIL PROTECTED] wrote:
 On Fri, Aug 31, 2007 at 07:22:00PM +0800, Moses wrote:
  Hi,
 
  (Sorry for last mail, FireGPG truncated my mail...so here it should be)
 
  Thank you for your reply, it works. But hash results that I got from
  GPG is different from some web based hash calculator, such as,
  http://www.johnmaguire.us/tools/hashcalc/ or
  http://people.eku.edu/styere/Encrypt/JS-SHA1.html
 
  e.g. for AAA,
  web based SHA1 result is:
  606ec6e9bd8a8ff2ad14e5fade3f264471e82251
  , and SHA512 result is:
  8d708d18b54df3962d696f069ad42dad7762b5d4d3c97ee5fa2dae0673ed46545164c078b8db3d59c4b96020e4316f17bb3d91bf1f6bc0896bbe75416eb8c385
 
  but GPG's result is:
   echo AAA | gpg --print-md SHA1
  1AE0 9EE3 43FA 9C61 8DE7  C5C1 770E F4E4 90B2 4ADA
 
   echo AAA | gpg --print-md SHA512
  1CD99029 6017D85F 8B909505 21AE360D C8D907C3 A09B14AB 5B273F85
  7BC2F166 B90B3889 07DF7A7C A383D585 D555F383 92B1101E 0A2B1829
  0D966F54 25036FDB
 
  Due to I have try more than one web-based cryptographic hash
  calculator. I don't think online results are wrong. All of them
  generates the same results except GPG.

 You are making a mistake with echo.  By default, echo adds a newline
 at the end of what it prints.  You are hashing AAA on the website,
 and AAA\n with GPG, so naturally they don't match.

 Add the -n flag to echo to tell it to not add a newline, and you
 will see the results match:

   echo -n AAA | gpg --print-md sha512

 David

 ___
 Gnupg-users mailing list
 Gnupg-users@gnupg.org
 http://lists.gnupg.org/mailman/listinfo/gnupg-users


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Re: How to use GnuPG to generate sha512sum hash?

2007-08-31 Thread John Clizbe
Moses wrote:
 O...I see.
 I've get the correct hash on Linux..., thank you all! :-)
 
 The problem remains now is how to get the same hashing on Windows,
 because echo on windows does not have -n flag:
   echo -n AAA
  -n AAA
 so, on windows echo -n AAA | gpg --print-md sha1 is actually hashing
 -n AAA\n but not AAA...   :-\
 
 Is there a easy way to get rid of the newline on windows system?

A) Construct a text file containing your text without the CR-LF Windows likes
and use 'TYPE'


C:\WINDOWS\Tempdir aaa.txt
 Volume in drive C is Ice Chest
 Volume Serial Number is 3083-4508

 Directory of C:\WINDOWS\Temp

2007-08-31  16:02 3 aaa.txt
   1 File(s)  3 bytes
   0 Dir(s)  24,640,925,696 bytes free

C:\WINDOWS\Temptype aaa.txt | gpg --print-md sha512
8D708D18 B54DF396 2D696F06 9AD42DAD 7762B5D4 D3C97EE5 FA2DAE06 73ED4654 5164C078
 B8DB3D59 C4B96020 E4316F17 BB3D91BF 1F6BC089 6BBE7541 6EB8C385

B) Or use any of the versions of bash or ksh available for Win32 to get a posix
environment. There are many available: MSYS, Cygwin, UWIN, SFU/Interix

C:\WINDOWS\Tempbash
bash-3.2$ echo -n AAA | gpg --print-md sha512
8D708D18 B54DF396 2D696F06 9AD42DAD 7762B5D4 D3C97EE5 FA2DAE06 73ED4654 5164C078
 B8DB3D59 C4B96020 E4316F17 BB3D91BF 1F6BC089 6BBE7541 6EB8C385
bash-3.2$

-- 
John P. Clizbe  Inet:   John (a) Mozilla-Enigmail.org
You can't spell fiasco without SCO. PGP/GPG KeyID: 0x608D2A10/0x18BB373A
what's the key to success?/ two words: good decisions.
what's the key to good decisions? /  one word: experience.
how do i get experience?  / two words: bad decisions.

Just how do the residents of Haiku, Hawai'i hold conversations?



signature.asc
Description: OpenPGP digital signature
___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users