[go: up one dir, main page]

RU2829566C1 - Method and system for protecting authenticity of images generated by machine learning model - Google Patents

Method and system for protecting authenticity of images generated by machine learning model Download PDF

Info

Publication number
RU2829566C1
RU2829566C1 RU2024115143A RU2024115143A RU2829566C1 RU 2829566 C1 RU2829566 C1 RU 2829566C1 RU 2024115143 A RU2024115143 A RU 2024115143A RU 2024115143 A RU2024115143 A RU 2024115143A RU 2829566 C1 RU2829566 C1 RU 2829566C1
Authority
RU
Russia
Prior art keywords
image
coefficients
blocks
dct
dct coefficients
Prior art date
Application number
RU2024115143A
Other languages
Russian (ru)
Inventor
Кирилл Евгеньевич Вышегородцев
Original Assignee
Публичное Акционерное Общество "Сбербанк России" (Пао Сбербанк)
Filing date
Publication date
Application filed by Публичное Акционерное Общество "Сбербанк России" (Пао Сбербанк) filed Critical Публичное Акционерное Общество "Сбербанк России" (Пао Сбербанк)
Application granted granted Critical
Publication of RU2829566C1 publication Critical patent/RU2829566C1/en
Priority to PCT/RU2024/000370 priority Critical patent/WO2025254557A1/en

Links

Images

Abstract

FIELD: means of protecting digital data.
SUBSTANCE: invention relates to means of protecting digital data for purposes of authenticating them. Method of protecting authenticity of images generated based on a text request by a machine learning model comprises steps of: obtaining user input data for generating an image; generating an image using a machine learning model; recording user input data containing: input time, user ID and text query; generating an attachment for protecting the generated image, consisting of said data; generating an encrypted sequence by encrypting attachment data; embedding into coefficients of discrete cosine transformation of generated image values of hash function and encrypted sequence; providing a protected image to a user.
EFFECT: broader functional capabilities for protecting images generated by AI for purposes of determining their authenticity, which consist in attribution of the image as created using a machine learning model, the identifier of the user who generated the request for generating the image, and the request text itself.
8 cl, 9 dwg

Description

ОБЛАСТЬ ТЕХНИКИAREA OF TECHNOLOGY

[0001] Заявленное решение относится к области информационных технологий, а именно к средствам защиты цифровых данных для целей подтверждения их подлинности.[0001] The claimed solution relates to the field of information technology, namely to means of protecting digital data for the purpose of confirming their authenticity.

УРОВЕНЬ ТЕХНИКИLEVEL OF TECHNOLOGY

[0002] С широким распространением на сегодняшний момент времени искусственного интеллекта (ИИ) и различных моделей машинного обучения, позволяющих генерировать изображения на основании текстового запроса пользователей, существует потребность в применении механизмов защиты генерируемых изображений для целей последующего подтверждения их подлинности.[0002] With the widespread use of artificial intelligence (AI) and various machine learning models today that allow generating images based on a user's text query, there is a need to apply mechanisms to protect the generated images for the purpose of subsequent confirmation of their authenticity.

[0003] Одна из необходимостей в применении такого рода механизма направлена на препятствовании присваивании авторства создаваемых ИИ изображений. Другая проблема связана с защитой изображений от сторонних дополнительных изменений или модификаций, искажающих первоначально сгенерированное ИИ изображение, что впоследствии может использоваться как ложные сведения, порочащие создателей таких моделей в части возможности генерирования изображений запрещенного или непристойного содержания.[0003] One of the needs for the use of such a mechanism is aimed at preventing the attribution of authorship to AI-generated images. Another problem is related to the protection of images from third-party additional changes or modifications that distort the image initially generated by the AI, which can subsequently be used as false information discrediting the creators of such models in terms of the ability to generate images of prohibited or obscene content.

[0004] Одним из примеров защиты изображений в уровне техники предлагается использовать своего рода цифровые подписи, встраиваемые в генерируемое изображения, которые являются невидимыми для человеческого глаза и могут быть получены только с помощью последующей расшифровки защищенных изображений с помощью их алгоритмического извлечения (см. статью «Copyright protection of images using robust digital signatures)) // N. Nikolaidis et al., 1996). Согласно известному решению создание подписи выполняется в пространственной области путем незначительного изменения уровня интенсивности случайно выбранных пикселей изображения. Определение сигнатуры осуществляется путем сравнения среднего значения интенсивности отмеченных пикселей с таковым у не отмеченных пикселей. Для этой цели используется проверка статистических гипотез. Подпись может быть сконструирована таким образом, чтобы она была устойчива к сжатию в формате JPEG и фильтрации нижних частот.[0004] One example of image protection in the prior art is to use a kind of digital signature embedded in the generated image, which is invisible to the human eye and can only be obtained by subsequent decryption of the protected images using their algorithmic extraction (see the article "Copyright protection of images using robust digital signatures)) // N. Nikolaidis et al., 1996). According to the known solution, the signature is created in the spatial domain by slightly changing the intensity level of randomly selected pixels of the image. The signature is determined by comparing the average intensity value of the marked pixels with that of the unmarked pixels. For this purpose, statistical hypothesis testing is used. The signature can be constructed in such a way that it is resistant to compression in the JPEG format and low-pass filtering.

[0005] Данный подход был положен в основу заявленного решения в части использования внедрения защитной информации в коэффициенты яркости формата JPEG, а также ряд улучшений, позволяющих не только более эффективно маркировать генерируемые изображения, а также выявлять из возможные будущие изменения.[0005] This approach was the basis for the declared solution in terms of the use of the implementation of security information in the brightness coefficients of the JPEG format, as well as a number of improvements that allow not only more effective marking of generated images, but also identifying possible future changes.

СУЩНОСТЬ ИЗОБРЕТЕНИЯESSENCE OF THE INVENTION

[0006] Настоящее изобретение направлено на решение технической проблемы, заключающейся в создании нового эффективного способа защиты цифровых изображений с возможностью последующего подтверждения их подлинности и возможных изменений.[0006] The present invention is aimed at solving the technical problem of creating a new effective method for protecting digital images with the possibility of subsequent confirmation of their authenticity and possible changes.

[0007] Техническим результатом является повышение эффективности защиты генерируемых ИИ изображений для целей определения их подлинности.[0007] The technical result is to increase the efficiency of protecting AI-generated images for the purposes of determining their authenticity.

[0008] Дополнительным техническим результатом является возможность определения неизменности изображений на основании встраиваемой защитной информации.[0008] An additional technical result is the possibility of determining the immutability of images based on embedded security information.

[0009] В предпочтительном варианте осуществления изобретения заявлен способ защиты подлинности изображений, генерируемых на основании текстового запроса моделью машинного обучения, содержащий этапы, на которых:[0009] In a preferred embodiment of the invention, a method is claimed for protecting the authenticity of images generated based on a text query by a machine learning model, comprising the steps of:

a) получают данные пользовательского ввода для генерирования изображения;a) receive user input data to generate an image;

b) генерируют изображение в формате JPG с помощью модели машинного обучения;b) generate a JPG image using a machine learning model;

c) фиксируют данные пользовательского ввода, содержащие: время ввода, ID пользователя и текстовый запрос;c) record user input data, including: input time, user ID and text query;

d) извлекают из данных файла сгенерированного изображения в формате JPG блоки значений коэффициентов дискретного косинусного преобразования (ДКП) для яркостной (Y) и цветных (Cb- и Cr) составляющих изображения;d) extracting from the data of the generated image file in JPG format blocks of values of the discrete cosine transform (DCT) coefficients for the brightness (Y) and color (Cb- and Cr) components of the image;

e) получают последовательность низкочастотных коэффициентов ДКП (DC-коэффициенты) и высокочастотных коэффициентов ДКП (АС-коэффициенты) по всем блокам яркостной составляющей, и рассчитывают хеш-функцию на основании по меньшей мере одного АС-коэффициент и/или по меньшей мере одного DC-коэффициента;e) obtaining a sequence of low-frequency DCT coefficients (DC coefficients) and high-frequency DCT coefficients (AC coefficients) for all blocks of the luminance component, and calculating a hash function based on at least one AC coefficient and/or at least one DC coefficient;

f) по заданному ключу определяют блоки коэффициентов ДКП и позиции коэффициентов ДКП внутри блоков, исключая в блоках DC-коэффициенты ДКП, используемые на этапе е);f) using the given key, determine the blocks of DCT coefficients and the positions of the DCT coefficients within the blocks, excluding in the blocks the DC coefficients of the DCT used at stage e);

