Jump to content

ideas to encode and decode a number?


Recommended Posts

Heloo,

I have been working with Dreamweaver and PHP very recently and currently

I am working on an Application where users apply for a job online and users enter all the details when filling out the applicaton.

 

One of the field they enter is "SSN"(number) .Now i want this number to be really secure ,so i want that to be encoded when added to the database and when the information is retrieved from the database again the encoded value has to decode and appear exactly the same.

 

So can any one please let me know "if there is any way that i can do this ".Please let me know any method,may be not exactly Encode or decode but i would try any method in getting that number encoded and decoded .

 

Thank You

 

Gopi .K

Link to comment
Share on other sites

I didn't think you could decode with md5? This forum uses md5 to code passwords but then all it does is md5 your password when you type it in and match that to the database. I'm not sure what encryption you could use for what you want.

 

Someone please correct me if i'm wrong here.

Link to comment
Share on other sites

Morpheus:

 

md5() is a one way hash. It was not meant to be used for encryption/decryption and should not be used for such, even via an exploit.

 

Furthermore it's clear from the question that the source (SSN#) is more than 5 characters.

 

With php the standard way to do encryption/decryption is to use the mcrypt library:

 

http://us4.php.net/mcrypt

Link to comment
Share on other sites

Who wrote the rules. Are there any. If so someone should write some with regards using a dirty brown colour as a main color for a website, tacky graphics and poor navigation and yellow text. Whilst this not only looks poor to well sighted people I feel that it would discriminate against people with visual imparrities. Now who has a site like that? Mmmmm let me think.

 

INSERT INTO table VALUES (1,AES_ENCRYPT('fieldname','fieldname2'));

 

AES_ENCRYPT() and AES_DECRYPT() were added in MySQL 4.0.2, and can be considered the most cryptographically secure encryption functions currently available in MySQL.

 

 

It doesnt get any easier.

Link to comment
Share on other sites

Who wrote the rules. Are there any. If so someone should write some with regards using a dirty brown colour as a main color.

Basically you backed yourself into a corner by giving out misinformation, and now you don't want to admit you were wrong? md5() shouldn't be used for encryption/decryption. The "rules" were made by the people who devised the algorithm.

 

As better solutions have now been provided, I guess we can move on. As an aside, hostility on this forum is something we try and avoid.

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.