Coding. Simple ciphers and their decryption

4.1. Encryption Basics

The essence of encryption using the replacement method is as follows. Let messages in Russian be encrypted and each letter of these messages must be replaced. Then, literally A the source alphabet is compared to a certain set of symbols (cipher replacement) M A, B – M B, …, I – M I. The cipher substitutions are chosen in such a way that any two sets ( M I And M J, i ≠ j) did not contain identical elements ( M I ∩ M J = Ø).

The table shown in Fig. 4.1 is the key of the replacement cipher. Knowing it, you can perform both encryption and decryption.

AB... I
M AM B... M I

Fig.4.1. Cipher substitution table

When encrypting, each letter A open message can be replaced by any character from the set M A. If the message contains several letters A, then each of them is replaced by any character from M A. Due to this, using one key you can get various options ciphergrams for the same open message. Since the sets M A, M B, ..., M I do not intersect in pairs, then for each symbol of the ciphergram it is possible to unambiguously determine which set it belongs to, and, consequently, which letter of the open message it replaces. Therefore, decryption is possible and the open message is determined in a unique way.

The above description of the essence of substitution ciphers applies to all their varieties with the exception of, in which for encryption different characters of the original alphabet, the same cipher substitutions can be used (i.e. M I ∩ M J ≠ Ø, i ≠ j).

The replacement method is often implemented by many users when working on a computer. If, due to forgetfulness, you do not switch the character set on the keyboard from Latin to Cyrillic, then instead of letters of the Russian alphabet, when entering text, letters of the Latin alphabet (“cipher replacements”) will be printed.

Strictly defined alphabets are used to record original and encrypted messages. The alphabets for recording original and encrypted messages may differ. Characters of both alphabets can be represented by letters, their combinations, numbers, pictures, sounds, gestures, etc. As an example, we can cite the dancing men from the story by A. Conan Doyle () and the manuscript of the runic letter () from the novel “Journey to the Center of the Earth” by J. Verne.

Substitution ciphers can be divided into the following subclasses(varieties).

Fig.4.2. Classification of substitution ciphers

I. Regular ciphers. Cipher replacements consist of the same number of characters or are separated from each other by a separator (space, dot, dash, etc.).

Slogan code. For a given cipher, the construction of a cipher substitution table is based on a slogan (key) - an easy-to-remember word. The second line of the cipher replacement table is filled first with the slogan word (and repeated letters are discarded), and then with the remaining letters that are not included in the slogan word, in alphabetical order. For example, if the slogan word “UNCLE” is selected, then the table looks like this.

ABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUI
DIANDNABINGEYoANDZYTOLMABOUTPRWITHTUFXCHShSCHKommersantYbEYU

Fig.4.4. Table of cipher replacements for the slogan cipher

When encrypting original message“ABRAMOV”, using the above key, the ciphergram will look like “DYAPDKMI”.

Polybian square. The cipher was invented by the Greek statesman, commander and historian Polybius (203-120 BC). In relation to the Russian alphabet and Indian (Arabic) numerals, the essence of encryption was as follows. Letters are written in a 6x6 square (not necessarily in alphabetical order).


1 2 3 4 5 6
1 ABINGDE
2 YoANDZANDYTO
3 LMNABOUTPR
4 WITHTUFXC
5 HShSCHKommersantYb
6 EYUI- - -

Fig.4.5. Table of cipher substitutions for the Polybian square

The encrypted letter is replaced by the coordinates of the square (row-column) in which it is written. For example, if the original message is “ABRAMOV”, then the ciphergram is “11 12 36 11 32 34 13”. IN Ancient Greece messages were transmitted using optical telegraphy (using torches). For each letter of the message, first the number of torches corresponding to the letter's row number and then the column number were raised.

Table 4.1. Frequency of appearance of Russian letters in texts

No.LetterFrequency, %No.LetterFrequency, %
1 ABOUT10.97 18 b1.74
2 E8.45 19 G1.70
3 A8.01 20 Z1.65
4 AND7.35 21 B1.59
5 N6.70 22 H1.44
6 T6.26 23 Y1.21
7 WITH5.47 24 X0.97
8 R4.73 25 AND0.94
9 IN4.54 26 Sh0.73
10 L4.40 27 YU0.64
11 TO3.49 28 C0.48
12 M3.21 29 SCH0.36
13 D2.98 30 E0.32
14 P2.81 31 F0.26
15 U2.62 32 Kommersant0.04
16 I2.01 33 Yo0.04
17 Y1.90

There are similar tables for pairs of letters (digrams). For example, frequently encountered bigrams are “to”, “but”, “st”, “po”, “en”, etc. Another technique for breaking ciphergrams is based on eliminating possible combinations of letters. For example, in texts (if they are written without spelling errors) combinations of “chya”, “shchi”, “ьъ”, etc. cannot be found.

To complicate the task of breaking one-to-one ciphers, even in ancient times, spaces and/or vowels were removed from the original messages before encryption. Another method that makes it difficult to open is encryption bigrams(in pairs of letters).

4.3. Polygram ciphers

Polygram substitution ciphers- these are ciphers in which one cipher substitution corresponds to several characters at once source text.

Bigram Cipher Ports. Porta's cipher, presented in table form, is the first known bigram cipher. The size of his table was 20 x 20 cells; the standard alphabet was written at the top horizontally and vertically at the left (it did not contain the letters J, K, U, W, X and Z). Any numbers, letters or symbols could be written in the table cells - Giovanni Porta himself used symbols - provided that the contents of none of the cells were repeated. In relation to the Russian language, the table of cipher substitutions may look like this.


ABINGDE
(Yo)
ANDZAND
(Y)
TOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUI
A001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031
B032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062
IN063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093
G094 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
D125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
HER)156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
AND187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
Z218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
I (Y)249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
TO280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
L311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
M342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
N373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
ABOUT404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
P435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
R466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
WITH497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
T528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
U559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
F590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620
X621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
C652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682
H683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713
Sh714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744
SCH745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
Kommersant776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806
Y807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
b838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868
E869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899
YU900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930
I931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961

Fig.4.10. Cipher replacement table for the Ports cipher

Encryption is performed using letter pairs of the original message. The first letter of the pair indicates the cipher replacement row, the second - the column. If there is an odd number of letters in the original message, an auxiliary character (“blank character”) is added to it. For example, the original message “AB RA MO V”, encrypted - “002 466 355 093”. The letter “I” is used as an auxiliary symbol.

Playfair cipher (English: “Fair game”). In the early 1850s. Charles Wheatstone invented the so-called "rectangular cipher". Leon Playfair, a close friend of Wheatstone, spoke about this cipher during an official dinner in 1854 to the Home Secretary, Lord Palmerston, and Prince Albert. And since Playfair was well known in military and diplomatic circles, the name “Playfair cipher” was forever assigned to Wheatstone’s creation.

