I'm not sure what category this is. It pertains to dates and conversion to numbers

MeghansUncle2

New member
Joined
Aug 10, 2013
Messages
7
I'm not even sure anyone here is going to take interest in this but I'll give it a shot. It has to do with the hex, and possible binary, representation of a date stored as a number I a file. I have dates stored in a file (represented below as series of hexadecimal numbers, but may need to be viewed in binary to decode. The first hex pair is always 11 and the last is always 40 I'm almost certain the first is a marker saying "Here is a date." The last could be part of the date or it could be a marker that is saying "here is the end of the date." That said, I have 8 dates below and show the 9 hex pairs that make up the date and the date produced by the program that reads the date and displays it. I simply do not know how this conversion from hex to display is accomplished. I'm sure there must be some algorithm to do it but it escapes me. Any help would be greatly appreciated. This is not going to be easy. Good luck!
11 a2 97 78 0a dd 3e e4 40 07/07/2013 09:46:50 PM
11 5c 6c 32 0b dd 3e e4 40 07/07/2013 09:46:58 PM
11 67 b1 76 e0 dd 3e e4 40 07/07/2013 10:24:27 PM
11 38 a7 e1 55 bc 42 e4 40 08/07/2013 9:15:05 PM
11 d9 4e e4 58 bc 42 e4 40 08/07/2013 9:15:37 PM
11 d2 2a f9 13 49 89 dc 40 1/1/1980 3:24:15 AM
11 d4 fb 78 63 c5 42 e4 40 08/08/2013 4:02:29 AM
11 e5 01 c9 62 c5 42 e4 40 08/08/2013 4:02:21 AM
 
Last edited:
This is not going to be easy. Good luck!
Um... isn't this your homework assignment?

That said, it would have been helpful to have received the instructions for this assignment, along with any other information. For instance, are we to assume that the pairs have meaning, or are the pairs maybe done that way merely for human readability? Are we to assume that encoding of some sort, to obfuscate the coded values, may have taken place? What other information has been given to you?

11 a2 97 78 0a dd 3e e4 40 07/07/2013 09:46:50 PM
11 5c 6c 32 0b dd 3e e4 40 07/07/2013 09:46:58 PM
11 67 b1 76 e0 dd 3e e4 40 07/07/2013 10:24:27 PM
11 38 a7 e1 55 bc 42 e4 40 08/07/2013 9:15:05 PM
11 d9 4e e4 58 bc 42 e4 40 08/07/2013 9:15:37 PM
11 d2 2a f9 13 49 89 dc 40 1/1/1980 3:24:15 AM
11 d4 fb 78 63 c5 42 e4 40 08/08/2013 4:02:29 AM
11 e5 01 c9 62 c5 42 e4 40 08/08/2013 4:02:21 AM
An obvious first note would be that the first two dates (not the times) are the same, and they share the string "dd 3e e4". The next two dates differ only in the month, and share "bc 42 e4" with each other, and "e4" with the previous two. This suggests that the column starting "e4" represents the day of the month.

Note: Since all dates are in 2013 and all dates share the initial 11 and the terminal 40, it may be that these values denote the year.

Now, what are your thoughts and efforts? ;)
 
Um... isn't this your homework assignment?

That said, it would have been helpful to have received the instructions for this assignment, along with any other information. For instance, are we to assume that the pairs have meaning, or are the pairs maybe done that way merely for human readability? Are we to assume that encoding of some sort, to obfuscate the coded values, may have taken place? What other information has been given to you?


An obvious first note would be that the first two dates (not the times) are the same, and they share the string "dd 3e e4". The next two dates differ only in the month, and share "bc 42 e4" with each other, and "e4" with the previous two. This suggests that the column starting "e4" represents the day of the month.

Note: Since all dates are in 2013 and all dates share the initial 11 and the terminal 40, it may be that these values denote the year.

Now, what are your thoughts and efforts? ;)

