Jump to content

Archived

This topic is now archived and is closed to further replies.

gopi_crishna

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Your wrong. The algorithm is now freely available to decode md5 upto 8 chars. With regards your initial question gopi, search the mySQL site for enryption/decryption.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.