ideas to encode and decode a number?
Posted 02 August 2004 - 01:53 PM
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 .
Posted 03 August 2004 - 10:10 AM
Someone please correct me if i'm wrong here.
Posted 08 August 2004 - 11:00 PM
Posted 09 August 2004 - 12:27 AM
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:
Posted 10 August 2004 - 01:46 PM
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.
Posted 15 August 2004 - 11:51 PM
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.
Who wrote the rules. Are there any. If so someone should write some with regards using a dirty brown colour as a main color.
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users