Well I'm not trying to be difficult but I gave you an explanation (ok so it's date-time not just date, sue me). That said, you want this in assignment form sorry I can't help. I'll try to elaborate though. Given are 8 rows 9 hex pairs per row followed by date-time strings. The hex pairs (left of each date-time string) are the numerical representation of the date-time string whose line they share with two possible exceptions, the beginning and end pair may or may not be delimiters demarking the start and end of a date-time sequence. I say may or may not because curiously enough, I do not know, but strongly suspect that at least the first hex pair is not a part of the date-time string represented in numerical form. This assumption is based on my many years in the computer field and how data is typically stored. The other types of data within the set surrounding my dates are all preceeded by a field type which is what I suspect the 11 hex is. The trailing 40 is suspect because they are not all the same time or year (they're really not all 2013, look again) so static end seems unlikely, but again not impossible. The above are all my effort to dat as to how this data might be represented. So not being a math person I decided to come on this site to see if perhaps someone who is, could perhaps give me at least a good running start at a solution. I know for example, given parts of an equation, other parts can be derived. So I was wondering if we know the date and time , and they can be broken down into numerical components, and we know how they're stored (the hex pairs can be translated to a series of numbers (I think it possible that each set of two or 4 pairs are combined and possible the high order pair is reversed as it is stored), isn't it possible to derive a formula to reverse engineer the conversion from number to string or vice versa? As I said, not a math person, I'm just looking for some insight. And by the way, I haven't had homework in 35 years :).

One last thing. While I am hopeful that there is a way to derive the information via formula, I've used brute force attack before to figure such things out. I am trying to learn something here. It's why I have withheld such analysis. History: These dates are stored in a file I believe was created by PASCAL or some derivative language and it's stored routines that convert date to number and the other way for storage space considerations when such things were critical. I was hoping to mimic the original code by reproducing the code/decode sequence in another language. But I need to know the algorithm first. :-D
 
Last edited:
Just to clarify: I wasn't trying to be offensive in my reply. This site is a free homework-help place (rather than a paid engineering subcontracting service), so I'd assumed that this was some sort of homework exercise.

Since you have no other information regarding how these date-time strings were encoded, it is possible that the decoding mechanism is impossible to find, especially since, in the "real world", many encoding methods only work one way: once encoded, the information cannot be decoded. (Think of passwords stored in a database, such as the passwords for this forum. The admin cannot tell you what your password is, because he can neither view it nor decode it from what is stored in the database.)

I'll spend a little more time on this exercise but, as a math teacher (rather than a software expert with years of reverse-engineering experience), I probably won't be able to make much progress. So let's hope another math volunteer, one with some computer experience too, views this thread and is able to contribute.

Thank you for your patience. ;)
 
No don't worry about spending time with this. I just thought minds greater suited to the task than mine would find the problem interesting at least. I will probably decode it eventually but thought that if there were (and I'm sure there is) an algorithm for this process it would be worth learning how the discovery of it is done by people so inclined. As I said, I haven't had homework in ages, just a lot of problems. by the way. I don't think the storage mechanism for the date/time strings is meant to obfuscate, only condense. Cheers!
 
Last edited:
I would like to develop a generic algorithm for doing this. I am in the process of brute force resolution. Once I have engineered a conversion, I wonder if there is a way to mathematically model a resolution for similar issues?
 
