Hi Brad & All,

I saw the EVP functions example..... But I did not find them in the 9.6
version (the stable) one.   I got to know from the mailing list (Thanks
Lutz...) that these functions are available only as 9.7 beta. Anyway I
am not sure if they are going to solve my problem of a one way hash
algorithm that gives identical outputs in all platforms. Nevertheless I
would like to use these APIS as these are the preferred ones that
directly calling them.


1)  You talked about the UNIX crypt command. The same thing is available
in the OpenSSL too as the default option for the "passwd" program of the
"openssl" command. I tried that in different platforms. It gives the
same hash value for a given string in Linux and Windows.  Is this
program crypt a one way hash or it is just an encryption that is not a
one way hash? The man page I do not say this explicitly.

2) You said that this must produce same output on different
architectures?  I just used the function

"unsigned char *SHA1(const unsigned char *d, unsigned long n,unsigned
char *md)".

But I did get different hash values in different platforms for the same
string.  The hash values are identical in a given platform.  Do you have
any idea where I am I going wrong?



Thanks....

-Siva





-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Brad House
Sent: Monday, June 17, 2002 5:55 PM
To: [EMAIL PROTECTED]
Subject: Re: Md5 based hash

Well, there's an example at the bottom of this page
that should be quite helpful to you ...

http://www.openssl.org/docs/crypto/EVP_DigestInit.html

It uses the higher-level EVP functions instead of
the low-level hash functions ... easier if you want
to use other hash functions like SHA or MD2 as well
as MD5 ...

Anyhow, I'm not familiar with feeding a seed or a
salt into any hash functions like these ... the
unix crypt() for shadow passwords uses a 2 byte
salt, but I believe that is irrelevant for MD5,etc

But this definately should produce the same output
on different architectures, etc...

-Brad


Sivaselvam CN wrote:
> Hi Brad,
> 
> 
> Thanks for your mail. In another mail to the list titled "machine
> independent hash" I have raised some questions.  I am looking for a
MD5
> API that can hash taking a "password string" and a "seed/salt" value
as
> "1" option in the "passwd" program of the "OpenSSL" command. But the
> functions in the link you have sent do not take a seed/salt value as
> inputs. The problem is I do not get identical hash values for the same
> string in different platforms (Linux/Windows). I thought using a seed
> value (Correct me If I am wrong) one can get identical values in all
> platforms for a given password string. Using the "des_crypt" function
in
> the des.h file, that uses a seed value I get the same hash for a given
> string in all platforms
> 
> -Siva
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On Behalf Of Brad House
> Sent: Monday, June 17, 2002 5:10 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Md5 based hash
> 
> what's wrong with this:
> 
> http://www.openssl.org/docs/crypto/md5.html#
> 
> ??
> 
> -Brad
> 
> Sivaselvam CN wrote:
> 
>>Hi,
>>
>> 
>>
>> 
>>
>>I wanted to use the MD5 based hash algorithm that is provided as an 
>>option "1" in the "passwd" program of the "OpenSSL" command. I saw the
> 
> 
>>file "passwd.c" where this command is implemented. It makes use of a 
>>function
>>
>> 
>>
>>"static char *md5crypt" (const char* passwd, const char * magic ,
> 
> const 
> 
>>char* salt)"
>>
>> 
>>
>>But this command is not available as a library function in OpenSSL.
> 
> i.e. 
> 
>>I can not call this from my program if I use the OpenSSL library. Why?
> 
> 
>>Or am I wrong?
>>
>> 
>>
>> 
>>
>>Thanks
>>
>> 
>>
>>-Siva
>>
>> 
>>
> 
> 
> 
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
> 
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to