Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can this Brain puzzle be solved? 1

Status
Not open for further replies.

Morningstarr

Programmer
Mar 13, 2002
24
0
0
US
I need to convert a Hex string 96 characters long into something printable that can be read and reentered by a user.
(A sentence, short string, a few numbers etc)

I must then be able to take the string entered by the user and convert it back to the 96 character Hex string.

The conversion process must be absolutely accurate.

Asking a user to enter 8 characters and half the time you get a typo. Ask for 96 characters and you would always get a typo.
Can this puzzle be solved?
 
In short, no. a 96 char hex string could be represented by approximately 81 characters [a-z] or 68 lower and upper case chars [a-z,A-Z]. Using all 94 characters on a standard keyboard, you would still need about 68 characters to represent the same information. Expecting no typos for a user entering 68 characters is unreasonable especially since in the scenario of all keyboard characters there would be a god chance for confusion over characters like ` and '.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yes 68 characters would be just as bad as 96. 16 or under would be reasonable, but it seems to me there is no way to get it there.
Thanks Tom!
 
perhaps part of the issue is just the 'expectation that the USER copy the results on a typo / keyboard basis. Unless it is some bizzare test/security issue, the 'converted' results could possibly just be copied and pasted?






MichaelRed


 
Actually Mike, Bizarre security issue might cover it.

Software converts the Hex string to something smaller and prints it to a journal. Should a system failure occur the user will need to enter what has been journaled from a printed report. Then the software needs to convert it back to hex for storage.

If I just leave the data in Hex and ask them to enter 96 characters every time, there is no way they will get it right.

I can't think of any way to do it. Hence the Brain Puzzle!

Thanks for the input

 
I guess the emphasis is (should be?) on Bizarre.

Ther eare a few encription schemes which use this size "Key", but I've never seen any place which requires a user to 'mechanically' enter it. General "password" protection is limited to a mininum length and occassionally to mix the characters between alpha and numeric. but 64 HEX. Need to have a serious discussion with myself on wheather the 'boss' who is requiriring this is worth the hassle.

Discussion over. Not.

(of course I am also involuntarily retired, so the discussion doesn't need to cover how I'm going to (financially) survive the retirement.)








MichaelRed


 
PGP uses the concept of a key fingerprint, which can be a list of english words (to be read over the phone to another person).

You could compile a list of words which map to 4-byte sequences:
0x0000 = repeat
0x0001 = tempts
0x0002 = rally
:
:
0xfffe = apple
0xffff = zebra

Which means that your 96 character hex string is reduced to 24 words.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Seems that the solution needs to be implemented earlier in the process.

Why does the journal need to be printed? Why not save the journal as a text file, or directly as HEX, or anything that can be directly read by the computer rather than having to manually key the info back in. Heck, even a PUNCH CARD would be better than your current system.

If you are dead set on involving a printed something in the system, how about converting to a barcode, and printing the barcode?

SCAN and OCR might also be an option if you could print nice big clear easy to recognize letters.
 
Not practial, but interesting and technically possible:

Use over sampling methods. Have the stuff keyed in independantly by multiple data entry staff.

Compare each string character-by-character. Since it is unlikely that the same error will occur in the same character for each independantly entered string, you could accept each character where each string's (or some percentage) value for that position is in agreement, and create an error corrected string from that.
 
Do you have a sample of the 96 char code and the associated message or whatever?

96 hexcodes could be 48 ascii characters...

or 64 characters if you where to use 6 bits instead of 8 bit bytes... but that gets confusing...
----------------------------------
----------------------------------
such as:
Code:
000000 - 0   000001 - 1   000010 - 2   000011 - 3
000100 - 4   000101 - 5   000010 - 6   000011 - 7
001000 - 8   001001 - 9   000110 - A   000111 - B
001100 - C   001101 - D   001110 - E   001111 - F

010000 - G   010001 - H   010010 - I   010011 - J
010100 - K   010101 - L   010010 - M   010011 - O
011000 - P   011001 - Q   010110 - R   010111 - S
011100 - T   011101 - U   011110 - V   011111 - W

100000 - X   100001 - Y   100010 - Z   100011 -' '
100100 - ?   100101 - ?   100010 - ?   100011 - ?
101000 - ?   101001 - ?   100110 - ?   100111 - ?
101100 - ?   101101 - ?   101110 - ?   101111 - ?

110000 - ?   110001 - ?   110010 - ?   110011 - ?
110100 - ?   110101 - ?   110010 - ?   110011 - ?
111000 - ?   111001 - ?   110110 - ?   110111 - ?
111100 - ?   111101 - ?   111110 - ?   111111 - ?

HELLO = 010001 001110 010101 010101 010011
... 0100 0100 1110 0101 0101 0101 0100 1100
HELLO = 44E5554C

instead of
HELLO = 48454C4C4F
in ascii (48 45 4C 4C 4F)

which isn't a big difference, but you could get 16 more characters...
----------------------------------
----------------------------------

If you have 2 codes and their messages you could post, it would be much easier to answer the question...

I would consider getting a backup drive or something... Have it constantly mirror itself or something...

Good Luck

Have Fun, Be Young... Code BASIC
-Josh

cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
The barcode is an excellent suggestion. Pretty much removes user error.
Thanks to everyone for your input!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top