Jump to content

Encryption Question?


Solarpitch

Recommended Posts

Hey Guys,

 

I am just wondering. I want to store a 10 digit number in my database under md5() encryption. Is it possible to get the value of the number at a later date from this encryption if needed?

 

It probably sounds stupid because in theory I am trying to reverse encrypt but the number needs to be encrypted in the database, yet ... be made viewable on a web page when requested.

 

Ger

Link to comment
Share on other sites

The whole idea of MD5 is that it can't be reversed, however it is possible to brute-force it. I wouldn't suggest it since it is very CPU intensive. I would move the info into a different reversable encryption but if that is not an option you can brute-force it. Basicly try to md5 all of the possible options and check if they match the database.

 

EDIT: Both of the above are better options ::)

Link to comment
Share on other sites

No you cannot.

 

Also, MD5() is technically a hash, not encryption (to do what you want would require using actual encryption/decryption.) MD5() hashes are not unique. Multiple starting values produce the same md5 hash. So, even if you make a table of all possible input values (in this case 10 digit numbers) there will be multiple entries that give the same md5 hash and you would never know when one was the actual starting value.

Link to comment
Share on other sites

Many thanks for the feedback guys. I like what foreverhex said about storing an encrypted value and a non encrypted value... but the only problem with that is I dont want the 10 digit number anywhere in the database if its not encrypted so on second thoughts that may not work.

 

I'll check out that link drewbee and see how I get on. I'll work something out.

 

Thanks again!

Link to comment
Share on other sites

The point of storing a hashed or encrypted value in a database is so that if the database is compromised, the original value cannot be gotten and used. On a shared host, every account has access to the database server and could gain access to your database by trying brute force usernames and passwords lists (all the more reason for using "strong" passwords for database access.)

 

Storing the un-encrypted value in the database defeats the whole purpose.

Link to comment
Share on other sites

Yeah, the above is true. I was just grasping for a solution. Another way of doing it... depending on what your final reason is, is to store the encypted number and then store a partially encypted number. Kinda like site do to show you your credit card number. Sorry for the misspells if any, I'm still sleepy.

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.