Jump to content

[SOLVED] are there any function that can be decrypt after encrypt?


ted_chou12

Recommended Posts

*rant*
Ted, do you ever look in the php manual before asking a question? Seriously? Ever?

And if PHP freaks is too crowded for you, don't post here. If it isn't, the link in your signature should go. It's okay to advertise sites, but if you're advertising a competing site and you're always posting here, that doesn't say much for the other site.
Link to comment
Share on other sites

magic: he didn't specify anything abut sessions, cookies, etc. He asked a grammatically puzzling question about encryption and decryption. Whenever Ted posts something it is often vague, or an odd approach to a simple problem. I have a hard time thinking he's doing something reasonable here. *shrug* I could be wrong, but the last few times I saw a Ted question, the answer was in the manual.
Link to comment
Share on other sites

AFAIK there isn't a non-third party 2 way encryption with php. magic linked an apparently good third party 2 way encryption but remember... while a two way encryption may discourage "Joe Q AverageUser" it wont discourage people who really want the information.

"There are two types of encryption: one that will prevent your sister from reading your diary and one that will prevent your government." ~Bruce Schneier

I'd also like to quote someone else... "[url=http://www.google.com/]STFW[/url]" ~A Rude Person

I don't like to be mean but a google search for "Reversible php encryption" came up with a few results including the one magic linked.
Link to comment
Share on other sites

Ted, I know what encryption means.

Sometimes the step isn't the right one for the goal. Maybe if you explain more about WHAT you are trying to encrypt and WHY, I can provide a better answer.

Do some google searching for PHP encrypt decrypt.
I found several resources.
http://devzone.zend.com/node/view/id/1265
http://www.tonymarston.net/php-mysql/encryption.html

That's what you asked for! An encryption method that can be decrypted. Magic linked one, and you said it was too confusing. Encryption is a complex topic, so you'll probably have to think a little harder to understand it.
Link to comment
Share on other sites

Ted what he has created on there is a PHP class of his own.  He has then if you read that page, explained his code, although i never took the time to fully understand it.  Basically what you do is copy his fully functional code for the class, create a file named whaever u want, i went with like Encryption.class.php, and then you include that file on the pages you want to use it with.  when going to encrypt you simply create a [code]$crypter = new Encryption();
$crypter->encrypt($key, $myString, $length);[/code]

the key is whatever you want it to be, just remember it for the decryption
myString is obvious
length is the length you want to encrypt it to
say you have a 3 char string that u want to be 15 char encrypted, set length to 15

it's pretty simple
pretty sure decryption is just [code]$crypter->encrypt($key, $myString);[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.