This cipher was the first alphabetic bigram cipher (Porta's bigram table used symbols, not letters). It was designed to ensure the secrecy of telegraph communications and was used by British troops in the Boer and First World Wars. It was also used by the Australian Islands Coast Guard during World War II.

The cipher provides encryption of pairs of symbols (digrams). Thus, this cipher is more resistant to cracking than a simple substitution cipher, since frequency analysis is more difficult. It can be carried out, but not for 26 possible characters (Latin alphabet), but for 26 x 26 = 676 possible bigrams. Bigram frequency analysis is possible, but is significantly more difficult and requires a much larger amount of ciphertext.

To encrypt a message, it is necessary to split it into bigrams (groups of two symbols), and if two identical symbols are found in the bigram, then a pre-agreed auxiliary symbol is added between them (in the original - X, for the Russian alphabet - I). For example, "encrypted message" becomes "encrypted message" I communication I" To form a key table, a slogan is selected and then it is filled in according to the rules of the Trisemus encryption system. For example, for the slogan “UNCLE” the key table looks like this.

DIANDNAB
INGEYoANDZ
YTOLMABOUTP
RWITHTUFX
CHShSCHKommersantY
bEYU- 1 2

Fig.4.11. Key table for the Playfair cipher

Then, guided by the following rules, the pairs of characters in the source text are encrypted:

1. If source text bigram symbols occur in one line, then these symbols are replaced by symbols located in the nearest columns to the right of the corresponding symbols. If the character is the last in a line, then it is replaced with the first character of the same line.

2. If the bigram characters of the source text occur in one column, then they are converted to the characters of the same column located directly below them. If a character is the bottom character in a column, then it is replaced by the first character of the same column.

3. If the bigram symbols of the source text are in different columns And different lines, then they are replaced with characters located in the same lines, but corresponding to other corners of the rectangle.

Encryption example.

The bigram “for” forms a rectangle - it is replaced by “zhb”;

The bigram "shi" is in one column - replaced by "yu";

The bigram “fr” is in one line - replaced by “xc”;

The bigram “ov” forms a rectangle - it is replaced by “yzh”;

The bigram “an” is in one line - it is replaced by “ba”;

The bigram “but” forms a rectangle - it is replaced by “am”;

The bigram “es” forms a rectangle - it is replaced by “gt”;

The bigram “oya” forms a rectangle - it is replaced by “ka”;

The bigram “about” forms a rectangle - it is replaced by “pa”;

The bigram “shche” forms a rectangle - it is replaced by “shyo”;

The bigram “ni” forms a rectangle - is replaced by “an”;

The bigram “ee” forms a rectangle and is replaced by “gi”.

The code is “zhb yue xs yzh ba am gt ka pa she an gi.”

To decrypt, you must use the inversion of these rules, discarding the characters I(or X) if they do not make sense in the original message.

It consisted of two disks - an external fixed disk and an internal movable disk, on which the letters of the alphabet were printed. The encryption process involved finding the letter plaintext on external drive and replacing it with the letter s internal disk, standing under her. After this, the internal disk was shifted one position and the second letter was encrypted using the new cipher alphabet. The key to this cipher was the order of the letters on the disks and starting position internal disk relative to the external one.

Trisemus table. One of the ciphers invented by the German abbot Trisemus was a multi-alphabetic cipher based on the so-called “Trisemus table” - a table with sides equal to n, Where n– the number of characters in the alphabet. In the first row of the matrix the letters are written in the order of their order in the alphabet, in the second - the same sequence of letters, but with a cyclic shift by one position to the left, in the third - with a cyclic shift by two positions to the left, etc.

ABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUI
BINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIA
INGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIAB
GDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABIN
DEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABING
EYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGD
YoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDE
ANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYo
ZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoAND
ANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZ
YTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZAND
TOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDY
LMNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTO
MNABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOL
NABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLM
ABOUTPRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMN
PRWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUT
RWITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTP
WITHTUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPR
TUFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITH
UFXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHT
FXCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTU
XCHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUF
CHShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFX
HShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXC
ShSCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCH
SCHKommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHSh
KommersantYbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCH
YbEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersant
bEYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantY
EYUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYb
YUIABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbE
IABINGDEYoANDZANDYTOLMNABOUTPRWITHTUFXCHShSCHKommersantYbEYU

Fig.4.17. Trisemus Table

The first line is also an alphabet for plaintext letters. The first letter of the text is encrypted on the first line, the second letter on the second, and so on. After use last line back to the first one again. So the message “ABRAMOV” will take the form “AVTGRUZ”.

Vigenère encryption system. In 1586, the French diplomat Blaise Vigenère presented Henry before the commission III description a simple but fairly strong cipher based on the Trisemus table.

Before encryption, a key is selected from alphabetic characters. The encryption procedure itself is as follows. The i-th character of the open message in the first line determines the column, and the i-th character of the key in the leftmost column determines the row. At the intersection of the row and column there will be the i-th character placed in the ciphergram. If the key length is less than the message, then it is reused. For example, the original message is “ABRAMOV”, the key is “UNCLE”, the encryption code is “DAFIYOYE”.

In fairness, it should be noted that the authorship of this cipher belongs to the Italian Giovanni Batista Bellaso, who described it in 1553. History “ignored important fact and named the cipher after Vigenère, despite the fact that he did nothing to create it." Bellazo suggested calling Secret word or phrase password(Italian password; French parole - word).

In 1863, Friedrich Kasiski published an algorithm for attacking this cipher, although there are known cases of his cipher breaking by some experienced cryptanalysts before. In particular, in 1854 the cipher was cracked by the inventor of the first analytical computer Charles Babbage, although this fact became known only in the 20th century, when a group of scientists analyzed Babbage's calculations and personal notes. Despite this, the Vigenère cipher had a reputation for being extremely resistant to “manual” cracking. for a long time. Thus, the famous writer and mathematician Charles Lutwidge Dodgson (Lewis Carroll), in his article “The Alphabetic Cipher,” published in a children's magazine in 1868, called the Vigenère cipher unbreakable. In 1917, the popular science magazine Scientific American also described the Vigenère cipher as unbreakable.

Rotary machines. The ideas of Alberti and Bellaso were used to create electromechanical rotary machines in the first half of the twentieth century. Some of them were used in different countries up until the 1980s. Most of them used rotors (mechanical wheels), mutual arrangement which determined the current cipher alphabet used to perform the substitution. The most famous of the rotary machines is German car World War II Enigma.

The output pins of one rotor are connected to the input pins of the next rotor and when the original message symbol is pressed on the keyboard, an electrical circuit is completed, as a result of which the light bulb with the cipher replacement symbol lights up.

Fig.4.19. Enigma rotor system [www.cryptomuseum.com]

The encryption effect of the Enigma is shown for two keys pressed in succession - the current flows through the rotors, is “reflected” from the reflector, then again through the rotors.

Fig.4.20. Encryption scheme

Note. Gray lines show other possible electrical circuits inside each rotor. Letter A is encrypted differently when successive key presses are made, first in G, then in C. The signal is coming along a different route by turning one of the rotors after pressing the previous letter of the original message.

3. Describe the types of substitution ciphers.

If you are someone who uses div tags for everything on the site, this article is for you. We'll focus on how to write clean, semantic HTML using valid markup. You will see in practice how you can minimize the number of div tags in your HTML code. You will learn semantic layout not only in theory, but also through examples. Writing the right semantic templates makes life easier not only for yourself, but also for the team as a whole. Well, it’s easier for browsers that interpret the code. The less code, the faster the page loads. This also allows you to save time and ease of understanding of the code when creating big projects. In other words, semantic layout is necessary condition creating a quality website.

The concept of semantic layout

Semantics inHTML layout- this is the correspondence of tags to the information located inside them. Code semantics is also achieved by reducing the number of tags. Thus, we create clean, readable, valid HTML code. Such a page will load faster and be ranked by search engines.

How to achieve code semantics?

It’s simple, the main thing is to keep everything simple and try to put everything in CSS styles as much as possible, and JS code in separate file. According to the classics, on one HTML page Only one CSS file and one JS file should be included. Regarding HTML, each site has its own situation. After all, each of them is unique. Now let’s look at the main points where layout designers stumble:

  • Headings should be highlighted with H1, H2, H3, H4 tags, but not B and STRONG.
  • When creating a menu, it is best to use a UL list, which will contain LI menu elements. This shows that the links are equivalent. If there are items of the second nesting, we accordingly create another UL list inside the primary LI element.
  • All service images (icons, arrows, bullets...) must be written in CSS code. In HTML, IMG tag should only be used for large pictures. Large, the concept is flexible, let’s say, starting with previews 100 x 100 and higher.
  • A paragraph block of text is created using a P tag, not a DIV.
  • Do not use STYLE attributes inside HTML tag. Place all styles in separate CSS file.
  • The same goes for JavaScript.
  • Maintain document hierarchy and logic. More important page elements should be in beginning of HTML code, less at the end. WITH using CSS styles and DIV blocks, this is not difficult to achieve, with any template layout.
  • Maybe I forgot something else... if so, correct me in the comments to the article.

For greater clarity of the essence of the issue, see the semantic text markup diagram:

Semantic layout in practice - examples of HTML + CSS code

Now let’s consolidate all these principles of semantic layout in practice. We will analyze specific situations.

Removing unnecessary div tags

I've seen a lot of people create a div tag near the form or ul. Why create an extra div that you don't need? You can achieve the same result by adding a few guidelines in the CSS file.

Example 1:

The example below shows how you can remove the div tag and add the same style to the form selector.

Example 2:

Sometimes we wrap content in div block to create indents, as shown in the example on the left. But if each of the blocks has an h4 heading, we can simply apply a margin to the h4 selector and remove the extra div tag.

We use semantic code markup

As mentioned earlier, you should always use semantic markup for your HTML code. But this cannot be achieved without a CSS stylesheet.

Example:

The picture below shows the difference between div markup and semantic markup without css styles.

Minimizing the use of div tags

Maybe you've seen templates where div tags are everywhere... they piss me off. Did you have an extra closing /div tag, or an unclosed div? I'm sure every layout designer has encountered similar problem when there are 3-4 nearby div tag. To avoid confusion, you need to minimize the use of divs, this will make it easier to track errors.

Example 1:

Instead of using a div to create a navigation path, you can use a p tag.

Or substitutions. A table of one-to-one correspondence between the source text alphabet and code symbols is compiled, and in accordance with this table, one-to-one encoding occurs. To decode, you need to know the code table.

Exists big number codes used in different areas human life. Well-known codes are used mostly for the convenience of transmitting information in one way or another. If the code table is known only to the transmitter and receiver, then the result is a rather primitive cipher that is easily amenable to frequency analysis. But if a person is far from coding theory and is not familiar with frequency analysis of text, then it is quite problematic for him to unravel such ciphers.

A1Z26

The simplest cipher. Called A1Z26 or in the Russian version A1Я33. Letters of the alphabet are replaced by their serial numbers.

"NoZDR" can be encrypted as 14-15-26-4-18 or 1415260418.

Morse code

Letters, numbers and some signs are associated with a set of dots and dashes, which can be transmitted by radio, sound, knocking, light telegraph and flag signal. You can read more about Morse code on the page.

Braille

Braille is a tactile reading system for the blind, consisting of six-dot characters called cells. The cell consists of three dots in height and two dots in width.

Different braille characters are formed by placing dots at different positions within a cell.

For convenience, the points are described when reading as follows: 1, 2, 3 from the left from top to bottom and 4, 5, 6 from the right from top to bottom.

When composing the text, adhere to the following rules:

    one cell (space) is skipped between words;

    after comma and semicolon the cell is not skipped;

    a dash is written together with the previous word;

    a digital sign is placed in front of the number.

Code pages

In computer quests and riddles, letters can be encoded according to their codes in various code pages - tables used on computers. For Cyrillic texts, it is best to use the most common encodings: Windows-1251, KOI8, CP866, MacCyrillic. Although for complex encryption you can choose something more exotic.

You can encode hexadecimal numbers, or you can convert them to decimal. For example, the letter E in KOI8-R has the code B3 (179), in CP866 - F0 (240), and in Windows-1251 - A8 (168). Or you can look for a match for the letters in the right tables in the left ones, then the text will turn out to be typed in “crazy words” like èαᬫº∩íαδ (866→437) or Êðàêîçÿáðû (1251→Latin-1).

Here https://www.artlebedev.ru/tools/decoder/advanced/ There is a good decoder for such encrypted texts :)

Masonic cipher

The Masonic cipher is also known as “pigpen” or “tic-tac-toe”. This cipher is a simple substitution cipher in which each letter of the alphabet has a corresponding graphic symbol calculated from one of the grids below.

To encrypt a specific letter using this cipher, you must first locate where that letter is in one of the four grids, and then draw the portion of the grid that surrounds that letter. That is, something like this:

If you know the key (how the letters are arranged in the grids), then it is quite easy to unravel such an inscription. But if the letters in the grids are initially arranged according to some unknown rule (with keyword, one by one or even randomly), then in this situation it can always help

Usage graphic symbols instead of letters is not a big obstacle to cryptanalysis, and this system is identical to others simple circuits monoalphabetic substitution. Due to its simplicity, this cipher is often mentioned in children's books about encryption, secret writing and all sorts of other spy stuff.

The exact time of origin of the cipher is unknown, but some of the found records of this system date back to the 18th century. Variations of this cipher were used by the Rosicrucian Order and the Freemasons. The latter used it quite often in their secret documents and correspondence, which is why the cipher began to be called the Masonic cipher. Even on the tombstones of Masons you can see inscriptions using this code. Similar system encryption was used during the American Civil War by George Washington's army, as well as by prisoners in federal prisons of the Confederate States of the United States.

Below are two (blue and red) options for filling the grid of such ciphers. The letters are arranged in pairs, the second letter from the pair is drawn with a symbol with a dot:

Copyright ciphers

A great variety of ciphers, where one character of the alphabet (letter, number, punctuation mark) corresponds to one (rarely more) graphic sign, has been invented. Most of them were invented for use in science fiction films, cartoons and computer games. Here are some of them:

Dancing men

One of the most famous author's substitution ciphers is "". It was invented and described by the English writer Arthur Conan Doyle in one of his works about Sherlock Holmes. The letters of the alphabet are replaced by symbols that look like little men in different poses. In the book, little men were not invented for all letters of the alphabet, so fans creatively modified and reworked the symbols, and the result was this cipher:

Thomas More's Alphabet

But such an alphabet was described by Thomas More in his treatise “Utopia” in 1516:

Bill Cipher from the animated series "Gravity Falls"

Jedi alphabet from Star Wars

Alien alphabet from Futurama

Superman's Kryptonian alphabet

Bionicle alphabets

And judging by the reasoning that was in the comments, I would like to clarify one important point, which you need to understand before talking about the HTML language and the tags it uses.

This moment lies in understanding such an important concept as code semantics. Let's try to understand this issue in this post and why all this is needed.

What's happened code semantics?

Semantics(from a linguistic point of view) is the meaning, information content of a language or its individual unit.

As we know, structural units HTML language are tags, they are the very individual units that carry meaning, information content.

When we have some information in front of us that needs to be presented on a web page on the Internet, first of all, we must explain to the computer which part of this information is what. Without knowing this, it simply will not be able to display all the content correctly.

Thus, when we create a web page using the HTML language, we explain to the computer which element should play what role on the page.

We must understand that the content of each element of a web page must be enclosed in tags that correspond to their logical and semantic purpose.

Those. headings in the text would be contained in tags h 1-h 6, paragraphs in tags p, lists in tags ul / ol (li), etc.

Code that meets these conditions is called semantic those. each element on a web page corresponds to correct semantic meaning.

Now the question is, can we enclose a heading on a web page in a paragraph tag?
Why not? Of course we can. Many will say, but in this case we lose the design that the headings h 1-h 6 have. But, in fact, design does not play any role here. By using CSS styles, we can assign to any paragraph exactly the same design that the element h 1-h 6 had.

The conclusion that we must draw from this is that the semantics of the code and the design are two different things that should not be confused with each other. A specific design is assigned to each tag, but it can be easily changed, but the semantic meaning of this tag cannot be changed.

We can enclose the heading in a paragraph, but in this case the semantics of the code are lost and this text will carry a completely different meaning.

Therefore, before enclosing an element in any tag, it is advisable to think about what function and meaning it carries on the page?

A logical question arises: why, in this case, do we need code semantics at all?

Why should headings be made into headings, paragraphs be made into paragraphs, abbreviations be made into abbreviations, etc.?

In my opinion, there are several reasons that will help you lean towards semantic code. What does semantic markup give us?

1) Information about how the default browser should display this or that element on the page;

For example, we know that heading h 1, if not given any special styles, is displayed on a page of 2em size and in bold. But, in my opinion, this is the most insignificant reason.

2) Semantic code is better read and perceived by search engines;

It is believed that a page that has semantic markup, all other things being equal, will be ranked higher in the search results search engines than a page with non-semantic code.

2) The code is more understandable for humans;

Agree that you need to understand the code, where everything is clearly stated that this part of the text is a paragraph, this is an abbreviation, etc. much easier than with code, where all the information comes in one continuous structure and it is not clear what the author wanted to say.

3) It is easier to access the element and, as a result, greater flexibility.

By making your code semantic, you can access these elements much more easily using special means, which operate on elements on web pages, e.g. CSS languages, Javascript, etc.

If you enclose all the abbreviations on your page in the abbr tag, then in CSS, in order for all the abbreviations on your page to turn red, it will be enough to simply write.

abbr (color :red ;)

Instead of highlighting and prescribing this rule in HTML for each individual abbreviation.

This is just one example, of which there are many.

For these reasons, it must be understood that semantic code it just gives our document more options. We can use some tags to improve the semantics of the site and gain greater functionality, or we can not use them and not receive these benefits.

That's your business!

You must make this decision for yourself.