g) формируют вложение для защиты сгенерированного изображения, состоящее из последовательности, включающей: время ввода, ID пользователя, текстовый запрос, значение хеш-функции, полученной на этапе е), и дополнительную текстовую информацию;g) form an attachment for protecting the generated image, consisting of a sequence including: input time, user ID, text query, hash function value obtained in step e), and additional text information;

h) выполняют формирование зашифрованной последовательности с помощью шифрования данных, полученных на этапе g), закрытым ключом;h) generate an encrypted sequence by encrypting the data obtained in step g) with a private key;

i) осуществляют встраивание в коэффициенты ДКП сгенерированного изображения, определенные на этапе f), значений хеш-функции, полученной на этапе е), и зашифрованной последовательности, полученной на этапе h);i) embedding into the DCT coefficients of the generated image, determined in step f), the values of the hash function obtained in step e) and the encrypted sequence obtained in step h);

j) предоставляют защищенное изображение пользователю.j) provide a secure image to the user.

[0010] В одном из частных примеров осуществления на этапе d) выполняется извлечение блоков для встраивания информации по меньшей мере одной из Y-, Cb- и Cr-составляющих изображения.[0010] In one particular embodiment, step d) involves extracting blocks for embedding information from at least one of the Y, Cb and Cr components of the image.

[0011] В другом частном примере осуществления на этапе е) последовательность DC-коэффициентов состоит из коэффициентов ДКП одной из Y-, Cb- и Cr- составляющих изображения.[0011] In another particular example of implementation, at step e), the sequence of DC coefficients consists of the DCT coefficients of one of the Y, Cb and Cr components of the image.

[0012] В другом частном примере осуществления е) хеш-функцию рассчитывают по коэффициентам ДКП по меньшей мере одной из Y-, Cb- и Cr- составляющих изображения.[0012] In another particular example of implementation e) the hash function is calculated based on the DCT coefficients of at least one of the Y-, Cb- and Cr-components of the image.

[0013] В другом частном примере осуществления на этапе f) по заданному ключу определяют блоки коэффициентов ДКП и позиции коэффициентов ДКП внутри блоков, включающие в себя любые АС-коэффициенты и DC-коэффициенты ДКП, по меньшей мере одной из Y-, Cb- и Cr- составляющих изображения.[0013] In another particular example of implementation, at step f), blocks of DCT coefficients and positions of DCT coefficients within the blocks are determined based on a given key, including any AC coefficients and DC coefficients of the DCT of at least one of the Y, Cb and Cr components of the image.

[0014] В другом частном примере осуществления на этапе с) дополнительно формируется сжатое изображение на основании сгенерированного изображения.[0014] In another particular embodiment, at step c), a compressed image is additionally formed based on the generated image.

[0015] В другом частном примере осуществления на основании сжатого изображения формируется последовательность байт, которая добавляется к данным на этапе g) при формировании вложения.[0015] In another particular embodiment, a sequence of bytes is formed based on the compressed image, which is added to the data in step g) when forming the embedding.

[0016] В другом предпочтительном примере осуществления заявлена система защиты подлинности изображений, генерируемых на основании текстового запроса моделью машинного обучения, содержащая по меньшей мере один процессор и по меньшей мере одну память, связанную с процессором и содержащую машиночитаемые инструкции, которые при их исполнении процессором позволяют ему:[0016] In another preferred embodiment, a system for protecting the authenticity of images generated based on a text query by a machine learning model is claimed, comprising at least one processor and at least one memory associated with the processor and containing machine-readable instructions that, when executed by the processor, allow it to:

получать данные пользовательского ввода для генерирования изображения; генерировать изображение в формате JPG с помощью модели машинного обучения;receive user input data to generate an image; generate a JPG image using a machine learning model;

фиксировать данные пользовательского ввода, содержащие: время ввода, ID пользователя и текстовый запрос;record user input data, including: input time, user ID, and text query;

извлекать из данных файла сгенерированного изображения в формате JPG блоки значений коэффициентов дискретного косинусного преобразования (ДКП) для яркостной (Y) и цветных (Cb- и Cr) составляющих изображения;extract from the data of the generated JPG image file blocks of values of the discrete cosine transform (DCT) coefficients for the brightness (Y) and color (Cb- and Cr) components of the image;

получать последовательность низкочастотных коэффициентов ДКП (DC-коэффициенты) и высокочастотных коэффициентов ДКП (АС-коэффициенты) по всем блокам яркостной составляющей, и рассчитывать хеш-функцию на основании по меньшей мере одного АС-коэффициента и/или по меньшей мере одного DC-коэффициента;obtain a sequence of low-frequency DCT coefficients (DC coefficients) and high-frequency DCT coefficients (AC coefficients) for all blocks of the luminance component, and calculate a hash function based on at least one AC coefficient and/or at least one DC coefficient;

по заданному ключу определять блоки коэффициентов ДКП и позиции коэффициентов ДКП внутри блоков, исключая в блоках DC-коэффициенты ДКП, для расчета хеш-функции;using a given key, determine the blocks of DCT coefficients and the positions of DCT coefficients within the blocks, excluding DC DCT coefficients in the blocks, to calculate the hash function;

формировать вложение для защиты сгенерированного изображения, состоящее из последовательности, включающей: время ввода, ID пользователя, текстовый запрос, значение рассчитанной хеш-функции, и дополнительную текстовую информацию;form an attachment to protect the generated image, consisting of a sequence including: input time, user ID, text query, calculated hash function value, and additional text information;

выполнять формирование зашифрованной последовательности с помощью шифрования данных вложения закрытым ключом;perform the formation of an encrypted sequence by encrypting the attachment data with a private key;

осуществлять встраивание в выбранные коэффициенты ДКП сгенерированного изображения полученного значения хеш-функции и зашифрованной последовательности;implement the embedding of the generated image of the obtained hash function value and the encrypted sequence into the selected DCT coefficients;

предоставлять защищенное изображение пользователю.provide a protected image to the user.

КРАТКОЕ ОПИСАНИЕ ЧЕРТЕЖЕЙBRIEF DESCRIPTION OF DRAWINGS

[0017] Фиг. 1 иллюстрирует общий вид способа защиты изображений.[0017] Fig. 1 illustrates a general view of a method for protecting images.

[0018] Фиг. 2 иллюстрирует блок-схему заявленного способа.[0018] Fig. 2 illustrates a block diagram of the claimed method.

[0019] Фиг. 3А иллюстрирует пример блоков с коэффициентами ДКП, соотнесенных с блоками пикселей изображений.[0019] Fig. 3A illustrates an example of blocks of DCT coefficients associated with blocks of image pixels.

[0020] Фиг. 3Б иллюстрирует позиции коэффициентов ДКП в блоке.[0020] Fig. 3B illustrates the positions of the DCT coefficients in the block.

[0021] Фиг. 3В иллюстрирует пример значений коэффициентов ДКП на разных позициях в блоке.[0021] Fig. 3B illustrates an example of the values of the DCT coefficients at different positions in a block.

[0022] Фиг. 4 иллюстрирует пример определения коэффициентов ДКП для встраивания защитной информации.[0022] Fig. 4 illustrates an example of determining DCT coefficients for embedding security information.

[0023] Фиг. 5 иллюстрирует пример изменения коэффициентов ДКП после встраивания защитной информации.[0023] Fig. 5 illustrates an example of changing the DCT coefficients after embedding security information.

[0024] Фиг. 6 иллюстрирует пример вложения и его частей в виде последовательности байт.[0024] Fig. 6 illustrates an example of an attachment and its parts in the form of a sequence of bytes.

[0025] Фиг. 7 иллюстрирует общую схему вычислительного устройства.[0025] Fig. 7 illustrates a general diagram of a computing device.

ОСУЩЕСТВЛЕНИЕ ИЗОБРЕТЕНИЯIMPLEMENTATION OF THE INVENTION

[0026] На Фиг. 1 представлена общая схема заявленного решения, которое реализовано с помощью обработки поступающих пользовательских запросов (110), представляющих собой текстовое описание генерируемого изображения. В области ИИ такие текстовые запросы, описывающие объект генерирования для модели машинного обучения, также называют «промпт». Запрос от пользователя (110) может передаваться через API (120), реализованный в веб-браузере или мессенджере (например, Telegram), обеспечивающий последующий обмен данными непосредственно с моделью генерирования изображений (130) (например, Kandinsky) пользователем (110) и модулем защиты изображений (140).[0026] Fig. 1 shows a general diagram of the claimed solution, which is implemented by processing incoming user requests (110), which are a text description of the generated image. In the field of AI, such text requests describing the generation object for the machine learning model are also called "prompts". The request from the user (110) can be transmitted via an API (120), implemented in a web browser or messenger (e.g., Telegram), which ensures subsequent data exchange directly with the image generation model (130) (e.g., Kandinsky) by the user (110) and the image protection module (140).

