0

I have 5 numeric codes. They vary in length (8-10 digits). For each numeric code I have a corresponding alpha-numeric code. The alpha numeric codes are always 8 digits in length.

Now the problem. I know that by some process each numeric code is converted into it's corresponding 8 digit alpha numeric code but I do not know the process used. At first I thought that the alpha-numeric codes may be randomly generated using a seed from the numeric code but that did not seem to work. Now I am thinking that some sort of hashing algorithm is being used to convert the numerics to the alpha-numerics

My question is

1) Can I brute force solve this

2) If yes then what algorithms should I look into that can covert a numeric code to an 8 digit alpha-numeric code

3) Is there some other way to solve this?

Notes: The alpha-numeric codes are not case sensitive. I do not mind if a brute force search returns a few false positives because I will be able to narrow them down myself.

Clarification: I think the first guy misunderstood something. I know the exact values of these numeric and alpha-numeric codes. I simply am not sharing them on the site. I'm not trying to randomly map codes to codes I'm trying to find an algorithm that map my specific codes to the outputs.

2
  • If the outputs are alphanumeric, I'm assuming base62 here, and their length is 8 characters or roughly 6 bytes, then there are no common hash functions that produce a 6 byte output. The output might be trimmed, but that's yet another variable, because there are lots of ways to trim something. Commented Sep 11, 2015 at 8:13
  • Base 36 since no case sensitivity Commented Sep 11, 2015 at 15:54

1 Answer 1

1

No, you cannot brute force this.

There are an unlimited number of functions that will map 5 inputs to 5 outputs. How would you know whether you found the right function? For example, you can use these 5 pairs as constraints for a polynomial of degree n. There are an infinite number of possible polynomial solutions.

If you can narrow the functions down, then there are additional constraints on the problem.

If you assume a hash function is used, you can try guessing that there is no salting, and the search space is over well known hash functions. If there is salting, you are stuck brute forcing all possible salts over all possible hash functions. With just the salts, you are probably looking at > 2^128 values. A brute force attack is not going to be useful.

If a symmetric cipher is used, you have an instance of the chosen ciphertext problem. Modern ciphers are intentionally designed with this attack in mind and use 128 bits or more of key space. Brute forcing all keys is not going to work.

You do not state anything about the function. Is it reversible? Is it randomized?

Sign up to request clarification or add additional context in comments.

3 Comments

First of all I am fairly certain they use a well known algorithm (hence my request for a list) and not some unknown algorithm. Second I said I am okay with false positives because I have a sample size of 5 and I can get more samples if needed. Also see my edit
Have you tried the common hashing methods? Even each of those methods may have variations in result depend on used salt and iteration count. Supposing you find the used algorithm is MD5, you still need to find the salt and iteration count. In practice you would have to brute force through combinations of algorithms, salt & iteration combinations.
Thank you for your comment Martheen. This is the kind of thing I was looking for. I just want a rough Idea of what types of combinations and algorithms I should be brute forcing to solve this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.