0

I'm trying to understand how a system I'm working on creates some hash code starting from a numeric code. I'm collecting some of these pairs “small_number, big_number”, but I cannot figure out how the system encodes small_number to obtain big_number. Decoding is possible, because system can obtain small_number from big_number.

Numbers look like these:

197   >> 29337857947107767585

1078 >> 84080031635590040762

1083 >> 32373003898332638476

1409 >> 79402294967209014727

1498 >> 25254493910542918727

2945 >> 85687067382221703925

2946 >> 88767616208189692328

I have no clue at all. Can you point to some reading too?

Thank you

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Ivan Morgillo
  • 2,837
  • 4
  • 30
  • 46
  • 1
    If the process can be easily reversed, it is not a hashing algorithm being used. Do you kow anything at all about the algorithm ? – driis Feb 12 '11 at 16:59
  • What happens if you feed the system a numeric code longer than 20 digits? – CodesInChaos Feb 12 '11 at 16:59

1 Answers1

1

If the system can reverse the function, the function isn't a hashing function at all, but a cipher.

It looks like the output is always a 20 digit number - did you try testing it on non-numeric input, or strings larger than 20 digits?

In either case, its likely that the system uses a well known encryption algorithm (my guess is AES or DES), so without the key, it's infeasible for you to guess at the function.

Worse, if the system is not directly taking the input but adding some other information, you might have the right algorithm and key but still not realize it.

Vanwaril
  • 7,380
  • 6
  • 33
  • 47
  • It can't be AES since AES has a blocksize of at least 128 bits and a 20 decimal digit string has only 66.4 bits. – CodesInChaos Feb 12 '11 at 18:34
  • It could -- you can always truncate (i've used SHA and truncated to 10 base64 characters to generate passwords for an application) – Vanwaril Feb 13 '11 at 02:10