[0027] Модуль защиты изображений (140) может быть реализован на базе внешнего программно-аппаратного комплекса, например, сервера или удаленной АРМ, обеспечивающий функционал по обработке поступающих изображений (121), сгенерированных моделью (130). Модуль (140) может также находится в одном исполняющем контуре совместно с моделью (130), например, сервере или облачном вычислительном узле.[0027] The image protection module (140) can be implemented on the basis of an external software and hardware complex, for example, a server or a remote automated workstation, providing functionality for processing incoming images (121) generated by the model (130). The module (140) can also be located in the same execution circuit together with the model (130), for example, a server or a cloud computing node.

[0028] По факту работы модуля защиты изображений (140) в первично генерируемые изображения (121) внедряется защитная информация, содержащая зашифрованное вложение, позволяющее установить по меньшей мере авторство изображения, как созданного с помощью модели (130), а также идентификатор пользователя, сформировавшего запрос, и сам текст запроса. Впоследствии защищенное изображение (141) передается пользователю (110) через API (120), например, посредством отображения изображения (141) в веб-браузере или мессенджере.[0028] Upon operation of the image protection module (140), protective information containing an encrypted attachment is embedded into the initially generated images (121), allowing at least the authorship of the image to be established as having been created using the model (130), as well as the identifier of the user who generated the request, and the text of the request itself. Subsequently, the protected image (141) is transmitted to the user (110) via the API (120), for example, by displaying the image (141) in a web browser or messenger.

[0029] Обмен данным в рамках реализации системы построен на стандартных принципах обмена данными, в частности с помощью вычислительной сети «Интернет», которая может быть реализована с помощью любых известных принципов, известных из уровня техники.[0029] Data exchange within the framework of the implementation of the system is based on standard principles of data exchange, in particular with the help of the Internet computing network, which can be implemented using any known principles known from the state of the art.

[0030] На Фиг. 2 представлен пример реализации заявленного способа (200) защиты генерируемых изображений. На первом этапе (201) происходит получение пользовательского ввода для генерации изображения моделью (130). Пользовательский ввод включает в себя текстовый запрос пользователя, ID пользователя (например, IP адрес, MAC адрес, ID регистрации и т.п.), и время текстового запроса. Эти данные фиксируются модулем защиты изображений (140) для последующего формирования защитной информации для внедрения в изображение.[0030] Fig. 2 shows an example of implementing the claimed method (200) for protecting generated images. At the first stage (201), user input is received for generating an image by the model (130). The user input includes a text user query, a user ID (for example, an IP address, a MAC address, a registration ID, etc.), and the time of the text query. These data are recorded by the image protection module (140) for subsequent formation of security information for embedding in the image.

