encrypting then decrypting help

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

encrypting then decrypting help

Post by Charles256 »

I need a user to be able to put in a number, say 1234, then store it in the database like ht30ng30n or some jazz.
then i can pull it from the database and instead of showing the garbage i show 1234. crypt() appears to be a hash which means i can't retrieve the value,right? if so then what function can I use to recieve my desire result? If I'm usnig the wrong terminology please feel free to correct me. :-D
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

You could use base64_encode, but thats not really true encryption, I am seeking a similar option for my portal system. Mcrypt doesn't work for me (is it because my host uses the cgi version of php, or is mcrypt a library?) Whoever answers this, can probably answer my post too.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

Thats dandy :x , I use a host, I for sure know they won't install it for me.
Post Reply