View Full Version : Encrypt / Decrypt Unsupported Function?
06-03-1999, 02:04 PM
I'm just trying a few things with encrypt() and decrypt() in PHP, and I'm getting Unsupported function errors referencing them?
Here's the code:
$mess = "just a message";
$passwd = "password";
$data = encrypt($mess,0,$passwd);
Is there anything obviously wrong? Thanks
06-03-1999, 02:38 PM
I just RTFM, and noticed that it doesn't even list functions for encrypt or decrypt, just crypt, although the book demonstrates uses of all three. :(
06-03-1999, 05:43 PM
crypt() is a one way street and I *think* it's the same as htpasswd's encryption (using Unix/Linux crypt function). Encrypt and decrypt I think are part of a library or module or something...
Also note that on Windows, crypt() does squat :(
06-03-1999, 06:59 PM
Justin: Even with the crypt module enabled?
"Okay, so I'm not "SANE" so to speak, but uh... I'm the lovable kind of psycho"
06-03-1999, 08:37 PM
I tried that on my system, and it still will not work... I'm not sure why, but I do know that for .htaccess protected directories there is no encryption on the passwords (which sucks) - I'm sure NT has some form of encryption... then again, maybe not...
06-03-1999, 10:20 PM
Yeah, for now, I'm just crypting a person's password with a salt and storing it in a file. When they need access again, I'll encrypt their password and compare it to the encrypted password in the file. The only problem (or feature) is that you can't decrypt a password using crypt(). I think its just standard DES encryption, isn't it?
06-03-1999, 10:38 PM
nope...[nbsp][nbsp]crypt() was designed to be a one-way hash, with no decryption methods other than brute force...[nbsp][nbsp]crypt is pretty darn good that there are no known cryptoanalysis methods to undo it...
In parlance, it has 4092 permutations driven by the salt and takes brute force (stepping through every possible value) to find the plaintext...[nbsp][nbsp]You can also run dictionaries against it, as most people use common words... :(
Even corrupted (b0rk3d) passwords don't stand up well to dictionary cracks, cause most of the crackers are coded specifically to h4nd13 such w0rd5... ;)
--Official member of the rat race--
06-04-1999, 02:34 AM
06-04-1999, 08:50 AM
There's (sort of) a BUG in the BOOK?
06-04-1999, 01:42 PM
Thanks, I think just crypt() will work for now, and I'll take a look into PGP later.
I've got some governement nuclear bomb designs I'm trying to smuggle to China. :)
06-05-1999, 12:44 AM
Hey Terra, are we able to use:
in our PHP scripts. Just wondering. Thanks
06-05-1999, 12:56 AM
I'm pretty sure I can't load up .dll files as those are for MS based systems...
I would recommend poking around the mailing list archives to see if such an animal exists for Unix (full encryption <--> decryption) methods...
If I was faced with this, I would just use pgp to do the work...
--When is not knowing, sorta knowing--
vBulletin® v3.6.8, Copyright ©2000-2013, Jelsoft Enterprises Ltd.