[0031] Далее на этапе (202) модель (130) осуществляет генерацию изображения (121) согласно пользовательскому запросу и передает его в модуль защиты изображений (140). Изображение формируется в JPG (или JPEG) формате [1-3]. При поступлении в модуль (140) сгенерированного изображения (121) в формате JPG на этапе (203) выполняется извлечение из JPG файла блоков значений коэффициентов дискретного косинусного преобразования (ДКП) для яркостной (Y) и цветных (Cb (относительная голубизна) и Cr (относительная краснота) составляющих изображения.[0031] Then, at step (202), the model (130) generates an image (121) according to the user request and transmits it to the image protection module (140). The image is formed in JPG (or JPEG) format [1-3]. When the generated image (121) in JPG format is received by the module (140), at step (203), blocks of discrete cosine transform (DCT) coefficient values are extracted from the JPG file for the luminance (Y) and color (Cb (relative blueness) and Cr (relative redness) components of the image.

[0032] На Фиг. 3А представлен пример получения блоков с коэффициентами дискретного косинусного преобразования (ДКП). При кодировании в JPEG исходного изображения (представленного виде пикселей в формате RGB) данные коэффициенты получаются следующим образом. Полученное изображение разбивается на цветовые каналы. Полученные каналы изображения (121) разбиваются на блоки (3001-300n) размерностью 8×8 пикселей. Количество блоков (3001-300n) зависит от разрешения сгенерированного изображения (121) или размера растрового изображения. Например, для изображения размера 1920×1080 пикселей количество блоков составит 240 по горизонтали и 135 по вертикали.[0032] Fig. 3A shows an example of obtaining blocks with discrete cosine transform (DCT) coefficients. When encoding the original image (represented as pixels in RGB format) in JPEG, these coefficients are obtained as follows. The obtained image is divided into color channels. The obtained image channels (121) are divided into blocks (300 1 -300 n ) with a size of 8x8 pixels. The number of blocks (300 1 -300 n ) depends on the resolution of the generated image (121) or the size of the raster image. For example, for an image of 1920x1080 pixels, the number of blocks will be 240 horizontally and 135 vertically.

[0033] Каждый блок (3001-300n) подвергается дискретному косинусному преобразованию (ДКП), являющемся разновидностью дискретного преобразования Фурье. При этом, каждый из блоков (3001-300n) содержит один DC коэффициент (3011) на позиции (0,0) внутри блока и 63 АС коэффициента (3012-30164) на других позициях внутри блока. DC-коэффициент является усредненным значением всех значений внутри блока как это примерно изображено на Фиг. 3В.[0033] Each block (300 1 -300 n ) is subjected to a discrete cosine transform (DCT), which is a type of discrete Fourier transform. In this case, each of the blocks (300 1 -300 n ) contains one DC coefficient (301 1 ) at the position (0,0) inside the block and 63 AC coefficients (301 2 -301 64 ) at other positions inside the block. The DC coefficient is an average value of all values in the block, as approximately shown in Fig. 3B.

[0034] На Фиг. 3Б представлен пример позиционирования ДКП коэффициентов внутри блока. DC коэффициенты также еще называют низкочастотные коэффициенты. В текущем описании позиция внутри блока (0,0) так же обозначается как 1-ая позиция. Позиции (Y1, Y2), (Y1, Y2)≠(0,0) обозначаются со 2-ой по 64-ую позицию.[0034] Fig. 3B shows an example of positioning the DCT coefficients within a block. DC coefficients are also called low-pass coefficients. In the current description, the position within the block (0,0) is also designated as the 1st position. The positions (Y1, Y2), (Y1, Y2)≠(0,0) are designated from the 2nd to the 64th position.

[0035] Сам файл изображения в формате JPEG ("<имя_файла>.jpg") представляет собой сжатое хранение упомянутых выше коэффициентов ДКП. Таким образом, на этапе (203) происходит извлечение этих блоков коэффициентов ДКП напрямую из файла формата JPEG.[0035] The JPEG image file itself ("<file_name>.jpg") is a compressed storage of the above-mentioned DCT coefficients. Thus, at step (203), these blocks of DCT coefficients are extracted directly from the JPEG file.

[0036] На этапе (204) выполняется хеширование последовательности DC коэффициентов для этого берутся все значения в блоках и к ним применяется выбранный алгоритм хеширования, например, SHA-256, SHA-512 и т.п.[0036] At step (204), the sequence of DC coefficients is hashed, for which all values in the blocks are taken and the selected hashing algorithm is applied to them, for example, SHA-256, SHA-512, etc.

[0037] Как показано на Фиг. 4 на этапе на этапе (205) определяются АС коэффициенты в блоках (3001-300n) с помощью выбранного ключа (seed) для последующего внедрения защитной информации. Берется исходная упорядоченная последовательность (401) блоков коэффициентов ДКП (X1, Х2) и позиций самих коэффициентов внутри блоков (Y1, Y2): {(X1,X2)-(Y1,Y2)}. Где (X1, Х2) - координата блока коэффициентов ДКП внутри изображения: где Hизображения - высота изображения, Wизображения _ ширина изображения; (Yl, Y2) - координаты позиций коэффициентов ДКП внутри блоков: (Y1, Y2)≠(0,0). На Фиг. 3Б представлен пример таких позиций. Далее выбранная последовательность (401) АС коэффициентов перемешивается с помощью заданного ключа, впоследствии формируя новую последовательность (402) АС коэффициентов.[0037] As shown in Fig. 4, at step (205), the AC coefficients in the blocks (300 1 -300 n ) are determined using the selected key (seed) for subsequent embedding of the security information. The initial ordered sequence (401) of the DCT coefficient blocks (X1, X2) and the positions of the coefficients themselves inside the blocks (Y1, Y2) is taken: {(X1, X2) - (Y1, Y2)}. Where (X1, X2) is the coordinate of the DCT coefficient block inside the image: where H of the image is the height of the image, W of the image is the width of the image; (Yl, Y2) are the coordinates of the positions of the DCT coefficients inside the blocks: (Y1, Y2)≠(0,0). Fig. 3B shows an example of such positions. Then the selected sequence (401) of AC coefficients is mixed using a given key, subsequently forming a new sequence (402) of AC coefficients.

[0038] На этапе (206) выполняется формирование защитного вложения. Вложение состоит из открытой части (нешифрованной) и шифрованной части. Шифрованная часть представляет собой шифрованную последовательность данных, включающую в себя следующие данные: время ввода, ID пользователя, текстовый запрос (промпт-запрос), значение хеш-функции, полученной на этапе (204), и дополнительную текстовую информацию (например, обозначение «Я модель Сбера»). Открытая часть может включать в себя такую информацию как: проверочное число, хеш-последовательности выбранных коэффициентов ДКП, контрольное число целостности шифрованного вложения. Пример такого вложения представлен на Фиг. 6.[0038] At step (206), a security attachment is formed. The attachment consists of an open part (unencrypted) and an encrypted part. The encrypted part is an encrypted data sequence that includes the following data: input time, user ID, text query (prompt query), hash function value obtained at step (204), and additional text information (for example, the designation “I am a Sber model”). The open part may include such information as: a check number, hash sequences of selected DCT coefficients, and a check number of the integrity of the encrypted attachment. An example of such an attachment is shown in Fig. 6.

[0039] В одном из частных вариантов изобретения встраиванию подлежат произвольные данные, произвольного размера, меняющиеся в зависимости от запроса или его условий. В этом случае, при извлечение данных, изначально не известен их количество и их размер. Для возможности их извлечения в начало данных шифрованной части вставляются следующие данные: количество различных данных в фиксированном количестве первых бит, размер каждого из вложений в фиксированном количестве последующих бит. На Фиг. 6 приведен пример такого вложения. В начале шифрованной части вложения располагается количество данных - 3 данных: хеш-изображения; текстовая информация, включающая в себя фиксированную текстовую фразу, id-пользователя, время запроса, «Промпт» запроса; сжатое исходное изображение. Под количество данных отведено первые 32 бита шифрованной части вложения. Далее располагаются размеры данных - 64 байта на хеш; 163 байта на текстовую информацию, 3756 байт на сжатое исходное изображение. Под каждый размер отводится следующие 32 бита шифрованной части вложения.[0039] In one particular embodiment of the invention, arbitrary data of arbitrary size, changing depending on the request or its conditions, are subject to embedding. In this case, when extracting data, their quantity and their size are initially unknown. In order to be able to extract them, the following data are inserted into the beginning of the encrypted part data: the quantity of different data in a fixed quantity of the first bits, the size of each of the attachments in a fixed quantity of subsequent bits. An example of such an attachment is shown in Fig. 6. At the beginning of the encrypted part of the attachment, there is a quantity of data - 3 data: a hash image; text information including a fixed text phrase, user ID, request time, request "Prompt"; compressed original image. The first 32 bits of the encrypted part of the attachment are allocated for the quantity of data. Next come the sizes of the data - 64 bytes for the hash; 163 bytes for the text information, 3756 bytes for the compressed original image. Each size is allocated the next 32 bits of the encrypted portion of the attachment.

[0040] Дополнительно защитное вложение может включать сжатое сгенерированное изображение (121), которое переводится в последовательность байт, добавляемую к последовательности байт остальных данных. Полученное вложение на этапе (206) подписывается закрытым ключом на этапе (207), формируя тем самым часть защитного вложения. Полученная шифрованная последовательность байт представляет в виде последовательности бит.[0040] Additionally, the protective attachment may include a compressed generated image (121), which is translated into a byte sequence added to the byte sequence of the remaining data. The resulting attachment is signed with a private key at step (206) at step (207), thereby forming part of the protective attachment. The resulting encrypted byte sequence is represented as a bit sequence.

[0041] Далее на этапе (208) выполняется встраивание информации в последовательность коэффициентов ДКП, полученную на этапе (205).[0041] Next, at step (208), information is embedded into the sequence of DCT coefficients obtained at step (205).

[0042] Сначала встраиванию подлежит информация в открытом виде (не шифрованная). Это информация может включать в себя такую последовательность данных как: проверочное число, хеш-последовательности DC-коэффициентов (полученный на этапе (204)), контрольное число целостности защитного вложения, например, рассчитанного по алгоритму CRC16, CRC32, CRC64 или любому другому алгоритму расчета контрольной суммы или хеширования. Данная информация представляется в виде последовательности бит.[0042] First, the information in open form (not encrypted) is to be embedded. This information may include such a data sequence as: a check number, a hash sequence of DC coefficients (obtained at step (204)), a check number of the integrity of the protective embedding, for example, calculated using the CRC16, CRC32, CRC64 algorithm or any other algorithm for calculating a checksum or hashing. This information is presented in the form of a sequence of bits.

[0043] Далее встраиванию подлежит защитное вложение, полученного на этапе (207). Защищенное изображение (141) с внедренной на этапе (208) информацией отображается на этапе (209) на устройстве пользователя.[0043] Next, the security embedding obtained at step (207) is subject to embedding. The secure image (141) with the information embedded at step (208) is displayed at step (209) on the user's device.

[0044] Вложение на этапе (208) встраивается непосредственно в выбранные на этапе (205) АС коэффициенты блоков (3001-300n), входящих в перемешанную последовательность (402).[0044] The embedding at step (208) is embedded directly into the AC coefficients of the blocks (300 1 -300 n ) selected at step (205) that are included in the shuffled sequence (402).

[0045] Пример кодирования вложения внутрь JPG файла показана на Фиг. 5. При выполнении данного шага формируется перемешанная последовательность блоков коэффициентов ДКП и самих позиций коэффициентов внутри блоков. На Фиг. 5 первый бит встраивается в блок (31, 70) в коэффициент на позиции (1,0). Второй бит встраивается в блок (8, 69) в коэффициент на позиции (0,2) и так далее. Встраивание осуществляется как остаток от деления значения коэффициента ДКП на 2. Другими словами, если остаток от деления на 2 равен 0, то это означает, что в коэффициент встроен бит со значением 0. Если остаток от деления на 2 равен 1, то это означает, что в коэффициент встроен бит со значением 1. Если текущее значение коэффициента ДКП не дает нужный остаток, то это значение увеличивается или уменьшается на 1.[0045] An example of encoding an embedding inside a JPG file is shown in Fig. 5. When performing this step, a mixed sequence of blocks of DCT coefficients and the positions of the coefficients themselves inside the blocks is formed. In Fig. 5, the first bit is embedded in block (31, 70) in the coefficient at position (1,0). The second bit is embedded in block (8, 69) in the coefficient at position (0,2), and so on. Embedding is performed as a remainder from dividing the value of the DCT coefficient by 2. In other words, if the remainder from dividing by 2 is 0, this means that a bit with the value 0 is embedded in the coefficient. If the remainder from dividing by 2 is 1, this means that a bit with the value 1 is embedded in the coefficient. If the current value of the DCT coefficient does not give the desired remainder, this value is increased or decreased by 1.

[0046] Как показано в примере на Фиг. 5 первый бит встраиваемой информации равен 1. Значение коэффициента в блоке (31, 70) на позиции (1,0) является 17. Остаток от деления 17 на 2 равен 1. Остаток совпадает со значением встраиваемого бита. Второй бит встраиваемой информации равен 0. Значение коэффициента в блоке (8, 69) на позиции (0, 2) является 23. Остаток от деления 23 на 2 равен 1. Остаток не совпадает со значением встраиваемого бита. Меняем значение 23, вычитая из него 1. Значение стало равным 22. Остаток от деления 22 на 2 теперь равен 0, что совпадает со значением встраиваемого бита.[0046] As shown in the example in Fig. 5, the first bit of the embedded information is 1. The value of the coefficient in the block (31, 70) at position (1,0) is 17. The remainder of dividing 17 by 2 is 1. The remainder coincides with the value of the embedded bit. The second bit of the embedded information is 0. The value of the coefficient in the block (8, 69) at position (0, 2) is 23. The remainder of dividing 23 by 2 is 1. The remainder does not coincide with the value of the embedded bit. We change the value of 23 by subtracting 1 from it. The value became equal to 22. The remainder of dividing 22 by 2 is now 0, which coincides with the value of the embedded bit.

[0047] Встраивание информации может производиться по принципу кодирования информации в наименьший значимый бит (НЗБ) в блоках ДКП коэффициентов. НЗБ-последний бит в битовом виде, изменение которого наименьшим образом меняет само значение.[0047] Information embedding can be performed according to the principle of encoding information in the least significant bit (LSB) in the DCT blocks of coefficients. The LSB is the last bit in bit form, the change of which changes the value itself the least.

[0048] Пример кодирования в блок ДКП коэффициентов на Фиг. 3В: 15 - 00010101 (изменение не требуется). НЗБ=1 4 - 00000100 (изменение). НЗБ=0 6 - 00000110 (изменение). НЗБ=0 3- 00000011 (изменение). НЗБ=1.[0048] An example of encoding the coefficients in the DCT block in Fig. 3B: 15 - 00010101 (no change required). LSB=1 4 - 00000100 (change). LSB=0 6 - 00000110 (change). LSB=0 3 - 00000011 (change). LSB=1.

[0049] Рассмотрим пример встраивания текстовой информации. Текст для встраивания: SBER - 01010011 01000010 01000101 01010010. Рассмотрим встраивание буквы «S» -01010011. Берется значение 4 в битовом виде - 01010011. Идет встраивание слева направо: 0-1-0-1 и т.д.[0049] Let's look at an example of embedding text information. Text to be embedded: SBER - 01010011 01000010 01000101 01010010. Let's look at embedding the letter "S" -01010011. The value 4 is taken in bit form - 01010011. Embedding is from left to right: 0-1-0-1, etc.

- Шаг 1. Первый бит от «S»=0 и он встраивается в коэффициент ДКП со значением 4. НЗБ для 4 равен 0 (00000100). Необходимо встроить 0 от «S» и для 4 НЗБ так же 0. Поэтому значение не меняется.- Step 1. The first bit from "S" = 0 and it is embedded in the DCT coefficient with the value 4. The LSB for 4 is 0 (00000100). It is necessary to embed 0 from "S" and for 4 the LSB is also 0. Therefore the value does not change.

- Шаг 2. Второй бит от «S»=1 и он встраивается в коэффициент ДКП со значением 6. НЗБ для 6 равен 0 (00000110). Необходимо встроить 1 от «S», а для 6 НЗБ=0. Поэтому значение меняется на 1 и принимает битовый вид 00000111. Другими словами, 6 заменяется на 7.- Step 2. The second bit from "S" = 1 and it is embedded in the DCT coefficient with the value 6. The LSB for 6 is 0 (00000110). It is necessary to embed 1 from "S", and for 6 the LSB = 0. Therefore, the value changes to 1 and takes the bit form 00000111. In other words, 6 is replaced by 7.

- Шаг 3. Третий бит от «S»=0 и он встраивается в коэффициент ДКП со значением 3. НЗБ для 3 равен 1 (00000011). Необходимо встроить 0 от «S», а для 3 НЗБ=1. Поэтому это значение меняется на 0 и принимает битовый вид 00000010. Другими словами, 3 заменяется на 2.- Step 3. The third bit from "S" = 0 and it is embedded in the DCT coefficient with the value 3. The LSB for 3 is 1 (00000011). It is necessary to embed 0 from "S", and for 3 the LSB = 1. Therefore, this value changes to 0 and takes the bit form 00000010. In other words, 3 is replaced by 2.

Данный процесс продолжается до встраивания всех требуемых бит.В итоге формируется матрица ДКП коэффициентов с закодированной информацией в части изменения выбранных АС коэффициентов.This process continues until all required bits are embedded. As a result, a matrix of DCT coefficients with encoded information regarding the change in the selected AC coefficients is formed.

[0050] Итоговая внедряемая последовательность защитных данных может иметь следующий вид: [проверочное число (например, 537), хеш DC-коэффициентов, контрольное число целостности шифрованного вложения, шифрованное вложение]. Данные в шифрованном вложении могут представлять собой следующую последовательность: [количество вложений (например, 3), размер 1-го вложения, размер 2-го вложения, размер 3-го вложения, хеш DC-коэффициентов, текст («Я модель Сбера…»), миниатюра исходного изображения (сильно сжатое исходное изображение)].[0050] The final embedded sequence of security data may have the following form: [check digit (e.g. 537), hash of DC coefficients, check digit of integrity of encrypted attachment, encrypted attachment]. The data in the encrypted attachment may be the following sequence: [number of attachments (e.g. 3), size of 1st attachment, size of 2nd attachment, size of 3rd attachment, hash of DC coefficients, text (“I am a Sber model…”), thumbnail of original image (highly compressed original image)].

[0051] В байтовом виде это будет выглядеть следующим образом: 00000219ac3eb891bc32652a83b4ff62cc2e49de3293d99e24ae8907e90c96b55cb5578a78d78e887f5f436f6b9b989c6896b689e986s64a3509ee90fca…, где 00000219 - байтовый вид числа 537, ac3eb891bc32652a83b4ff62cc2e49de32 - байтовый вид хеша, 93d99e24 - байтовый вид значения контрольного числа CRC32 равное числу 2480512548, далее шифрованные данные. На Фиг. 6 представлен пример байтовой последовательности, подлежащей вложению. Эта последовательность представляется в виде битовой последовательности.[0051] In byte form it will look like this: 00000219ac3eb891bc32652a83b4ff62cc2e49de3293d99e24ae8907e90c96b55cb5578a78d78e887f5f436f6b9b989c6896b689e986s64a3509ee90fca…, where 00000219 is the byte form of the number 537, ac3eb891bc32652a83b4ff62cc2e49de32 is the byte form of the hash, 93d99e24 is the byte form of the CRC32 check digit value equal to 2480512548, and then the encrypted data. In Fig. Figure 6 shows an example of a byte sequence to be embedded. This sequence is represented as a bit sequence.

[0052] Полученные новые значения коэффициентов ДКП (Фиг. 5) сжимаются (кодируются) по стандарту JPEG и сохраняются в виде нового файла изображения.[0052] The obtained new values of the DCT coefficients (Fig. 5) are compressed (encoded) according to the JPEG standard and saved as a new image file.

[0053] При встраивании данной последовательности в выбранные ДКП коэффициенты полученное изображение (141) остается визуально неотличимым от первоначально сгенерированного изображения (121). Даже малые изменения писклей данного изображения ведет к изменению коэффициентов ДКП, что разрушает встроенное вложение. Этот факт позволяет в последующем выполнить проверку целостности встраиваемой защитной информации для подтверждения, что изображение (141) является подлинным, т.е. созданным с помощью модели (130), и что оно не было изменено в части его содержания.[0053] When this sequence is embedded into the selected DCT coefficients, the resulting image (141) remains visually indistinguishable from the initially generated image (121). Even small changes in the pixels of this image lead to a change in the DCT coefficients, which destroys the embedded embedding. This fact allows for a subsequent integrity check of the embedded security information to confirm that the image (141) is genuine, i.e. created using the model (130), and that it has not been altered in terms of its content.

[0054] Далее рассмотрим процесс извлечения вложенной информации при проверке защищенного изображения (141).[0054] Next, we will consider the process of extracting embedded information when checking a protected image (141).

[0055] Аналогично этапам (203-205) происходит получение значения хеша DC-коэффициентов (хеш-изображения) и последовательность коэффициентов ДКП в которые потенциально было выполнено встраивание информации.[0055] Similar to steps (203-205), the hash value of the DC coefficients (hash image) and the sequence of DCT coefficients into which information embedding was potentially performed are obtained.

[0056] Далее выполняется следующий алгоритм.[0056] The following algorithm is then executed.

[0057] Шаг 1. Извлекаются первые 4 байта для получения контрольного числа. Выполняется проверка, что данное число является исходным контрольным числом. Если число совпадает - продолжается извлечение. Если нет - формируется сообщение, что цифровая подпись не обнаружена или разрушена.[0057] Step 1. Extract the first 4 bytes to obtain the check digit. Check that this number is the original check digit. If the number matches, continue extracting. If not, generate a message that the digital signature was not found or was corrupted.

[0058] Шаг 2. Извлекаются следующие 64 байта. Это хеш DC-коэффициентов. Полученное значение сверяется с фактическим хешом DC-коэффициентов. Если хеш совпадает - продолжается извлечение. Если нет - выводим сообщение, что цифровая подпись не обнаружена или разрушена.[0058] Step 2. Extract the next 64 bytes. This is the hash of the DC coefficients. The resulting value is checked against the actual hash of the DC coefficients. If the hash matches, continue extracting. If not, print a message that the digital signature was not found or was corrupted.

[0059] Шаг 3. Извлекаются следующие 4 байта, что позволяет получить контрольное число шифрованного вложения.[0059] Step 3: The next 4 bytes are extracted, which allows obtaining the checksum of the encrypted attachment.

[0060] Шаг 4. Извлекается шифрованное вложение. Все дальнейшие биты во вложении относятся к шифрованному вложению. На данном этапе размер вложения является неизвестным. Однако, в первом блоке шифрованного вложения - это 256 байт для RSA, находятся длины вложений. Извлекаются первые 256 байт. Выполняется их расшифровкана открытом (публичном) ключе. Первые 4 байта в этом блоке это количество вложений - в примере на Фиг. 6 содержится 3 вложения. Каждые следующие 4 байта это размер каждого из этих вложений. В них находятся числа 64, 163 и 3756. Если размер любого вложения больше 30000 (ограничение на максимальное вложение), значит блок шифротекста изменен, в связи с чем формируется сообщение что цифровая подпись не обнаружена или разрушена. В противном случае получаются потенциальные размеры вложений и продолжатся извлечение.[0060] Step 4. The encrypted attachment is extracted. All subsequent bits in the attachment are related to the encrypted attachment. At this point, the size of the attachment is unknown. However, in the first block of the encrypted attachment - 256 bytes for RSA - the lengths of the attachments are found. The first 256 bytes are extracted. They are decrypted using the open (public) key. The first 4 bytes in this block are the number of attachments - in the example in Fig. 6, there are 3 attachments. Each subsequent 4 bytes are the size of each of these attachments. They contain the numbers 64, 163, and 3756. If the size of any attachment is greater than 30,000 (the maximum attachment limit), then the ciphertext block has been modified, and a message is generated that the digital signature was not found or was destroyed. Otherwise, the potential sizes of the attachments are obtained and extraction continues.

[0061] Далее определяется размер шифрованного вложения. В соответствии с примером на Фиг. 6 полученные 64 байта размер первого вложения, что является хешом DC-коэффициентов, далее 163 байта размер второго вложения - это размер текста. Размер третьего вложения 3756 байт - это миниатюра изображения (сжатое изображение). Тогда общий размер шифрованного вложения: 64+163+3756=3983 (само вложение); добавляется 4 байта на количество вложений и еще 3 раза по 4 байта на их длины. В итоге получается следующее: 64+163+3756+4+3*4=3999 байт. Поскольку блок шифрования имеет размер 256, то в приведенном примере 3999//256=16 целых блоков шифрования, что равно 4096 байт шифрованного вложения.[0061] Next, the size of the encrypted attachment is determined. In accordance with the example in Fig. 6, the obtained 64 bytes are the size of the first attachment, which is the hash of the DC coefficients, then 163 bytes are the size of the second attachment - this is the text size. The size of the third attachment is 3756 bytes - this is the image thumbnail (compressed image). Then the total size of the encrypted attachment: 64 + 163 + 3756 = 3983 (the attachment itself); 4 bytes are added for the number of attachments and 3 more times 4 bytes for their lengths. The result is as follows: 64 + 163 + 3756 + 4 + 3 * 4 = 3999 bytes. Since the encryption block has a size of 256, then in the given example 3999 // 256 = 16 whole encryption blocks, which is equal to 4096 bytes of encrypted attachment.

[0062] Извлекаются 4096 байт, по которым считается контрольное число CRC32. Если значения совпало с контрольным числом, полученным на шаге 3, то извлечение продолжается. Если нет - формируется сообщение, что цифровая подпись не обнаружена или разрушена.[0062] 4096 bytes are extracted, from which the CRC32 check number is calculated. If the values match the check number obtained in step 3, then extraction continues. If not, a message is generated that the digital signature was not found or was destroyed.

[0063] Расшифровка 4096 байт. Из первого блока, как было указано выше, получается количество вложений, их длины и сами вложения. Выполняется разбивка расшифрованной последовательности байт по количествам байт каждого вложения. Получаются исходные вложения.[0063] Decryption of 4096 bytes. From the first block, as indicated above, the number of attachments, their lengths, and the attachments themselves are obtained. The decrypted byte sequence is broken down by the number of bytes in each attachment. The original attachments are obtained.

[0064] Выполняется сверка хеша из расшифрованных данных с хешом из вложения (который уже сравнен с фактическим на шаге 2). Если хеши совпали - выводится сообщение, что цифровая подпись подтверждена, отображается извлеченная информация - хеш DC-коэффициентов, текст, и миниатюра сгенерированного изображения. Если нет - выводится сообщение, что цифровая подпись не обнаружена или разрушена.[0064] The hash from the decrypted data is checked against the hash from the attachment (which has already been compared with the actual one in step 2). If the hashes match, a message is displayed that the digital signature is confirmed, and the extracted information is displayed - the hash of the DC coefficients, the text, and a thumbnail of the generated image. If not, a message is displayed that the digital signature was not found or was destroyed.

[0065] На Фиг. 7 представлен общий вид вычислительного устройства (500), пригодного для выполнения способа (200). Устройство (500) может представлять собой, например, сервер или иной тип вычислительного устройства, который может применяться для реализации заявленного технического решения, в том числе: смартфон, планшет, ноутбук, компьютер и т.п. Устройство (500) может также входить в состав облачной вычислительной платформы.[0065] Fig. 7 shows a general view of a computing device (500) suitable for performing the method (200). The device (500) may be, for example, a server or another type of computing device that can be used to implement the claimed technical solution, including: a smartphone, tablet, laptop, computer, etc. The device (500) may also be part of a cloud computing platform.

[0066] В общем случае вычислительное устройство (500) содержит объединенные общей шиной информационного обмена один или несколько процессоров (501), средства памяти, такие как ОЗУ (502) и ПЗУ (503), интерфейсы ввода/вывода (504), устройства ввода/вывода (505), и устройство для сетевого взаимодействия (506). [0066] In general, the computing device (500) comprises one or more processors (501), memory means such as RAM (502) and ROM (503), input/output interfaces (504), input/output devices (505), and a device for network interaction (506), united by a common information exchange bus.

[0067] Процессор (501) (или несколько процессоров, многоядерный процессор) могут выбираться из ассортимента устройств, широко применяемых в текущее время, например, компаний Intel™, AMD™, Apple™, Samsung Exynos™, MediaTEK™, Qualcomm Snapdragon™ и т.п. В качестве процессора (401) может также применяться графический процессор, например, Nvidia, AMD, Graphcore и пр.[0067] The processor (501) (or several processors, a multi-core processor) can be selected from a range of devices that are widely used at the present time, for example, from Intel™, AMD™, Apple™, Samsung Exynos™, MediaTEK™, Qualcomm Snapdragon™, etc. A graphics processor can also be used as the processor (401), for example, from Nvidia, AMD, Graphcore, etc.

[0068] ОЗУ (502) представляет собой оперативную память и предназначено для хранения исполняемых процессором (501) машиночитаемых инструкций для выполнение необходимых операций по логической обработке данных. ОЗУ (502), как правило, содержит исполняемые инструкции операционной системы и соответствующих программных компонент (приложения, программные модули и т.п.).[0068] RAM (502) is a random access memory and is intended for storing machine-readable instructions executable by the processor (501) for performing the necessary operations for logical data processing. RAM (502), as a rule, contains executable instructions of the operating system and the corresponding software components (applications, software modules, etc.).

[0069] ПЗУ (503) представляет собой одно или более устройств постоянного хранения данных, например, жесткий диск (HDD), твердотельный накопитель данных (SSD), флэш-память (EEPROM, NAND и т.п.), оптические носители информации (CD-R/RW, DVD-R/RW, BlueRay Disc, MD) и др.[0069] The ROM (503) represents one or more permanent data storage devices, such as a hard disk drive (HDD), a solid state drive (SSD), flash memory (EEPROM, NAND, etc.), optical storage media (CD-R/RW, DVD-R/RW, BlueRay Disc, MD), etc.

[0070] Для организации работы компонентов устройства (500) и организации работы внешних подключаемых устройств применяются различные виды интерфейсов В/В (504). Выбор соответствующих интерфейсов зависит от конкретного исполнения вычислительного устройства, которые могут представлять собой, не ограничиваясь: PCI, AGP, PS/2, IrDa, FireWire, LPT, COM, SATA, IDE, Lightning, USB (2.0, 3.0, 3.1, micro, mini, type C), TRS/Audio jack (2.5, 3.5, 6.35), HDMI, DVI, VGA, Display Port, RJ45, RS232 и т.п.[0070] To organize the operation of the components of the device (500) and to organize the operation of external connected devices, various types of I/O interfaces (504) are used. The selection of the corresponding interfaces depends on the specific design of the computing device, which may be, without limitation: PCI, AGP, PS/2, IrDa, FireWire, LPT, COM, SATA, IDE, Lightning, USB (2.0, 3.0, 3.1, micro, mini, type C), TRS/Audio jack (2.5, 3.5, 6.35), HDMI, DVI, VGA, Display Port, RJ45, RS232, etc.

[0071] Для обеспечения взаимодействия пользователя с вычислительным устройством (500) применяются различные средства (505) В/В информации, например, клавиатура, дисплей (монитор), сенсорный дисплей, тач-пад, джойстик, манипулятор мышь, световое перо, стилус, сенсорная панель, трекбол, динамики, микрофон, средства дополненной реальности, оптические сенсоры, планшет, световые индикаторы, проектор, камера, средства биометрической идентификации (сканер сетчатки глаза, сканер отпечатков пальцев, модуль распознавания голоса) и т.п.[0071] To ensure user interaction with the computing device (500), various I/O information means (505) are used, for example, a keyboard, a display (monitor), a touch display, a touchpad, a joystick, a mouse, a light pen, a stylus, a touch panel, a trackball, speakers, a microphone, augmented reality means, optical sensors, a tablet, light indicators, a projector, a camera, biometric identification means (retina scanner, fingerprint scanner, voice recognition module), etc.

[0072] Средство сетевого взаимодействия (506) обеспечивает передачу данных устройством (500) посредством внутренней или внешней вычислительной сети, например, Интранет, Интернет, ЛВС и т.п. В качестве одного или более средств (506) может использоваться, но не ограничиваться: Ethernet карта, GSM модем, GPRS модем, LTE модем, 5G модем, модуль спутниковой связи, NFC модуль, Bluetooth и/или BLE модуль, Wi-Fi модуль и др.[0072] The network interaction means (506) ensures the transmission of data by the device (500) via an internal or external computer network, for example, an Intranet, the Internet, a LAN, etc. One or more means (506) may be, but are not limited to: an Ethernet card, a GSM modem, a GPRS modem, an LTE modem, a 5G modem, a satellite communication module, an NFC module, a Bluetooth and/or BLE module, a Wi-Fi module, etc.

[0073] Дополнительно могут применяться также средства спутниковой навигации в составе устройства (500), например, GPS, ГЛОНАСС, BeiDou, Galileo.[0073] Additionally, satellite navigation means may also be used as part of the device (500), for example, GPS, GLONASS, BeiDou, Galileo.

[0074] Представленные материалы заявки раскрывают предпочтительные примеры реализации технического решения и не должны трактоваться как ограничивающие иные, частные примеры его воплощения, не выходящие за пределы испрашиваемой правовой охраны, которые являются очевидными для специалистов соответствующей области техники.[0074] The submitted application materials disclose preferred examples of the implementation of the technical solution and should not be interpreted as limiting other, particular examples of its implementation that do not go beyond the scope of the requested legal protection, which are obvious to specialists in the relevant field of technology.

Источники информации:Sources of information:

1. Hamilton, Eric: JPEG File Interchange Format, Version 1.02. 1 September 1992;1. Hamilton, Eric: JPEG File Interchange Format, Version 1.02. 1 September 1992;

2. Recommendation ITU-T T.871: Information technology - Digital compression and coding of continuous-tone still images: JPEG File Interchange Format (JFIF). Approved 14 May 2011; posted 11 September 2012;2. Recommendation ITU-T T.871: Information technology - Digital compression and coding of continuous-tone still images: JPEG File Interchange Format (JFIF). Approved 14 May 2011; posted 11 September 2012;

3. Recommendation ITU-T T.81: Information technology - Digital compression and coding of continuous-tone still images - Requirements and guidelines. Approved 18 September 1992; posted 14 April 2004.3. Recommendation ITU-T T.81: Information technology - Digital compression and coding of continuous-tone still images - Requirements and guidelines. Approved 18 September 1992; posted 14 April 2004.

Claims (27)

1. Способ защиты подлинности изображений, генерируемых на основании текстового запроса моделью машинного обучения, содержащий этапы, на которых:1. A method for protecting the authenticity of images generated based on a text query by a machine learning model, comprising the steps of: a) получают данные пользовательского ввода для генерирования изображения;a) receive user input data to generate an image; b) генерируют изображение в формате JPG с помощью модели машинного обучения;b) generate a JPG image using a machine learning model; c) фиксируют данные пользовательского ввода, содержащие: время ввода, ID пользователя и текстовый запрос;c) record user input data, including: input time, user ID and text query; d) извлекают из данных файла сгенерированного изображения в формате JPG блоки значений коэффициентов дискретного косинусного преобразования (ДКП) для яркостной (Y) и цветных (Cb- и Cr) составляющих изображения;d) extracting from the data of the generated image file in JPG format blocks of values of the coefficients of the discrete cosine transform (DCT) for the brightness (Y) and color (Cb- and Cr) components of the image; e) получают последовательность низкочастотных коэффициентов ДКП (DC-коэффициенты) и высокочастотных коэффициентов ДКП (АС-коэффициенты) по всем блокам яркостной составляющей и рассчитывают хеш-функцию на основании по меньшей мере одного АС-коэффициента и/или по меньшей мере одного DC-коэффициента;e) obtaining a sequence of low-frequency DCT coefficients (DC coefficients) and high-frequency DCT coefficients (AC coefficients) for all blocks of the luminance component and calculating a hash function based on at least one AC coefficient and/or at least one DC coefficient; f) по заданному ключу определяют блоки коэффициентов ДКП и позиции коэффициентов ДКП внутри блоков, исключая в блоках АС-коэффициенты и/или DC-коэффициенты ДКП, используемые на этапе е);f) using a given key, determine the blocks of DCT coefficients and the positions of the DCT coefficients within the blocks, excluding in the blocks the AC coefficients and/or DC coefficients of the DCT used in step e); g) формируют вложение для защиты сгенерированного изображения, состоящее из последовательности, включающей: время ввода, ID пользователя, текстовый запрос, значение хеш-функции, полученной на этапе е), и дополнительную текстовую информацию;g) form an attachment for protecting the generated image, consisting of a sequence including: input time, user ID, text query, hash function value obtained in step e), and additional text information; h) выполняют формирование зашифрованной последовательности с помощью шифрования данных, полученных на этапе g), закрытым ключом;h) generate an encrypted sequence by encrypting the data obtained in step g) with a private key; i) осуществляют встраивание в коэффициенты ДКП сгенерированного изображения, определенные на этапе f), значений хеш-функции, полученной на этапе е), и зашифрованной последовательности, полученной на этапе h);i) embedding into the DCT coefficients of the generated image, determined in step f), the values of the hash function obtained in step e) and the encrypted sequence obtained in step h); j) предоставляют защищенное изображение пользователю.j) provide a secure image to the user. 2. Способ по п. 1, в котором на этапе d) выполняется извлечение блоков для встраивания информации по меньшей мере одной из Y-, Cb- и Cr- составляющих изображения.2. The method according to claim 1, wherein at step d) the extraction of blocks for embedding information of at least one of the Y-, Cb- and Cr-components of the image is performed. 3. Способ по п. 1, в котором на этапе е) последовательность коэффициентов ДКП состоит из коэффициентов ДКП одной из Y-, Cb- и Cr- составляющих изображения.3. The method according to claim 1, wherein at step e) the sequence of DCT coefficients consists of the DCT coefficients of one of the Y-, Cb- and Cr- components of the image. 4. Способ по п. 1, в котором на этапе е) хеш-функцию рассчитывают по коэффициентам ДКП по меньшей мере одной из Y-, Cb- и Cr- составляющих изображения.4. The method according to item 1, wherein at step e) the hash function is calculated based on the DCT coefficients of at least one of the Y-, Cb- and Cr-components of the image. 5. Способ по п. 4, в котором на этапе f) по заданному ключу определяют блоки коэффициентов ДКП и позиции коэффициентов ДКП внутри блоков, включающие в себя АС-коэффициенты и DC-коэффициенты ДКП, по меньшей мере одной из Y-, Cb- и Cr- составляющих изображения.5. The method according to claim 4, wherein at step f), using a given key, blocks of DCT coefficients and positions of DCT coefficients within the blocks are determined, including AC coefficients and DC coefficients of the DCT of at least one of the Y, Cb and Cr components of the image. 6. Способ по п. 1, в котором на этапе с) дополнительно формируется сжатое изображение на основании сгенерированного изображения.6. The method according to claim 1, wherein at step c) a compressed image is additionally formed based on the generated image. 7. Способ по п. 6, в котором на основании сжатого изображения формируется последовательность байт, которая добавляется к данным на этапе g) при формировании вложения.7. The method according to claim 6, wherein a sequence of bytes is formed based on the compressed image, which is added to the data at step g) when forming the attachment. 8. Система защиты подлинности изображений, генерируемых на основании текстового запроса моделью машинного обучения, содержащая по меньшей мере один процессор и по меньшей мере одну память, связанную с процессором и содержащую машиночитаемые инструкции, которые при их исполнении процессором позволяют ему:8. A system for protecting the authenticity of images generated based on a text query by a machine learning model, comprising at least one processor and at least one memory associated with the processor and containing machine-readable instructions that, when executed by the processor, allow it to: получать данные пользовательского ввода для генерирования изображения; генерировать изображение в формате JPG с помощью модели машинного обучения;receive user input data to generate an image; generate a JPG image using a machine learning model; фиксировать данные пользовательского ввода, содержащие: время ввода, ID пользователя и текстовый запрос;record user input data, including: input time, user ID, and text query; извлекать из данных файла сгенерированного изображения в формате JPG блоки значений коэффициентов дискретного косинусного преобразования (ДКП) для яркостной (Y) и цветных (Cb- и Cr) составляющих изображения;extract from the data of the generated JPG image file blocks of values of the discrete cosine transform (DCT) coefficients for the brightness (Y) and color (Cb- and Cr) components of the image; получать последовательность низкочастотных коэффициентов ДКП (DC-коэффициенты) и высокочастотных коэффициентов ДКП (АС-коэффициенты) по всем блокам яркостной составляющей и рассчитывать хеш-функцию на основании по меньшей мере одного АС-коэффициента и/или по меньшей мере одного DC-коэффициента;obtain a sequence of low-frequency DCT coefficients (DC coefficients) and high-frequency DCT coefficients (AC coefficients) for all blocks of the luminance component and calculate a hash function based on at least one AC coefficient and/or at least one DC coefficient; по заданному ключу определять блоки коэффициентов ДКП и позиции коэффициентов ДКП внутри блоков, исключая в блоках DC-коэффициенты ДКП, для расчета хеш-функции;using a given key, determine the blocks of DCT coefficients and the positions of DCT coefficients within the blocks, excluding DC DCT coefficients in the blocks, to calculate the hash function; формировать вложение для защиты сгенерированного изображения, состоящее из последовательности, включающей: время ввода, ID пользователя, текстовый запрос, значение рассчитанной хеш-функции и дополнительную текстовую информацию;form an attachment to protect the generated image, consisting of a sequence including: input time, user ID, text query, calculated hash function value and additional text information; выполнять формирование зашифрованной последовательности с помощью шифрования данных вложения закрытым ключом;perform the formation of an encrypted sequence by encrypting the attachment data with a private key; осуществлять встраивание в выбранные коэффициенты ДКП сгенерированного изображения полученного значения хеш-функции и зашифрованной последовательности;implement the embedding of the generated image of the obtained hash function value and the encrypted sequence into the selected DCT coefficients; предоставлять защищенное изображение пользователю.provide a protected image to the user.
RU2024115143A 2024-06-03 2024-06-03 Method and system for protecting authenticity of images generated by machine learning model RU2829566C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/RU2024/000370 WO2025254557A1 (en) 2024-06-03 2024-12-12 Method and system for protecting the authenticity of images generated by a machine learning model

Publications (1)

Publication Number Publication Date
RU2829566C1 true RU2829566C1 (en) 2024-10-31

Family

ID=

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2450354C1 (en) * 2010-12-13 2012-05-10 Закрытое акционерное общество "Научно-производственная фирма "ТИРС" (ЗАО "НПФ "ТИРС") Method of creating and checking electronic image authenticated by digital watermark
CN102880997A (en) * 2011-05-26 2013-01-16 江苏技术师范学院 Method for embedding watermark image
US20230377226A1 (en) * 2022-05-19 2023-11-23 Google Llc Generating images using sequences of generative neural networks
RU2810678C1 (en) * 2019-10-16 2023-12-28 Публичное Акционерное Общество "Сбербанк России" (Пао Сбербанк) Image generation system in chat
US20240169623A1 (en) * 2022-11-22 2024-05-23 Adobe Inc. Multi-modal image generation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2450354C1 (en) * 2010-12-13 2012-05-10 Закрытое акционерное общество "Научно-производственная фирма "ТИРС" (ЗАО "НПФ "ТИРС") Method of creating and checking electronic image authenticated by digital watermark
CN102880997A (en) * 2011-05-26 2013-01-16 江苏技术师范学院 Method for embedding watermark image
RU2810678C1 (en) * 2019-10-16 2023-12-28 Публичное Акционерное Общество "Сбербанк России" (Пао Сбербанк) Image generation system in chat
US20230377226A1 (en) * 2022-05-19 2023-11-23 Google Llc Generating images using sequences of generative neural networks
US20240169623A1 (en) * 2022-11-22 2024-05-23 Adobe Inc. Multi-modal image generation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Rui Ma et al. PiGW: A Plug-in Generative Watermarking Framework, опубл. 04.01.2024 [найдено 05.08.2024]. Найдено в Интернет: URL: https://arxiv.org/pdf/2403.12053v1. *
Sven Gowal et al. Identifying AI-generated images with SynthID, опубл. 29.08.2023 [найдено 05.08.2024]. Найдено в Интернет: https://deepmind.google/discover/blog/identifying-ai-generated-images-with-synthid/. *

