RU2811065C1 - Method for byte-by-byte transmission of information using stream encryption - Google Patents
Method for byte-by-byte transmission of information using stream encryption Download PDFInfo
- Publication number
- RU2811065C1 RU2811065C1 RU2023103229A RU2023103229A RU2811065C1 RU 2811065 C1 RU2811065 C1 RU 2811065C1 RU 2023103229 A RU2023103229 A RU 2023103229A RU 2023103229 A RU2023103229 A RU 2023103229A RU 2811065 C1 RU2811065 C1 RU 2811065C1
- Authority
- RU
- Russia
- Prior art keywords
- matrix
- sql
- byte
- character
- characters
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims description 12
- 230000005540 biological transmission Effects 0.000 title claims description 3
- 239000011159 matrix material Substances 0.000 claims abstract description 107
- 229910002056 binary alloy Inorganic materials 0.000 abstract 1
- 239000000126 substance Substances 0.000 abstract 1
- 238000004364 calculation method Methods 0.000 description 7
- 230000009466 transformation Effects 0.000 description 5
- 238000000844 transformation Methods 0.000 description 5
- 239000010410 layer Substances 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
Images
Abstract
Description
Изобретение относится к криптографии, в частности к способам поточного шифрования, в которых используется побайтная передача информации на основе таблицы кодирования символов ASCII.The invention relates to cryptography, in particular to stream encryption methods that use byte-by-byte information transfer based on the ASCII character encoding table.
В описании использованы следующие термины.The following terms are used in the description.
ASCII – (англ. American standard code for information interchange) - название таблицы (кодировки, набора), в которой некоторым распространённым печатным и непечатным символам сопоставлены числовые коды.ASCII – (English: American standard code for information interchange) - the name of a table (encoding, set) in which numeric codes are associated with some common printed and non-printable characters.
Алгоритмы шифрования делятся на две группы: алгоритмы симметричного шифрования и алгоритмы ассиметричного шифрования. В алгоритмах симметричного шифрования, которые также делятся на две большие группы: поточные и блочные, отправитель информации и получатель информации имеют одинаковые ключи, а в алгоритмах ассиметричного шифрования отправитель информации и получатель информации имеют по два ключа каждый – открытый и закрытый.Encryption algorithms are divided into two groups: symmetric encryption algorithms and asymmetric encryption algorithms. In symmetric encryption algorithms, which are also divided into two large groups: stream and block, the sender of information and the recipient of information have the same keys, and in asymmetric encryption algorithms the sender of information and the recipient of information have two keys each - public and private.
В алгоритмах симметричного шифрования передача ключей шифрования является слабым местом. Например, если фирма состоит из t филиалов, включая головной офис, то для обеспечения обмена информацией между всеми филиалами необходимо t·(t-1)/2, но время от времени старые ключи необходимо менять на новые ключи, что усложняет работу. In symmetric encryption algorithms, the transmission of encryption keys is a weak point. For example, if a company consists of t branches, including the head office, then t·(t-1)/2 is required to ensure the exchange of information between all branches, but from time to time old keys must be replaced with new keys, which complicates the work.
В настоящее время для шифрования открытого текста широкое применение нашли алгоритмы поточного шифрования, которые в отличие от блочного шифрования выполняют преобразование информации, поступающей от источника сообщений как по одному биту, так по 1 байту (8 бит). Таким образом, алгоритм поточного шифрования может преобразовывать поступающую информацию в момент её получения.Currently, stream encryption algorithms are widely used for plaintext encryption, which, unlike block encryption, transform information coming from the message source either one bit at a time or one byte (8 bits). Thus, the stream encryption algorithm can transform incoming information at the moment it is received.
Недостатком поточного шифрования, как было отмечено ранее, является необходимость получения нового ключа (гаммы) для шифрования, поступающей информации. Возможно вместо передачи нового ключа произвести его вычисление, как на стороне отправителя, так и получателя информации по одинаковому алгоритму путем матричных преобразований на основе передаваемых коэффициентов. The disadvantage of stream encryption, as noted earlier, is the need to obtain a new key (gamma) to encrypt incoming information. It is possible, instead of transmitting a new key, to calculate it, both on the side of the sender and the recipient of information using the same algorithm by means of matrix transformations based on the transmitted coefficients.
То есть вместо передачи ключа произвести обмен коэффициентами между отправителем и получателем информации и на их основе c помощью матричных преобразований вычислять ключи.That is, instead of transmitting the key, exchange coefficients between the sender and recipient of information and, based on them, using matrix transformations, calculate the keys.
Известны алгоритм шифрования RC-4 – класс алгоритмов, определяемых размером его блока или слова – параметром n. В том случае, когда n = 8 бит или 1 байт, то тогда внутреннее состояние RC-4(S-бокс) состоит из массива размером 28 слов, то есть внутреннее состояние включает 256 элементов (0,1,2,….255). The RC-4 encryption algorithm is known - a class of algorithms determined by the size of its block or word - the parameter n. In the case when n = 8 bits or 1 byte, then the internal state of RC-4 (S-box) consists of an array of 2 8 words in size, that is, the internal state includes 256 elements (0,1,2,….255 ).
Наиболее близким аналогом к заявляемому изобретению является способ шифрование, известный из патента RU 2783406, в котором рассматривается побитовое поточное шифрование с использованием матричных преобразований.The closest analogue to the claimed invention is the encryption method known from patent RU 2783406, which considers bit-stream encryption using matrix transformations.
Однако при использование данного технического решения каждый символ открытого текста нужно переводить в набор нулей и единиц в соответствии с используемым алфавитом и складывать по модулю два с набором нулей и единиц матрицы SQL и отправлять получателю данную информацию. However, when using this technical solution, each plaintext character must be translated into a set of zeros and ones in accordance with the alphabet used and added modulo two with the set of zeros and ones of the SQL matrix and sent this information to the recipient.
Преимуществом заявляемого изобретения является использование стандартной таблицы кодирования символов ASCII при поточном шифровании.The advantage of the claimed invention is the use of a standard ASCII character encoding table for stream encryption.
Техническим результатом изобретения является упрощение процесса шифрования и расшифрования текста, сокращение временных и вычислительных затрат.The technical result of the invention is to simplify the process of encrypting and decrypting text, reducing time and computational costs.
В предлагаемой заявке нет необходимости каждый символ открытого текста переводить в набор нулей и единиц – каждому символу соответствует своё число в двоичной системе счисления, которое будет суммироваться по модулю два с элементом результирующей матрицы SQL, также представленным в соответствующей форме и отправляться получателю информации. In the proposed application, there is no need to convert each plaintext character into a set of zeros and ones - each character corresponds to its own number in the binary number system, which will be summed modulo two with an element of the resulting SQL matrix, also presented in the appropriate form and sent to the recipient of the information.
Сущность заявляемого изобретения заключается в том, что в способе побайтной передачи информации с помощью поточного шифрования создают матрицу состояния SQ, записывая числа по порядку от 0 до 255; выбирают вариант построения вспомогательной матрицы-ключа KQ; производят вычисление вспомогательной матрицы-ключа KQ; производят вычисление результирующей матрицы SQL по формуле: SQL = SQ ⊕ KQ mod 256. Элементы результирующей матрицы SQL(sqlij) и будут являться гаммой(ключом) используемыми при сложении с символами открытого текста. Полученные числовые значения элементов матрицы SQL переводят в двоичную систему счисления, соответствующую таблице символов ASCII, символы открытого текста записывают с помощью таблицы символов ASCII, получая значение символа Xi, соответствующее символу открытого текста, записанное в двоичной системе счисления и далее суммируют по модулю два один байт символов ASCII, соответствующий символу открытого текста Xi с элементом матрицы sqlij, получая зашифрованное сообщение Yi, передают зашифрованное сообщение Yi.The essence of the claimed invention lies in the fact that in the method of byte-by-byte information transfer using stream encryption, a state matrix SQ is created, writing numbers in order from 0 to 255; select the option of constructing an auxiliary key matrix KQ; calculating the auxiliary key matrix KQ; calculate the resulting matrix SQL using the formula: SQL = SQ ⊕ KQ mod 256. Elements of the resulting matrix SQL(sqlij) and will be the gamma (key) used when adding with plaintext characters. The resulting numeric values of the SQL matrix elements are converted to the binary number system corresponding to the ASCII character table, the plaintext characters are written using the ASCII character table, obtaining the value of the character Xi, corresponding to the plaintext character, written in binary number system and then sum modulo two one byte of ASCII characters corresponding to the plaintext character Xi with sql matrix elementij, receiving encrypted message Yi, transmit an encrypted message Yi.
Применение n = 8 даёт возможность использовать таблицу символов, например, ASCII, в которой символы – буквы алфавита, цифры, арифметические операции, и другие знаки также представлены в виде 8 битовых значений, например символ A – 01000001, символ B – 01000010, символ C – 01000011 и так далее.The use of n = 8 makes it possible to use a character table, for example, ASCII, in which characters - letters of the alphabet, numbers, arithmetic operations, and other characters are also represented as 8 bit values, for example character A - 01000001, character B - 01000010, character C – 01000011 and so on.
С другой стороны, с помощью подхода, основанного на матричных преобразованиях [Дедов О.П. Применение матричного подхода к поточному шифрованию. Электронный научный журнал «E-Scio.ru», 2021.-5с, далее – Источник 1] возможно сформировать результирующую матрицу, элементы которой являются гаммой (ключом), также состоящую из 256 чисел, записанных в виде 8 битовых значений символов: 0 – 00000000, 1 – 00000001, 2 – 00000010 и т.д., и суммируя символы открытого текста и вычисленные с помощью матричных преобразований элементы результирующей матрицы (гаммы), по модулю два производить побайтовое шифрование открытого текста.On the other hand, using an approach based on matrix transformations [Dedov O.P. Application of the matrix approach to stream encryption. Electronic scientific journal “E-Scio.ru”, 2021.-5с, hereinafter referred to as Source 1] it is possible to form a resulting matrix, the elements of which are a gamma (key), also consisting of 256 numbers written as 8 bit character values: 0 – 00000000, 1 – 00000001, 2 – 00000010, etc., and summing the plaintext characters and the elements of the resulting matrix (gamma) calculated using matrix transformations, modulo two to produce byte-by-byte encryption of the plaintext.
Заявляемое изобретение поясняется фигурами 1-2, на которых показаны:The claimed invention is illustrated in figures 1-2, which show:
- фиг. 1 – схема алгоритма поточного шифрования;- fig. 1 – diagram of the stream encryption algorithm;
- фиг. 2 – блок-схема предлагаемого алгоритма поточного шифрования.- fig. 2 – block diagram of the proposed stream encryption algorithm.
На фигуре 1 Xi i-ый байт открытого текста и sqlij элемент матрицы SQL, записанный в виде одного байта, находящийся в ячейке – Ki, где 0 ≤ i<≤255.On the figure 1 Xii-th byte of plaintext and sqlij SQL matrix element, written as a single byte, located in cell – Ki, where 0 ≤ i<≤255.
SQL – результирующая матрица, элементы которой sqlij [Источник 1, С.А.Белецкий, О.П.Дедов, С.И.Журавлёв. Построение многослойной и бесконечной гаммы для поточного шифрования. Промышленные АСУ и Контроллеры. DOI: 10.25791/ asu.10.2022.1392 стр.39-43 – далее Источник 2] вычисляются по формулеSQL is the resulting matrix, the elements of which are sql ij [Source 1, S.A. Beletsky, O.P. Dedov, S.I. Zhuravlev. Construction of multi-layer and infinite scale for stream encryption. Industrial automated control systems and controllers. DOI: 10.25791/ asu.10.2022.1392 pp. 39-43 – further Source 2] are calculated using the formula
SQL= SQ + KQ mod 2n, (1)SQL= SQ + KQ mod 2 n , (1)
где SQ – матрица состояния;where SQ is the state matrix;
КQ – матрица-ключа; KQ – key matrix;
SQL – результирующая матрица, элементы которой, переведённые в двоичную систему счисления, будут выступать в роли гаммы. SQL is the resulting matrix, the elements of which, converted to the binary number system, will act as a gamma.
Причём в Источнике 1 было показано, что при n = 4 параметр N, определяющий размер квадратных матриц SQ, КQ и SQL, вычисляется по формуле (1).Moreover, in Source 1 it was shown that for n = 4, the parameter N, which determines the size of the square matrices SQ, KQ and SQL, is calculated using formula (1).
N= 24/2= 22 = 4, (2)N= 2 4/2 = 2 2 = 4, (2)
То есть матрицы SQ, КQ и SQL при n = 4 являются квадратными матрицами размера 4×4, а при n = 8 N будет равно 16, а это значит, что матрицы SQ, КQ и SQL будут квадратными матрицами размера 16×16, и каждая из них содержат по 256 элементов (чисел). Каждый элемент матрицы SQL (sglij) может быть представлен как последовательность восьми нулей и единиц, то есть одним байтом.That is, the matrices SQ, KQ and SQL with n = 4 are square matrices of size 4x4, and with n = 8 N will be equal to 16, which means that the matrices SQ, KQ and SQL will be square matrices of size 16x16, and each of them contains 256 elements (numbers). Each element of the SQL matrix (sgl ij ) can be represented as a sequence of eight zeros and ones, that is, one byte.
Таким образом, каждый символ открытого текста Xi c помощью таблицы символов ASCII, записанный в виде последовательности 8 битов, то есть одним байтом, может быть сложен по модулю два с элементами матрицы SQL (sglij), каждый из которых также записан виде восьми битовой последовательности (одним байтом), а в результате данного сложения получается Yi – зашифрованное значение Xi ,которое поступает вход получателя информации и расшифровывается там в обратном порядке, то есть сложением по модулю два с элементами результирующей матрицы SQL(sglij), вычисленным по аналогичному алгоритму.Thus, each plaintext character X i using the ASCII character table, written as a sequence of 8 bits, that is, one byte, can be added modulo two with the elements of the SQL matrix (sgl ij ), each of which is also written as an eight-bit sequence (one byte), and as a result of this addition, Y i is obtained - the encrypted value X i, which is received as input by the recipient of the information and is decrypted there in reverse order, that is, by adding modulo two with the elements of the resulting matrix SQL(sgl ij ), calculated by similar algorithm.
В Источнике 2 было рассмотрено вычисление квадратных матриц SQ, КQ и SQL для n=4 и следовательно N= 24/2= 22 = 4, и матрицы SQ, КQ , SQL имеют размер 4×4 , различными способами. Source 2 discussed the calculation of square matrices SQ, KQ and SQL for n=4 and therefore N= 2 4/2 = 2 2 = 4, and the matrices SQ, KQ, SQL are 4x4 in size, in various ways.
То есть на первом этапе есть матрица состояния S (в алгоритме RС 4) и матрица SQ в предлагаемом алгоритме шифрования (n = 4 и 24 = 16), которая включает 16 элементов числа – 0,1,2,….15 , расставленные по порядку. На втором этапе вычисляется матрица ключ KQ – аналог матрицы ключа К в алгоритме шифрования RС 4 (различными способами [Источник 2]). На третьем этапе вычисляется результирующая матрица SQL как сумма матриц SQ и КQ. Все матрицы SQ, КQ и SQL в [Источник 2] имеют одинаковый размер – 4×4.That is, at the first stage there is a state matrix S (in the RC 4 algorithm) and a matrix SQ in the proposed encryption algorithm (n = 4 and 2 4 = 16), which includes 16 number elements – 0,1,2,….15, arranged in order. At the second stage, the key matrix KQ is calculated - an analogue of the key matrix K in the RC 4 encryption algorithm (in various ways [Source 2]). At the third stage, the resulting matrix SQL is calculated as the sum of matrices SQ and KQ. All matrices SQ, KQ and SQL in [Source 2] have the same size - 4x4.
Матричный подход позволяет вычислять матрицу-ключ KQ различными способами [Источник 2], например, как произведение матрицы-столбца размера 4×1, на матрицу строку размера 1×4 по модулю 2n , а элементы матрицы столбца и матрицы строки могут выбираться также различными способам, либо с помощью датчика случайных чисел ДСЧ (среди чисел, находящихся в диапазоне от 1 до 2n -1) или выбираться как произведение матрицы-столбца на матрицу-строку (обе матрицы получены из матрицы состояний S( RC-4) или SQ [Источники 1, 2].The matrix approach allows you to calculate the key matrix KQ in various ways [Source 2], for example, as the product of a column matrix of size 4 × 1 by a row matrix of size 1 × 4 modulo 2 n , and the elements of the column matrix and row matrix can also be chosen in different ways methods, either using a random number sensor DNS (among numbers in the range from 1 to 2 n -1) or selected as the product of a column matrix by a row matrix (both matrices are obtained from the state matrix S(RC-4) or SQ [Sources 1, 2].
В Источниках 1,2 и наиболее близком аналоге рассмотрено вычисление матриц SQ, KQ, SQL для n=4.In Sources 1,2 and the closest analogue, the calculation of matrices SQ, KQ, SQL for n=4 is considered.
Так как n = 4, то все вычисления будут производиться по модулю 24 , то есть по модулю 16.Since n = 4, all calculations will be performed modulo 2 4 , that is, modulo 16.
При n = 4 матрица состояний SQ, состоит из 24 элементов и имеет вид:For n = 4, the state matrix SQ consists of 2 4 elements and has the form:
SQ = SQ=
Вычислим матрицу-ключа KQ одним из способов, рассмотренных в Источнике 2, как произведение второго столбца матрицы SQ на третью строку данной матрицы по модулю 16, то есть Let us calculate the key matrix KQ using one of the methods discussed in Source 2, as the product of the second column of the matrix SQ by the third row of this matrix modulo 16, that is
KQ = ×( 8 9 10 11) = mod 16 (3)KQ = ×(8 9 10 11) = mod 16 (3)
Элементы результирующей матрицы SQL будут вычисляться как сумма соответствующих элементов матриц SQ и KQ по модулю 16.The elements of the resulting SQL matrix will be calculated as the sum of the corresponding elements of the SQ and KQ matrices modulo 16.
SQL = SQ ⊕ KQ = mod 16SQL = SQ ⊕ KQ = mod 16
Данную результирующую матрицу SQL, полученную в результате однократного сложения матриц SQ и KQ назовём однослойной [Источник 2] и обозначим как SQL1. В Источнике 2 показано вычисление двух, трёхслойных матриц и многослойных матриц различными способами, в том числе умножением матрицы-ключа KQ на константу µ ( 1 < µ ≤ 15 ) n=4.We will call this resulting matrix SQL, obtained as a result of a single addition of matrices SQ and KQ, single-layer [Source 2] and denote it as SQL 1 . Source 2 shows the calculation of two-, three-layer matrices and multi-layer matrices in various ways, including multiplying the key matrix KQ by the constant µ ( 1 < µ ≤ 15 ) n=4.
Матрица SQL2 будет вычисляться по формуле (1) и называется двухслойной матрицей.The SQL 2 matrix will be calculated using formula (1) and is called a two-layer matrix.
SQL2 = SQL1 ⊕ KQ mod 16SQL2 = SQL1⊕ KQ mod 16
SQL2 = SQL 2 =
В том случае, когда происходит передача информации по одному байту, то есть при n = 8 , все рассматриваемые матрицы: матрица состояний SQ, матрица ключа KQ и результирующая матрица SQL будут иметь размерность 16×16 и состоять из 256 элементов каждая. Матрица состояния SQ, состоящая из 256 элементов, записанных по порядку будет иметь вид:In the case when information is transferred one byte at a time, that is, when n = 8, all matrices under consideration: the state matrix SQ, the key matrix KQ and the resulting matrix SQL will have a dimension of 16 × 16 and consist of 256 elements each. The SQ state matrix, consisting of 256 elements written in order, will look like:
Предположим, что матрица KQ (для n = 8) вычисляется аналогично вычислению KQ (для n = 4), как в рассмотренном ранее примере, то есть как произведение второго столбца матрицы SQ - ST(2,1) на третью строку STR(3,1) данной матрицы, но по модулю 256 вместо 16 (для n = 4).То естьLet us assume that the matrix KQ (for n = 8) is calculated similarly to the calculation of KQ (for n = 4), as in the example considered earlier, that is, as the product of the second column of the matrix SQ - ST(2,1) by the third row STR(3, 1) of this matrix, but modulo 256 instead of 16 (for n = 4). That is
KQ= ST(2) * STR(3)= *[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47] mod 256 (4)KQ= ST(2) * STR(3)= *[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47] mod 256 (4)
Таким образом, матрица KQ будет иметь вид:Thus, the KQ matrix will look like:
Тогда матрица SQL которая равна сумме матриц SQ и KQ вычисляется по формулеThen the SQL matrix which is equal to the sum of the SQ and KQ matrices is calculated by the formula
SQL = SQ ⊕ KQ mod 256, (5)SQL = SQ ⊕ KQ mod 256, (5)
примет следующий вид:will take the following form:
В общем виде матрица SQLi вычисляется по формуле:In general, the SQL i matrix is calculated using the formula:
SQLi= SQLi-1 + KQ mod 16, (6)SQL i = SQL i-1 + KQ mod 16, (6)
Каждый элемент данной матрицы sqlij, записанный в двоичном виде с помощью 8 бит, поступает на первый вход сумматора по модулю два (фиг.1), где складывается с символом открытого текста Xi, который также записан в виде 8 бит (при применении ASCII), и на выходе сумматора получается зашифрованный символ Yi, а дешифрование производится в обратном порядке на стороне получателя информации.Each element of this matrix sql ij , written in binary form using 8 bits, is supplied to the first input of the adder modulo two (Fig. 1), where it is added to the plaintext character X i , which is also written in the form of 8 bits (when using ASCII ), and at the output of the adder the encrypted symbol Y i is obtained, and decryption is performed in the reverse order on the side of the information recipient.
Таким образом, каждый символ открытого текста может быть зашифрован и передан получателю информации.Thus, each character of the plaintext can be encrypted and transmitted to the recipient of the information.
Заметим, что при шифровании можно использовать элементы матрицы sqlij как по порядку, то есть начиная с первого sql11 (первый символ открытого текста будет суммироваться по модулю два с sql11) и заканчивая последним sql255,255 или, как было указано в Источнике 1, элементы данной матрицы могут быть использованы в обратном порядке, то есть от sql255,255 до sql11.Note that when encrypting, you can use the elements of the sql ij matrix in order, that is, starting with the first sql 11 (the first character of the plaintext will be summed modulo two with sql 11 ) and ending with the last sql 255,255 or, as stated in Source 1, the elements of this matrix can be used in reverse order, that is, from sql 255,255 to sql 11 .
Кроме этого при применении матричного подхода, возможно, использовать группу элементов (40-100) матрицы SQL1 для шифрования части открытого текста, а потом перейти к таким же элементам матрицы SQL2 для шифрования второй части открытого текста т.д.In addition, when applying the matrix approach, it is possible to use a group of elements (40-100) of the SQL matrix 1 to encrypt part of the plaintext, and then move on to the same elements of the SQL matrix 2 to encrypt the second part of the plaintext, etc.
Данный алгоритм может быть реализован следующим образом. Во- первых, можно заранее обменяться значениями матриц SQL – на определённый срок (день, месяц) между отправителем и получателем информации. Во- вторых, на этапе «рукопожатие» («Handshakes») (фиг. 2) между отправителем и получателем информации происходит обмен коэффициентами, в качестве которых могут применяться числа, либо вырабатываемые с помощью ДСЧ выбираются элементы из чисел от 1 до 255, соответствующие элементам матрицы-столбца (16 чисел) и матрицы строки (16 чисел), а матрица KQ вычисляется как их произведение, либо как в рассмотренных ранее примерах можно указать номер столбца (α1) и номер строки (α2), при умножении которых по модулю 256 получается матрица ключа KQ, также можно указать значение коэффициента µ (α3), который может применяться при вычислении матрицы KQ [Источник 2] (в данной работе он был равен 5), а также указать количество элементов (α4), используемых при шифровании, если принято решение использовать при шифровании 40-100 символов матрицы SQL1 , а потом перейти к матрице SQL2 и далее к матрице SQLi и в этом случае необходимо указать номер элемента Ki (α5) с которого начинается отчёт. Все эти коэффициенты могут быть сведены в таблицу №1.This algorithm can be implemented as follows. Firstly, you can exchange the values of SQL matrices in advance - for a certain period (day, month) between the sender and recipient of the information. Secondly, at the “Handshakes” stage (Fig. 2), an exchange of coefficients takes place between the sender and the recipient of information, for which numbers can be used, or elements generated with the help of the random number are selected from numbers from 1 to 255, corresponding elements of the column matrix (16 numbers) and the row matrix (16 numbers), and the KQ matrix is calculated as their product, or, as in the previously discussed examples, you can specify the column number (α1) and row number (α2), when multiplied modulo 256 the key matrix KQ is obtained, you can also indicate the value of the coefficient µ (α3), which can be used when calculating the KQ matrix [Source 2] (in this work it was equal to 5), and also indicate the number of elements (α4) used in encryption, if it was decided to use 40-100 characters of the SQL 1 matrix when encrypting, and then move on to the SQL 2 matrix and then to the SQL i matrix, and in this case it is necessary to indicate the number of the element K i (α5) from which the report begins. All these coefficients can be summarized in table No. 1.
Таблица № 1. Table No. 1.
Заметим, что в качестве коэффициента µ могут быть использованы числа, входящие в матрицу-столбец (α1) или матрицу-строку (α2).Note that the numbers included in the column matrix (α1) or row matrix (α2) can be used as the coefficient µ.
На фигуре 2 представлена блок-схема алгоритма поточного шифрования, где: Figure 2 shows a block diagram of the stream encryption algorithm, where:
- блок № 1– блок инициализации матрицы SQ;- block No. 1 – SQ matrix initialization block;
- блок № 2 – программа вычисления матрицы ключа KQ;- block No. 2 – program for calculating the KQ key matrix;
- блок № 3 – вычисление результирующей матрицы состояний SQL;- block No. 3 – calculation of the resulting SQL state matrix;
- блок № 4 – счётчик элементов результирующей матрицы состояний SQL;- block No. 4 – counter of elements of the resulting SQL state matrix;
- блок № 5 – перевод из десятичной системы счисления в двоичную систему счисления;- block No. 5 – conversion from the decimal number system to the binary number system;
- блок № 6 – открытый текст;- block No. 6 – open text;
- блок №7 – блок перевода открытого теста в символы ASCII.- block No. 7 – block for converting an open test into ASCII characters.
Способ осуществляют следующим образом.The method is carried out as follows.
Цикл работы состоит из нескольких этапов. На первом этапе производится инициализация матрицы SQ (блок № 1), то есть запись чисел в данную матрицу по порядку от 0 до 255 (при n = 8) и вычисление матрицы-ключа KQ на основе коэффициентов из таблицы №1 или другим способом, например, с помощью ДСЧ выбираются элементы из чисел от 1 до 255, соответствующие элементам матрицы-столбца (16 чисел) и матрицы-строки (16 чисел), а матрица KQ вычисляется как их произведение (3,4). The work cycle consists of several stages. At the first stage, the matrix SQ is initialized (block No. 1), that is, numbers are written into this matrix in order from 0 to 255 (with n = 8) and the key matrix KQ is calculated based on the coefficients from table No. 1 or in another way, for example , using the DNS, elements are selected from numbers from 1 to 255, corresponding to the elements of the column matrix (16 numbers) and the row matrix (16 numbers), and the KQ matrix is calculated as their product (3,4).
На втором этапе по формуле (3) с учётом вычисленных значений матрицы KQ и значений матрицы SQ вычисляется матрица SQL. At the second stage, using formula (3), taking into account the calculated values of the KQ matrix and the values of the SQ matrix, the SQL matrix is calculated.
На третьем этапе происходит перевод числовых значений элементов матрицы SQL в двоичную систему счисления, соответствующую таблице символов ASCII.At the third stage, the numeric values of the SQL matrix elements are converted into the binary number system corresponding to the ASCII character table.
На четвёртом этапе символы открытого текста записываются с помощью таблицы символов ASCII (блок № 6 и блок № 7), и на выходе блока № 7 получают значение символа Xi, соответствующее символу открытого текста, но записанное в двоичной системе счисления.At the fourth stage, plaintext characters are written using the ASCII character table (block No. 6 and block No. 7), and at the output of block No. 7, the value of the character X i is obtained, corresponding to the plaintext character, but written in the binary number system.
На пятом этапе после суммирования по модулю два 8 бит символов, поступивших из блока №5, и 8 бит символов, поступивших из блока № 7, получают зашифрованное сообщение Yi.At the fifth stage, after modulo summation, two 8-bit symbols received from block No. 5 and 8 bits of symbols received from block No. 7 receive an encrypted message Y i .
Нет проблемы возникающей из-за наличия байтов вне диапазона. Все байты, как преобразующие символы открытого текста, так и байты для шифрования (элементы матрицы SQL) находятся в диапазоне от 0 до 255, и после сложения по модулю два они также будут находиться в этом диапазоне. То есть, производится сложение слова из 8бит(1 байт), соответствующего символу открытого текста с элементом матрицы sqlij ,также состоящим из 8 бит по модулю два и в результате получается слово из 8 бит(1байт).There is no problem arising from having out-of-range bytes. All bytes, both the plaintext character conversion and the encryption bytes (the elements of the SQL matrix) are in the range from 0 to 255, and after modulo two addition they will also be in this range. That is, a word of 8 bits (1 byte) corresponding to a plaintext character is added with an element of the matrix sql ij , also consisting of 8 bits modulo two, and the result is a word of 8 bits (1 byte).
В том случае, если размер открытого текста, то есть количество символов открытого текста равно 256, то для их шифрования достаточно элементов матрицы SQL1 (число которых равно 256), а если больше, чем 256 ,то по команде со счётчика элементов будет сформирована новая матрица SQL2 (число элементов которой также равно 256) и т.д.If the size of the plaintext, that is, the number of characters of the plaintext is 256, then the elements of the SQL matrix are sufficient to encrypt them1(the number of which is 256), and if more than 256 , then upon command from the element counter a new SQL matrix will be generated2(the number of elements of which is also 256) etc.
Кроме этого возможно использование определённого количества символов (40-100) из матрицы SQL1, а потом из матрицы SQL2 и тд., что сделает невозможным расшифрование зашифрованного текста.In addition, it is possible to use a certain number of characters (40-100) from the SQL matrix 1 , and then from the SQL matrix 2 , etc., which will make it impossible to decrypt the encrypted text.
В заявляемом способе производятся матричные операции, не требующие больших вычислительных и, как следствие, временных затрат: матрицы не возводятся в степень и нет вычисления обратных матриц (которые могут и не существовать), что значительно упрощает применение данного метода в реальной практике.In the proposed method, matrix operations are performed that do not require large computational and, as a consequence, time costs: matrices are not raised to a power and there is no calculation of inverse matrices (which may not exist), which greatly simplifies the use of this method in real practice.
Claims (11)
Publications (1)
Publication Number | Publication Date |
---|---|
RU2811065C1 true RU2811065C1 (en) | 2024-01-11 |
Family
ID=
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5297208A (en) * | 1992-08-05 | 1994-03-22 | Roger Schlafly | Secure file transfer system and method |
RU2462825C1 (en) * | 2011-07-08 | 2012-09-27 | Государственное образовательное учреждение высшего профессионального образования "Поволжский государственный университет телекоммуникаций и информатики" (ГОУВПО ПГУТИ) | Method of hidden transfer of coded information along multiple communication channels |
RU2783406C1 (en) * | 2021-10-25 | 2022-11-14 | Олег Петрович Дедов | Method for gamma generation, used in stream encryption |
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5297208A (en) * | 1992-08-05 | 1994-03-22 | Roger Schlafly | Secure file transfer system and method |
RU2462825C1 (en) * | 2011-07-08 | 2012-09-27 | Государственное образовательное учреждение высшего профессионального образования "Поволжский государственный университет телекоммуникаций и информатики" (ГОУВПО ПГУТИ) | Method of hidden transfer of coded information along multiple communication channels |
RU2783406C1 (en) * | 2021-10-25 | 2022-11-14 | Олег Петрович Дедов | Method for gamma generation, used in stream encryption |
Non-Patent Citations (1)
Title |
---|
РЯБКО Б.Я. и др., Криптография в информационном мире, Горячая линия-Телеком, 2018 г., с. 201-203. * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101267109B1 (en) | Cryptographic primitives, error coding, and pseudo-random number improvement methods using quasigroups | |
US6415032B1 (en) | Encryption technique using stream cipher and block cipher | |
Saraswat et al. | An extended hybridization of vigenére and caesar cipher techniques for secure communication | |
JPH11509940A (en) | Cryptographic method and apparatus for non-linearly combining data blocks and keys | |
US20080304664A1 (en) | System and a method for securing information | |
CN108768617B (en) | Format-preserving encryption method based on traditional block cipher | |
AU6043190A (en) | Method of cryptographically transforming electronic digital data from one form to another | |
JPH0863097A (en) | Method and system for symmetric encoding for encoding of data | |
Alqad et al. | A new approach for data cryptography | |
CN114549266A (en) | Image encryption method based on DNA replacement rule and chaotic system | |
Paragas et al. | Hill cipher modification: A simplified approach | |
Sakib | ANALYSIS ON FUNDAMENTAL ALGEBRAIC CONCEPTS AND INFORMATION SECURITY SYSTEM | |
Jangid et al. | Hybrid approach of image encryption using DNA cryptography and TF Hill Cipher Algorithm | |
RU2811065C1 (en) | Method for byte-by-byte transmission of information using stream encryption | |
US6553120B1 (en) | Method for data decorrelation | |
KR100411684B1 (en) | Method for the cryptographic conversion of binary data blocks | |
KR20040041860A (en) | Cryptographic apparatus with parallel des structure | |
US7433905B2 (en) | Device and method for processing digital values in particular in non-adjacent form | |
EP0605047B1 (en) | Method for blockwise encryption/decryption using linear algebraic codes | |
CN110532763B (en) | Password construction method and system based on high-order orthomorphism replacement | |
CN115103080A (en) | Image encryption method and system based on DNA triploid variation | |
Kumari et al. | A novel image encryption scheme with Huffman encoding and steganography technique | |
KR100350207B1 (en) | Method for cryptographic conversion of l-bit input blocks of digital data into l-bit output blocks | |
CN110581759A (en) | UOEC-HEX symmetric encryption algorithm | |
RU2783406C1 (en) | Method for gamma generation, used in stream encryption |