I'm not even sure anyone here is going to take interest in this but I'll give it a shot. It has to do with the hex, and possible binary, representation of a date stored as a number I a file. I have dates stored in a file (represented below as series of hexadecimal numbers, but may need to be viewed in binary to decode. The first hex pair is always 11 and the last is always 40 I'm almost certain the first is a marker saying "Here is a date." The last could be part of the date or it could be a marker that is saying "here is the end of the date." That said, I have 8 dates below and show the 9 hex pairs that make up the date and the date produced by the program that reads the date and displays it. I simply do not know how this conversion from hex to display is accomplished. I'm sure there must be some algorithm to do it but it escapes me. Any help would be greatly appreciated. This is not going to be easy. Good luck!
11 a2 97 78 0a dd 3e e4 40 07/07/2013 09:46:50 PM
11 5c 6c 32 0b dd 3e e4 40 07/07/2013 09:46:58 PM
11 67 b1 76 e0 dd 3e e4 40 07/07/2013 10:24:27 PM
11 38 a7 e1 55 bc 42 e4 40 08/07/2013 9:15:05 PM
11 d9 4e e4 58 bc 42 e4 40 08/07/2013 9:15:37 PM
11 d2 2a f9 13 49 89 dc 40 1/1/1980 3:24:15 AM
11 d4 fb 78 63 c5 42 e4 40 08/08/2013 4:02:29 AM
11 e5 01 c9 62 c5 42 e4 40 08/08/2013 4:02:21 AM
I do not have time to go into this at length.

But if you are correct that 11 and 40 are delimiters, then every date for year 2013 has e4 as the last two hex digits and the year shown as 1940 does not. Now what e4 has to do with 2013 I do not know, but the correlation is there.

Similarly I consistently see dd 3e for 7/7, bc 42 for 8/7, and c5 42 for 8/8. So that looks like day/month or month/day.

If all that is right then it seems to be put together in time then date order.

Moreover, as time gets later in the day the fourth block within the delimiters increases in value. (This is a little hard to see because your last two entries are not in the same temporal order as your other series.)

Maybe you can get Denis interested; he likes puzzles. Unfortunately I have work to do.
 
I do not have time to go into this at length.

But if you are correct that 11 and 40 are delimiters, then every date for year 2013 has e4 as the last two hex digits and the year shown as 1940 does not. Now what e4 has to do with 2013 I do not know, but the correlation is there.

Similarly I consistently see dd 3e for 7/7, bc 42 for 8/7, and c5 42 for 8/8. So that looks like day/month or month/day.

If all that is right then it seems to be put together in time then date order.

Moreover, as time gets later in the day the fourth block within the delimiters increases in value. (This is a little hard to see because your last two entries are not in the same temporal order as your other series.)

Maybe you can get Denis interested; he likes puzzles. Unfortunately I have work to do.

Thanks for the insight. I have begun analysis using single digit increment and comparison to scope out what's done here. It looks as if I need to map this binary and figure out what moves as I increment the date. I started this last night but didn't get very far. I think the base date is 01/01/1900 or something like that (I'm not on the computer I was doing my analysis on currently). Once I work out how the individual pieces are stored the conversion should be a simple matter. My initial query here was not to get someone to do my "homework", it really was a query to see if some sort of formula can be made to derive the translation information based on known input and output. Not being that good with math, I'm not entirely sure that's possible but it seems as if it should be. By the way, enter doesn't newline here editing this. What does?
 
Thanks for the insight. I have begun analysis using single digit increment and comparison to scope out what's done here. It looks as if I need to map this binary and figure out what moves as I increment the date. I started this last night but didn't get very far. I think the base date is 01/01/1900 or something like that (I'm not on the computer I was doing my analysis on currently). Once I work out how the individual pieces are stored the conversion should be a simple matter. My initial query here was not to get someone to do my "homework", it really was a query to see if some sort of formula can be made to derive the translation information based on known input and output. Not being that good with math, I'm not entirely sure that's possible but it seems as if it should be. By the way, enter doesn't newline here editing this. What does?
Enter
Enter

It does for me.

I thought about things like a Julian date from some base date. But if a standard Julian date is being used and if the last two hex digits represent years from the base date, then there seems to be an inconsistency.

\(\displaystyle e4_{16} = 228_{10}\)

\(\displaystyle dc_{16} = 220_{10}\)

\(\displaystyle 2013 - 1980 = 33 \ne 8 = 228 - 220\)

You are right about one thing: if this is a date field or a time/date filed, there is a general algorithm for conversion.

Sorry I can't be more help, and my clues may be wrong.
 
Wouldn't re-arranging the above this way make it somewhat easier "to examine":

d2 2a f9 13 [03:24:15 AM] 49 89 dc [01/01/1980]

a2 97 78 0a [09:46:50 PM] dd 3e e4 [07/07/2013]
5c 6c 32 0b [09:46:58 PM] dd 3e e4 [07/07/2013]
67 b1 76 e0 [10:24:27 PM] dd 3e e4 [07/07/2013]

38 a7 e1 55 [09:15:05 PM] bc 42 e4 [08/07/2013]
d9 4e e4 58 [09:15:37 PM] bc 42 e4 [08/07/2013]

e5 01 c9 62 [04:02:21 AM] c5 42 e4 [08/08/2013]
d4 fb 78 63 [04:02:29 AM] c5 42 e4 [08/08/2013]

It might were it that easily split. I think the binary boundary for each component is not even in this case. I am still examining this and will probably come up with a mask for the components shortly so that they can be isolated.
 
Top