Similar Documents

Publication Publication Date Title
US12332986B2 (en) Content authentication and validation via multi-factor digital tokens, systems, and methods
US20230360165A1 (en) Method and apparatus for protecting digital photos from alteration
Rey et al. A survey of watermarking algorithms for image authentication
US7187781B2 (en) Information processing device and method for processing picture data and digital watermark information
JP4722599B2 (en) Electronic image data verification program, electronic image data verification system, and electronic image data verification method
KR19990082729A (en) Secured signal modification and verification with privacy control
KR100878579B1 (en) Watermarking method, watermark checking method, watermarking device and watermark checking device
CN1184294A (en) System for embedding authentication information into image and image change detection system
US20090022358A1 (en) Method of Digital Watermark and the Corresponding Device, and Digital Camera Which Can Append Watermark
KR101925463B1 (en) Method of record and validation of image hash value and apparatus using the same
CN111177666A (en) Forensic document anti-counterfeiting and anti-tampering method and system based on fragile watermark
JP2006115501A (en) Secure image authentication by discrete level tamper localization
CN111881425B (en) Picture copyright authentication method, device and storage medium
RU2829566C1 (en) Method and system for protecting authenticity of images generated by machine learning model
CN114782238A (en) Image self-authentication method based on hash function and information hiding
CN113177214A (en) Image publishing and auditing method, related device and computer program product
RU2847551C1 (en) Method and system for protecting authenticity of images generated based on text query by machine learning model
WO2019041769A1 (en) Image processing method and application server
WO2025254557A1 (en) Method and system for protecting the authenticity of images generated by a machine learning model
CN118503952A (en) Information embedding method and device, electronic equipment and readable storage medium
CN113379583B (en) Image signature method, device, computing equipment and storage medium
RU2761417C1 (en) Method for steganographying a digital image using a graphic digital label and method for decrypting a steganographied image
JP5408113B2 (en) Electronic image data verification program, electronic image data verification method, and electronic image data verification apparatus
US12118638B1 (en) Anti-leak digital document marking system and method using distributed ledger
Dadkhah et al. Efficient image authentication and tamper localization algorithm using active watermarking