Using Hex and ASCII Encryption Keys
Using Hex and ASCII Encryption Keys
Code conversion
Conversion from one format to the other is not a mathematical process, but has to
follow a code table, such as the one below. ASCII codes can be printable (such as
the ones normally entered and displayed as a string, or non-printable (representing
control characters such as ^M (CR) which is “Carriage Return”). The complete
table is 128 positions so that all hexadecimal combinations from Hex ’00’ to Hex
’7F’ are used. Using the table below a string can be converted one character at the
time.
Ascii hex Ascii hex Ascii hex Ascii hex
^@ (NUL) 0 20 @ 40 ` 60
^A (SOH) 1 ! 21 A 41 a 61
^B (STX) 2 " 22 B 42 b 62
^C (ETX) 3 # 23 C 43 c 63
^D (EOT) 4 $ 24 D 44 d 64
^E (ENQ) 5 % 25 E 45 e 65
^F (ACK) 6 & 26 F 46 f 66
^G (BEL) 7 ' 27 G 47 g 67
^H (BS) 8 ( 28 H 48 h 68
^I (HT) 9 ) 29 I 49 i 69
^J (LF) 0a * 2a J 4a j 6a
^K (VT) 0b + 2b K 4b k 6b
^L (FF) 0c , 2c L 4c l 6c
^M (CR) 0d - 2d M 4d m 6d
^N (SO) 0e . 2e N 4e n 6e
^O (SI) 0f / 2f O 4f o 6f
^P (DLE) 10 0 30 P 50 p 70
^Q (DC1) 11 1 31 Q 51 q 71
^R (DC2) 12 2 32 R 52 r 72
^S (DC3) 13 3 33 S 53 s 73
^T (DC4) 14 4 34 T 54 t 74
^U (NAK) 15 5 35 U 55 u 75
^V (SYN) 16 6 36 V 56 v 76
^W (ETB) 17 7 37 W 57 w 77
^X (CAN) 18 8 38 X 58 x 78
^Y (EM) 19 9 39 Y 59 y 79
^Z (SUB) 1a : 3a Z 5a z 7a
^[ (ESC) 1b ; 3b [ 5b { 7b
^\ (FS) 1c < 3c \ 5c | 7c
^] (GS) 1d = 3d ] 5d } 7d
^^ (RS) 1e > 3e ^ 5e ~ 7e
^_ (US) 1f ? 3f _ 5f ^? (DEL) 7f
Translation tools
The above procedure illustrates the manual translation of strings, and is useful for
incidental translations of relative short strings. If larger strings need to be
translated or in case this operation has to be performed frequently, a software
utility to translate complete strings could be applied. Though this represents a fairly
easy operation to execute, no Windows-based tools were located on the Internet in
the various shareware libraries, that would meet these needs.
A locally developed (simple) DOS-based tool is available and can be downloaded
from the ORiNOCO web-site which performs the same operation. When executing
this tool under Windows it has to be executed in a DOS window from the
command prompt.
This conversion tool consists of a single executable named ASC2HEX.EXE. When
it is executed from the DOS prompt, it will reply by asking the user to enter the
ASCII string. On return it will reply with the Hexadecimal value.
The attached screen capture illustrates its operation: