Semantically correct code. Discussions about the semantics of HTML code with examples

Web designers and developers love to throw around jargon and abstruse phrases that are sometimes difficult for us to understand. This article will focus on semantic code. Let's figure out what it is!

What is semantic code?

Even if you're not a web designer, you probably know that your site was written in HTML. HTML was originally intended as a means of describing the content of a document, rather than as a means of making it look visually pleasing. Semantic code returns to this original concept and encourages web designers to write code that describes content, rather than what it should look like. For example, the page title could be programmed as follows:

This is the page title

This would make the title large and bold, giving it the appearance of a page title, but there is nothing in it that describes it as a “title” in the code. This means that the computer cannot recognize it as the title of the page.

When writing a title semantically, in order for the computer to recognize it as a “title”, we must use the following code:

This is the title

The appearance of the header can be defined in a separate file called “cascading style sheets” (CSS), without interfering with your descriptive (semantic) HTML code.

Why is semantic code important?

The computer's ability to correctly recognize content is important for several reasons:

  • Many visually impaired people rely on speech browsers to read pages. Such programs will not be able to accurately interpret pages unless they have been clearly explained. In other words, semantic code serves as a means of accessibility.
  • Search engines need to understand what your content is about in order to rank you correctly in search engines. Semantic code has a reputation for improving your search engine placements because it is easily understood by search engine crawlers.

Semantic code also has other advantages:

  • As you can see from the example above, the semantic code is shorter and loading is faster.
  • Semantic code makes site updates easier because you can apply header styles throughout the site rather than on a page-by-page basis.
  • Semantic code is easy to understand, so if a new web designer picks up the code, it will be easy for them to parse.
  • Since semantic code does not contain design elements, it is then possible to change the appearance of a website without recoding all the HTML.
  • Once again, because design is kept separate from content, semantic code allows anyone to add or edit pages without needing a good eye for design. You simply describe the content, and CSS determines how that content will look.

How can you make sure a website is using semantic code?

There is currently no tool that can check for semantic code. It all comes down to checking for colors, fonts, or layouts in the code instead of describing the content. If code analysis sounds scary, a great starting point is to ask your web designer - is he coding with semantics in mind? If he looks at you blankly or starts making ridiculous chatter, then you can be sure that he is not coding this way. At this moment you must decide whether to give him a new direction in his work, or find yourself a new designer?!

MATHEMATICS

Vestn. Ohm. un-ta. 2016. No. 3. P. 7-9.

UDC 512.4 V.A. Romankov

OPTION OF SEMANTICALLY STRONG ENCRYPTION BASED ON RSA*

The main goal of the article is to propose another way to select one of the main parameters of an encryption scheme based on the RSA cryptographic system, proposed by the author in previous works. The original version is based on the computational complexity of determining the orders of elements in multiplicative groups of modular rings. The proposed method changes this basis to another intractable problem of determining whether the elements of multiplicative groups of modular rings belong to powers of these groups. A special case of such a problem is the classical problem of determining the quadraticity of a residue, which is considered computationally difficult. This task determines the semantic strength of the well-known Goldwasser-Micali encryption system. In the proposed version, the semantic strength of the encryption scheme is based on the computational complexity of the problem of determining whether the elements of multiplicative groups of modular rings belong to the degrees of these groups.

Keywords: RSA cryptographic system, public key encryption, modular ring, quadratic residue, semantic strength.

1. Introduction

The purpose of this work is to introduce new elements for the RSA-based version of the encryption scheme introduced by the author in . Namely: another way of specifying the subgroups appearing in this diagram is proposed. This method leads to the replacement of the underlying computationally complex problem of determining the orders of elements of multiplicative groups of modular rings with the computationally complex problem of entering given powers of these groups. A special case of the latter problem is the classical problem of determining the quadraticity of the residue of an element of the multiplicative group of a modular ring.

The RSA public key encryption system was introduced by Rivest, Shamir and Adleman in 1977. It is widely used throughout the world and is included in almost all cryptography textbooks. Regarding this system and its cryptographic strength, see, for example.

The basic version of the system is deterministic and for this reason does not have the property of semantic secrecy, the most important indicator of the cryptographic strength of a public key encryption system. Therefore, in practice, variants of the system are used, the purpose of which is to introduce a probabilistic element into it and thereby ensure the fulfillment of the property of semantic secrecy.

Installation: encryption platform

Let n be the product of two large distinct primes p and q. The residue ring Zn is chosen as a platform for the encryption system. Module n and platform Zn are open elements of the system, numbers p and q are secret.

* The study was supported by the Russian Foundation for Basic Research (project 15-41-04312).

© Romankov V.A., 2016

Romankov V.A.

The Euler function is denoted by φ:N ^ N, in this case taking the value φ(n)= (p-1)(q-1). Thus, the order of the multiplicative group Z*n of the ring Zn is (p-1)(q-1). Regarding these concepts, see, for example.

Next, two subgroups M and H of the group Z*n of coprime periods r and t, respectively, are selected. It is proposed to define these subgroups through their generating elements M = gr(g1,...,gk), H = gr(j1,...,hl). Recall that the period t(G) of a group G is the smallest number t such that dr = 1 for any element geG. The period of the group Z*n is the number t (n), equal to the least common multiple of the numbers p-1 and q-1. Subgroups M and H can be cyclic and defined by one generating element. The generating elements of the subgroups M and H are considered open, while the periods of the subgroups r and t are considered secret.

In and it is explained how to effectively carry out the specified selection of subgroups M and H, knowing the secret parameters p and q. Moreover, you can first set r and t, and then select p and q, and only then carry out further actions. Note that the construction of elements of given orders in finite fields is performed by a standard effective procedure, described, for example. The transition to constructing elements of given orders in multiplicative groups Z*n of modular rings Zn is carried out in an obvious way using the Chinese Remainder Theorem or . Installation: selection of keys The encryption key e is any natural number coprime to r. The decryption key d = ^is calculated from the equality

(te)d1 = 1 (modr). (1)

The key d exists because the parameter d1 is calculated due to the mutual primeness of te and r. The key e is public, the key d and the parameter d1 are secret.

Encryption algorithm To transmit a message over an open network - m element of the subgroup M, Alice selects a random element h of the subgroup H and calculates the element hm. The transmission looks like

c = (hm)e (modn). (2)

Decryption algorithm

Bob decrypts the received message c as follows:

cd=m(modn). (3)

Explanation of correct decryption

Since ed=1 (modr), there is an integer k such that ed = 1 + rk. Then

cd = (hm)ed = (ht)edi m (mr)k = m (mod n). (4) So, the element h is written as an element of the subgroup H in the form of the value of the group word u(x1,.,xl) from the generating elements h1t... ,hl of the subgroup H. In fact, we

choose the word u(x1,.,xl), and then calculate its value h = u(h1t..., hl). In particular, this means that the generating elements h1t... ,hl are open.

Cryptographic strength of the scheme

The cryptographic strength of the scheme is based on the difficulty of determining, from given generating elements of the subgroup H of the group Z*n, the period or order of this subgroup. If the order of an element could be calculated by an efficient algorithm, then by counting the orders o rd(h1), ..., ord(hl) of the generating elements of the subgroup H, we could find its period t = t(H), equal to their least common multiple . This would make it possible to remove the shadowing factor h from this encryption option by transforming c1 = met(modri), reducing the decryption procedure to the classical RSA system with a public encryption key et.

3. Another way to define the subgroup H

This paper proposes another option for specifying the subgroup H in the encryption scheme under consideration. First, let us consider its special case, associated with the recognized intractable problem of determining the quadraticity of the residue of the group Z*n. Recall that the residue aeZ^ is called quadratic if there is an element xeZ*n such that x2= a (modn). All quadratic residues form a subgroup QZ*n of the group Z*n. The problem of determining the quadraticity of an arbitrary residue of a group is considered computationally intractable. The well-known semantically strong Goldwasser-Micali encryption system is based on this property. Its semantic stability is completely determined by the intractability of the problem of determining the quadraticity of a residue.

Suppose the parameters p and q are chosen with the condition p, q = 3 (mod 4), i.e. p = 4k +3, q = 41 +3. In schemes related to the quadratic nature of residues, this assumption looks natural and occurs quite often. If it holds, the mapping p:QZ*n ^ QZ*n, p:x^x2, is a bijection.

The subgroup of quadratic residues QZ*n of the group has an index of 4 in Z*n, see, for example. Its order o^^2^) is equal to φ(n)/4 = (4k + 2)(41 + 2)/4= 4kl + 2k + 21 + 1, i.e. it is an odd number.

In the above encryption scheme we assume H = QZ*n. Any element of the subgroup H has an odd order, since the period t(Z*n), equal to the least common multiple of the numbers p - 1 = 4k +2 and q - 1 = 41 +2, is divisible by 2, but not divisible by 4. Maximum a possible choice for M is a subgroup of order 4 whose elements have even orders 2 or 4. If there is an efficient way to calculate the order (or at least its parity) of an arbitrary element

Semantically strong encryption option based on RSA

group 2*n, then the problem of determining the quadraticity of a residue is effectively solved. The disadvantage of the scheme with this choice is the low power of the space of texts - subgroup M. In fact, the scheme duplicates the already mentioned well-known Gol-Dwasser-Micali scheme.

We get greater opportunities with our next choice. Let s be a prime number that can be considered large enough. Let p and q be prime numbers such that at least one of the numbers p - 1 or q - 1 is divisible by s. It is explained that one can choose s and then effectively find p or q with the given property. Let's say the number p is searched for in the form 2sx +1. x is changed and the resulting p is checked for simplicity until it turns out to be simple.

Let us define a subgroup Н =, consisting of s-powers of elements of the group 2*n (for s = 2 this is the subgroup QZ*n). If p = 52k + su + 1 and q = 521 + sv +1 (or q = sl + V +1), where the numbers u and V are not divisible by s, then the order o^(H) of the subgroup H having 2 in the group *n index b2 (or index s, if q = sl + V +1) is equal to B2k1 + Bku + b1n + w>. This order is coprime to s. In particular, this means that the elements of the subgroup H have orders not divisible by s. If an element is outside the subgroup H, then its order is divided by s, since s divides the group order. If the problem of calculating the order of an element of the group 2*n (or determining its divisibility by s) is effectively solvable in the group 2*n, then the problem of entering a subgroup is also effectively solved in it

When choosing the subgroup H in this way, we have the opportunity to choose as M a cyclic subgroup of order r = 52 (or order s). Such a subgroup exists because the order of the group 2*n, equal to (p-1)^-1) = (52k + vi)^21 + sv) (or (52k + vi)^1 + V)), is divisible by 52 (on s). To specify H, it is enough to specify s. Moreover, for any choice of subgroup M we have M*2 =1. If, when decrypting a message m, it is possible to obtain an element of the form tel, where ed is coprime with s, then by finding integers y and z such that edy + s2z = 1, we can calculate teL = m.

However, the generating elements of the subgroup H are not indicated when specifying the type, therefore, if there is an algorithm for calculating the orders of the elements of the group 2*n, this does not allow calculating the period of the subgroup

H, which would have been possible in the original version from .

The cryptographic strength of the version of the scheme is based on the difficulty of determining the order of the element of the group 2*n. In the proposed version, it is based on the difficulty of determining the period of the Z*s subgroup. Semantic strength Let it be known that c = (hm")e (modn) is an encrypted message of the form (2), where heH, m" = m1 or m" = m2. Encryption is considered semantically strong if it is impossible to effectively determine what all -does correspond to c. The correct answer mt (i = 1 or 2) is obtained if and only if cmje belongs to H. This means that the encryption is semantically strong if and only if the problem of occurrence in H is effectively undecidable in the case considered in this article. is the problem of entering into the subgroup of s-residues Z*s. In the special case s = 2, we obtain the well-known, considered intractable problem of entering into Q2*n, on which the semantic strength of the Goldwasser-Micali encryption system and a number of other encryption systems is based.

LITERATURE

Romankov V. A. New semantically strong public key encryption system based on RSA // Applied discrete mathematics. 2015. No. 3 (29). pp. 32-40.

Rivest R., Shamir A., ​​Adleman L. A method for obtaining digital signatures and public-key cryptosystems // Comm. ACM. 1978. Vol. 21, No. 2. P. 120126.

Hinek M. Cryptanalysis of RSA and its variants. Boca Raton: Chapman & Hall/CRC, 2010.

Song Y. Y. Cryptanalytic attacks on RSA. Berlin: Springer, 2008.

Stamp M., Low R.M. Applied cryptanalysis. Breaking ciphers in the real world. Hoboken: JohnWiley&Sons, 2007.

Roman"kov V.A. New probabilistic public-key encryption based on the RAS cryptosystem // Croups, Complexity, Cryptology. 2015. Vol. 7, No. 2. P. 153156.

Romankov V.A. Introduction to cryptography. M.: Forum, 2012.

Menezes A., Ojrschot P.C., Vanstone S.A. Handbook of Applied Cryptography. Boca Raton: CRC Press, 1996.

Goldwasser S., Micali S. Probabilistic encryption and how to play mental poker keeping secret all partial information // Proc. 14th Symposium on Theory of Computing, 1982, pp. 365-377.

Semantics(French sémantique from ancient Greek σημαντικός - denoting) - the science of understanding certain signs, sequences of symbols and other symbols. This science is used in many fields: linguistics, proxemics, pragmatics, etymology, etc. I can’t imagine what these words mean and what all these sciences do. And it doesn’t matter, I’m interested in the issue of using semantics in website layout.

The note

I will not touch on the term Semantic Web here. At first glance, it may seem that the topics Semantic Web and semantic HTML code are almost the same thing. But in fact, the Semantic Web is a rather philosophical concept and does not have much in common with current reality.

Semantic layout - what is it?

In a language, every word has a specific meaning and purpose. When you say “sausage,” you mean a food product that is minced meat (usually meat) in an oblong casing. In short, you mean sausage, not milk or green peas.

HTML is also a language, its “words” called tags also have a certain logical meaning and purpose. For this reason, first of all semantic HTML code is a layout with the correct use of HTML tags, using them for their intended purpose, as they were intended by the developers of the HTML language and web standards.

microformats.org is a community that works to bring the idealistic ideas of the Semantic Web to life by bringing page layout closer to those same semantic ideals.

Why and who needs semantic layout at all?

If information on my website is displayed the same way as on the design, why bother racking your brain and thinking about some kind of semantics?! This is extra work! Who needs this?! Who will appreciate this except another layout designer?

I often heard such questions. Let's figure it out.

Semantic HTML for web developers

Semantic code for users

Increases the availability of information on the site. First of all, this is important for alternative agents such as:

  • semantic code directly affects the amount of HTML code. Less code -> lighter pages -> load faster, less RAM required on the user side, less traffic, smaller database size. The site becomes faster and less expensive.
  • voice browsers for whom tags and their attributes are important in order to pronounce the content correctly and with the right intonation, or, conversely, not to say too much.
  • mobile devices which do not fully support CSS and therefore rely mainly on HTML code, displaying it on the screen according to the tags used.
  • printing devices even without additional CSS, the information will be printed with better quality (closer to the design), and creating the ideal version for printing will turn into a few easy manipulations with CSS.
  • In addition, there are devices and plugins that allow you to quickly navigate through a document - for example, by headings in Opera.

Semantic HTML for machines

Search engines are constantly improving their search methods to ensure that the results contain the information you want. really looking for user. Semantic HTML facilitates this because... lends itself to much better analysis - the code is cleaner, the code is logical (you can clearly see where the headings are, where the navigation is, where the content is).

Good content plus high-quality semantic layout is already a serious application for good positions in search engine results.

(substitutions). In substitution ciphers, letters are changed to other letters from the same alphabet; when encoding, letters are changed to something completely different - pictures, symbols of other alphabets, sequences of various characters, etc. 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.

There are a large number of codes used in different areas of 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. Since sailors also have a corresponding flag associated with each letter, it is possible to convey a message using flags.

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 using hexadecimal numbers, or you can convert them to decimal numbers. 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).

Or you can change the upper half of the characters to the lower half within one table. Then for Windows-1251, instead of “krakozyabry” you get “jp"jng ap(), instead of “HELICOPTER” - “BEPRNK(R”. Such a shift in the code page is a classic loss of the most significant bit during failures on mail servers. Latin characters in this case can be encoded with a reverse shift down by 128 characters. And such an encoding will be a variant of the cipher - ROT128, only not for the regular alphabet, but for the selected code page.

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. A similar encryption system 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:

Ciphers from the animated series "Gravity Falls"

Bill Cipher

Stanford Pines (diarist)

Jedi alphabet from Star Wars

Alien alphabet from Futurama

Superman's Kryptonian alphabet

Bionicle alphabets