-
October 22nd, 2002, 01:45 PM
#1
Equivalent function to PHP's crypt()?
I'm currently writing a Windows application that will interface through HTTP POST requests to a PHP website backend that I'm also writing. I'm using PHP's crypt() function to encrypt the passwords that are inserted into the user database when a new user registers on the site. I'd like to know if there are any libraries, MSVC++ functions, or source code snippets that I could use to implement a DES encryption function so I can send an encrypted password string over the internet rather than a plaintext one.
I've taken a look at OpenSSL and it does have a function for DES encryption, but I can't use it unless I install the rest of the lib as well, which I don't really want or need.
Any help would be greatly appreciated.
Thanks,
David
-
October 22nd, 2002, 02:43 PM
#2
Look up the Crypto Api in MSDN. It has the nearest equivilent.
-
October 22nd, 2002, 02:52 PM
#3
I heard about it, but I didn't think it would give me a DES encrypted string. I need something that will give me the same output that the PHP crypt() function gave me so i can do a string comparison on the encrypted strings to test for password validity.
If i'm missing something about Crypto API and I could actually do what I'm asking, please let me know.
Thanks,
David
-
October 22nd, 2002, 06:30 PM
#4
Hmmm...
I read that the MS Crypto API invokes one of several underlying encryption mechanisms. I see DSS in the list, but not DES. I'm not sure how different they actually are.
There may be a "Cryptographic Service Provider" available for DES, but I haven't seen it. I guess it hasn't mattered to me before. I've only done some rudimentary crypto stuff.
Does the PHP Crypt function have any options as to the types of encryption it supports?
-
October 22nd, 2002, 06:56 PM
#5
DSS means Digital Signature Standard.
DSS, or PROV_DSS is not use for standard DES encryption and decryption. It is provider for digital signature. PROV_DSS provider doesn't support any encrypting mechanism. Just digital signature and hash codes (MD 5 and Secure Hash Algorithm).
That's about DSS provider...
You can encrypt any plain text using DES algorithm with Crypto API too. However you need to use MS Enhanced Provider to deal with this purpose...
The explanation of whole Crypto API functionality is too complex to write it here... I recommend you to read the Crypto API documentation in MSDN. The good start point to Crypto API would be Dino Esposito's article:
Periodicals 1997 \ Supporting CryptoAPI in Real-Word Applications
You can find this article in MSDN...
martin
-
August 24th, 2022, 04:07 PM
#6
Re: Equivalent function to PHP's crypt()?
Originally Posted by neonstar
I'm currently writing a Windows application that will interface through HTTP POST requests to a PHP website backend that I'm also writing. I'm using PHP's crypt() function to encrypt the passwords that are inserted into the user database when a new user registers on the site. I'd like to know if there are any libraries, MSVC++ functions, or source code snippets that I could use to implement a DES encryption function so I can send an encrypted password string over the internet rather than a plaintext one.
I've taken a look at OpenSSL and it does have a function for DES encryption, but I can't use it unless I install the rest of the lib as well, which I don't really want or need.
Any help would be greatly appreciated.
Thanks,
David
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|