Alt-Codes and Ciphers

Did you ever list a program where strange characters were shown and where the bell rang on your computer? Well, it’s probably that you are…

Alt-Codes and Ciphers

Did you ever list a program where strange characters were shown and where the bell rang on your computer? Well, it’s probably that you are listing a binary programme that contains characters that are not printable. Basically, we live in a digital world which still contains things from the times when we had keyboards and a text display.

Overall, with the ASCII character table, we start with our ASCII characters (“A”), but the characters before this typically have some special operation, such as for a newline (0x13), a tab space (0x09), a back space (0x08), a space (0x20) or to ring the bell. These special characters allowed for some sort of control of the terminal:

0 — NUL, 1 — SOH, 2 — STX, 3 — ETX, 4 — EOT, 5 — ENQ, 6 — ACK, 7 — BEL, 
8 — BS, 9 — HT, 10 — LF, 11 — VT, 12 — FF, 13 — CR, 14 — SO, 15 — SI, 
16 — DLE, 17 — DC1, 18 — DC2, 19 — DC3, 20 — DC4, 21 — NAK, 
22 — SYN, 23 — ETB, 24 — CAN, 25 — EM, 26 — SUB, 27 — ESC, 28 — FS, 
29 — GS, 30 — RS, 31 — US, 32 — SP

We can use these character codes to create a cipher [here], and where “5124301” will be ciphered as:

ENQSOHCANRSSOH

But how do we display the characters which have a control function? Well, with this, we can use Alt Codes:

https://www.codetable.net/altkeycodes

A byte value of 1 will thus display a smiley face. So now, we can create a cipher with the Alt-code cipher maps character values to the Alt-Codes:

The basic coding in C# is:

public static string getAlt(string str)
{
str = str.ToLower();
var newcipher = "";
string mapping = "☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→";

foreach (char ch in str)
{
if (ch >= 'a' && ch <= 'z') newcipher = newcipher + mapping[(int)ch - (int)'a'];
else newcipher = newcipher + ch;
}
return (newcipher);
}

So can you decode this:

There are 121 other ciphers here: