How to check secret word from md5 hash [closed] - md5

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am getting md5 hash in response for a service, I would to check my secret key is present in the md5 hash. I need some idea on how to decode the md5 hash key to check my word. Thanks.

Aside from hashing what you think the MD5 your getting back and comparing there is no real way to decrypt a hash like MD5.
MD5 is a one-way hashing algorithm. There is no way to decode them. The only way to remotely figure out what an MD5 hash represents is by using rainbow tables and even then your limited by a string length up to 64 characters or so, to dictionary words, numbers and any related combinations.
Simple and sure answer is no.

Generally speaking the way to approach this would be to apply the same hashing algorithm to your known secret word, then compare the result to the hash you received from the service. By design it is not possible to decrypt an MD5 hash

You can't decode the md5 hash.
An idea for understand how normally works: You need to store the md5 in a BD for example. After, you take the string entered by a user, for example, convert to md5 and then, compare the two strings.

I am totally Agree With Above Answers. And for example if u wanna get any user with one's password , then u need to use like
password='".md5($_POST['password'])."'
in Your Select query when user is being checked due login time....
I think u need like this...
u cant match posted password with Db if u wont use .md5 before it..

Related

A lucky draw system [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am creating a lucky draw system whereby the participants' username will be stored in either a file or a database and later one of the username will be picked as the winner. Each product has many participants.
My question is what would be the best way to store the usernames? Should I use a text file with each username separated as username\n ? Should I store the usernames in a field (type text) separated by comma? Or should create a participant table that links the member table and product table?
The best way will be to use a database due to the following reasons
1.Data of such apps may grow beyond control and file ops will take significant time then.
2.Databases ensure easy usage of the data stored,rather than file.
3.Database allows adding of new attributes,which is costly beyond imagination if you use a file.For eg,You may need to add attributes like score to your username in future.
So I would recommend using a table.

Create own certificates structure in C [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Imagine that I want be a certificate authority that issues its own certificates. I would like to be able to generate my own certificates with the fields I want. Is this possible to be done in anyway? Using OpenSSL or any other libraries? I would like to be able to create a very compact certificate which would have no more that a the public key, signature and a Identification. Something that would be about 250-bytes maximum, which is quite less compared with the certificates generated using openSSL, about 950 bytes.
The field that I would like my certificate to have would be:
The algorithm used should be ECDSA 224 ou 256, with SHA 256, expiry time, generation time, allow revocation of certificates and carry an Identification.
You can do anything you want, BUT, if you're concerned at all about security, or if you are interested in being compatible with applications other than your own, you shouldn't do this.
In general, "rolling your own" security solution is a BAD idea. There are standards for a reason. They have been peer reviewed, tested, and are transparent.
But just for curiosity, let's walk through what would be required for your question.
First, you need a public key. Currently, the secure recommendation is about 2048 bits or 256 bytes. With just the key, we are already over your maximum of 250 bytes.
Next, you need a signature. A standard signature will be equal to the key size: 2048 bits (256 bytes).
Then you need identification. You didn't say what the identification was. Let's say it's the string, "Identity 1". This takes up about 10 bytes. It is also very limiting and doesn't scale very well.
You didn't mention if you wanted an issuer identity, but let's throw that in for another 10 bytes.
And what about a serial #? Do you want any way of revoking these certificates if they become compromised? Do you want to identify the signature algorithm, or will it always be the same? Do you want expiration dates on the certificate? What about usage? Do you want to differentiate which roles the certs can have? All of these add to the byte count.
Let's say you don't want anything in the previous paragraph. Without that, we're already at 532 bytes total.
And what about formatting? We probably can't just stick all these bytes together. There needs to be some kind of structured formatting for the certificate values (similar to ASN.1 encoding used in X509). That will add additional bytes to the total.
So you can see why a certificate generated by OpenSSL can easily be over 650 bytes.
The bottom line is that it depends on what you intend to use this for. Are you just playing around in your own sandbox and not interested in compatibility or security? Then go ahead and make your own certificate format. But otherwise, stick to the standards.

Implementing a sparse matrix using a binary search tree [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have to implement a sparse matrix (a matrix that has predominantly zeroes, so you only record values different than 0), but I have to implement it using a binary search tree.
EDIT:
So now I'm thinking of implementing it by using the line / column as a key, but what do I use as the root of that tree ?
/EDIT
I hoped once I researched binary search trees I would understand how this implementation would be beneficial, or at the very least possible, but I for the life of me can't figure it out.
I have tried google to no avail, and I myself cannot imagine how to even attempt in doing so.
I haven't decided on the language I shall be implementing this in yet, so I need no code examples, my problem is logic. I need to see how this would even work.
P.S. I have no idea what tags to use, if someone could edit some in, It'd be much appreciated.
To use a binary tree you need to have a key that is distinct for each (possible) entry in the matrix. So if you want to lookup (2, 4) in a matrix [100, 100] then the key could be something like "002004". With this key you can insert a value into the tree.
For each dimension the key would be longer, so you also might consider a hash function to hash the coordinates of the cell and within the tree you have a list of entries for this hash key. The tree is then only an index to the right list. Within the list you need to perform a sequential search then. Or if you order the list you could improve by using a binary search.

VARBINARY or BINARY for byte arrays of 250-1000 bytes? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have to create a table in a database and one of the fields will contain between 250 and 1000 bytes. When it comes to read-write performance, should I use VARBINARY or BINARY(1000)? Does it matter?
As per this Reference, you should be using varbinary. binary is for fixed length, and your requirement is a variable-length field.
As for performance, I don't know if there'd be a difference. The best way to find out would be to view the execution plan or run a trace to see performance. I would safely assume that it is similar performance and negligable difference, although I'd still use varbinary at least if only for the reason you have a variable length requirement.
EDIT: this post assumes SQL Server. Please clarify your RDBMS.
My first thought on this would be: Test it
If you could make some quick tables and load some data into them with the different datatypes then query off of that. I would think that would give you a pretty good indication of which would be the better to use.
Sorry i don't have any concrete data to give you on performance, but i think that would be a fairly legit test for the answer. I'm interested in your results if you decide to go that route :)

How to create a symbol table? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can I use malloc to add symbol table entries? How do I traverse the table to check if something is already there?
A "symbol table" doesn't describe a particular kind of data structure. It merely describes the primary modes of operation: adding symbols and retrieving symbols by name. Symbols here are basically attributed names. For a compiler class, one such an attribute could be IsAFunction.
C has very few built-in datastructures. You'd have to create one yourself in this case. In C++, it would just be a matter of a std::map<std::string, Attributes>. Now presumably if you're in a compiler class, you should already know how to implement datastructures in C (including the use of malloc()). If not, then a compiler class really isn't for you.
In general, symbol tables are implemented through hash tables. Hash tables have the advantage of O(1) store and retrieve, but they don't store data sequentially.
Assuming you're working in C you can uses malloc(), but it requires more work than that. The provided link should enlighten you.
I'v done that with a double chained linked list before. But now i will definitively do it with a hashtable.
It's just a datastructure.

Resources