Electronic device and operation method thereof

The electronic device employs a processor to replace unique identifiers and encode information line-by-line, using hash values to detect and prevent confidential code leaks, thereby enhancing security in devices using generative AI.

WO2025211628A1PCT designated stage Publication Date: 2025-10-09SAMSUNG ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2025/003752
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-05
Filing Date
2025-03-25
Publication Date
2025-10-09

AI Technical Summary

Technical Problem

The proliferation of electronic devices using generative AI poses security risks due to the potential inclusion of confidential information in the information entering these systems, necessitating methods to prevent confidential information leaks.

Method used

An electronic device equipped with a processor and memory that replaces unique identifiers in incoming information with setting values, encodes the information line-by-line, and determines the presence of confidential codes using hash values and encoding algorithms to identify potential leaks.

Benefits of technology

Effectively identifies and prevents the inclusion of confidential codes by converting and encoding information, reducing the risk of information leaks and enhancing security in electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025003752_09102025_PF_FP_ABST
    Figure KR2025003752_09102025_PF_FP_ABST
Patent Text Reader

Abstract

An electronic device is disclosed. The electronic device comprises a processor, a communication module, and a memory that stores a setting value corresponding to at least one unique identifier, wherein the processor: receives first information including a plurality of lines through the communication module; generates converted first information by replacing the at least one unique identifier included in the first information with the setting value, on the basis of the setting value stored in the memory; encodes the converted first information on a line-by-line basis; and checks whether the first information includes a confidential code, on the basis of the encoded first information and confidential code information generated for each line on the basis of at least one confidential code.
Need to check novelty before this filing date? Find Prior Art

Description

Electronic device and method of operation thereof

[0001] The present disclosure relates to an electronic device and an operating method thereof for determining whether a confidential code is included in a code. The present disclosure also relates to an electronic device and an operating method thereof for updating a confidential code.

[0002] Thanks to remarkable advancements in information and communication technology and semiconductor technology, the proliferation and use of various electronic devices is rapidly increasing. Electronic devices are being developed to enable users to carry and communicate with one another. An electronic device can refer to any device that performs a specific function based on its embedded software, such as a mobile communication terminal, tablet PC, audio / video device, desktop / laptop computer, or in-vehicle navigation system. However, this is not limited to these devices; an electronic device can also refer to a server that stores data.

[0003] As the use of generative AI increases, security issues may arise due to information leaks entering the programs that provide generative AI. Problems can arise if confidential information (e.g., confidential code) is included in the information entering generative AI. Therefore, methods to prevent confidential information leaks in advance are needed.

[0004] An electronic device according to one embodiment of the present disclosure may include a memory, a communication module, and a processor that store a setting value corresponding to at least one unique identifier.

[0005] According to one embodiment, the processor may receive first information including a plurality of lines via the communication module.

[0006] According to one embodiment, the processor may generate converted first information by replacing the at least one unique identifier included in the first information with the setting value based on the setting value stored in the memory.

[0007] According to one embodiment, the processor may encode the converted first information in units of each line.

[0008] According to one embodiment, the processor can determine whether the first information includes a confidential code based on confidential code information generated for each line based on at least one confidential code and the encoded first information.

[0009] A method of operating an electronic device according to one embodiment of the present disclosure may include an operation of receiving first information including a plurality of lines.

[0010] According to one embodiment, the method of operation may include generating converted first information by replacing at least one unique identifier included in the first information with a setting value corresponding to at least one unique identifier.

[0011] According to one embodiment, the operating method may include an operation of encoding the converted first information for each line.

[0012] According to one embodiment, the operating method may include an operation of checking whether the first information includes a confidential code based on confidential code information generated for each line unit based on at least one confidential code and the encoded first information.

[0013] An electronic device according to one embodiment of the present disclosure may include a memory, an input module, and a processor that stores a setting value corresponding to at least one unique identifier.

[0014] According to one embodiment, the processor may obtain first information including a plurality of lines through the input module.

[0015] According to one embodiment, the processor may generate converted first information by replacing the at least one unique identifier included in the first information with the setting value based on the setting value stored in the memory.

[0016] According to one embodiment, the processor may encode the converted first information in units of each line.

[0017] According to one embodiment, the processor can determine whether the first information includes a confidential code based on confidential code information generated for each line based on at least one confidential code and the encoded first information.

[0018] FIG. 1 is a block diagram of an electronic device within a network environment according to one embodiment.

[0019] FIG. 2 is a block diagram of electronic device configurations according to one embodiment.

[0020] FIG. 3 is a flowchart illustrating an operating method of an electronic device according to one embodiment.

[0021] FIG. 4a is a flowchart illustrating a method for checking whether first information includes a confidential code according to one embodiment.

[0022] FIG. 4b is a diagram illustrating a method for checking whether first information includes a confidential code according to one embodiment.

[0023] FIG. 5 is a flowchart illustrating a method for checking whether first information includes a confidential code according to one embodiment.

[0024] FIG. 6 is a flowchart illustrating a method for confirming a first similarity according to one embodiment.

[0025] FIG. 7 is a flowchart illustrating a method for verifying a second hash value according to one embodiment.

[0026] FIG. 8A is a flowchart illustrating a method for converting first information according to one embodiment.

[0027] FIG. 8b is a diagram for explaining a method of converting first information according to one embodiment.

[0028] FIG. 9 is a drawing for explaining confidential code information according to one embodiment.

[0029] FIG. 10A and FIG. 10B are drawings for explaining confidential code information according to one embodiment.

[0030] FIG. 11a is a flowchart illustrating a method for updating confidential code information according to one embodiment.

[0031] FIGS. 11b and 11c are diagrams illustrating a method for updating confidential code information according to one embodiment.

[0032] FIG. 12a is a flowchart illustrating a method for updating confidential code information according to one embodiment.

[0033] FIG. 12b is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0034] FIG. 12c is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0035] FIG. 13a is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0036] FIG. 13b is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0037] FIG. 1 is a block diagram of an electronic device (101) within a network environment (100) according to one embodiment. Referring to FIG. 1 , in the network environment (100), the electronic device (101) may communicate with the electronic device (102) via a first network (198) (e.g., a short-range wireless communication network), or may communicate with at least one of the electronic device (104) or the server (108) via a second network (199) (e.g., a long-range wireless communication network). According to one embodiment, the electronic device (101) may communicate with the electronic device (104) via the server (108). According to one embodiment, the electronic device (101) may include a processor (120), a memory (130), an input module (150), an audio output module (155), a display module (160), an audio module (170), a sensor module (176), an interface (177), a connection terminal (178), a haptic module (179), a camera module (180), a power management module (188), a battery (189), a communication module (190), a subscriber identification module (196), or an antenna module (197). In some embodiments, the electronic device (101) may omit at least one of these components (e.g., the connection terminal (178)), or may have one or more other components added. In some embodiments, some of these components (e.g., the sensor module (176), the camera module (180), or the antenna module (197)) may be integrated into one component (e.g., the display module (160)).

[0038] The processor (120) may, for example, execute software (e.g., a program (140)) to control at least one other component (e.g., a hardware or software component) of the electronic device (101) connected to the processor (120) and perform various data processing or operations. According to one embodiment, as at least a part of the data processing or operations, the processor (120) may store commands or data received from other components (e.g., a sensor module (176) or a communication module (190)) in a volatile memory (132), process the commands or data stored in the volatile memory (132), and store result data in a non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., a central processing unit or an application processor) or an auxiliary processor (123) (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together with the main processor (121). For example, when the electronic device (101) includes the main processor (121) and the auxiliary processor (123), the auxiliary processor (123) may be configured to use less power than the main processor (121) or to be specialized for a given function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as a part thereof.

[0039] The auxiliary processor (123) may control at least a portion of functions or states associated with at least one component (e.g., a display module (160), a sensor module (176), or a communication module (190)) of the electronic device (101), for example, on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. In one embodiment, the auxiliary processor (123) (e.g., an image signal processor or a communication processor) may be implemented as a part of another functionally related component (e.g., a camera module (180) or a communication module (190)). In one embodiment, the auxiliary processor (123) (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. This learning can be performed, for example, on the electronic device (101) itself where the artificial intelligence model is executed, or can be performed through a separate server (e.g., server (108)). The learning algorithm can include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model can include multiple artificial neural network layers.The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.

[0040] The memory (130) can store various data used by at least one component (e.g., processor (120) or sensor module (176)) of the electronic device (101). The data can include, for example, software (e.g., program (140)) and input data or output data for commands related thereto. The memory (130) can include volatile memory (132) or non-volatile memory (134).

[0041] The program (140) may be stored as software in the memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).

[0042] The input module (150) can receive commands or data to be used in a component of the electronic device (101) (e.g., a processor (120)) from an external source (e.g., a user) of the electronic device (101). The input module (150) can include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).

[0043] The audio output module (155) can output audio signals to the outside of the electronic device (101). The audio output module (155) can include, for example, a speaker or a receiver. The speaker can be used for general purposes, such as multimedia playback or recording playback. The receiver can be used to receive incoming calls. In one embodiment, the receiver can be implemented separately from the speaker or as part of the speaker.

[0044] The display module (160) can visually provide information to an external party (e.g., a user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling the device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of a force generated by the touch.

[0045] The audio module (170) can convert sound into an electrical signal, or vice versa, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150), output sound through the sound output module (155), or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphone) directly or wirelessly connected to the electronic device (101).

[0046] The sensor module (176) can detect the operating status (e.g., power or temperature) of the electronic device (101) or the external environmental status (e.g., user status) and generate an electrical signal or data value corresponding to the detected status. According to one embodiment, the sensor module (176) can include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

[0047] The interface (177) may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device (101) with an external electronic device (e.g., the electronic device (102)). In one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.

[0048] The connection terminal (178) may include a connector through which the electronic device (101) may be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).

[0049] The haptic module (179) can convert electrical signals into mechanical stimuli (e.g., vibration or movement) or electrical stimuli that a user can perceive through tactile or kinesthetic sensations. According to one embodiment, the haptic module (179) can include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

[0050] The camera module (180) can capture still images and videos. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.

[0051] The power management module (188) can manage power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented as, for example, at least a part of a power management integrated circuit (PMIC).

[0052] A battery (189) may power at least one component of the electronic device (101). In one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.

[0053] The communication module (190) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may operate independently from the processor (120) (e.g., application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (194) (e.g., a local area network (LAN) communication module, or a power line communication module). Among these communication modules, the corresponding communication module can communicate with an external electronic device (104) via a first network (198) (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network (199) (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules can be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can verify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) by using subscriber information (e.g., an international mobile subscriber identity (IMSI)) stored in the subscriber identification module (196).

[0054] The wireless communication module (192) can support 5G networks and next-generation communication technologies following the 4G network, such as NR access technology (new radio access technology). The NR access technology can support high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and connection of multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency communications)). The wireless communication module (192) can support, for example, a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate. The wireless communication module (192) can support various technologies for securing performance in a high-frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), an external electronic device (e.g., the electronic device (104)), or a network system (e.g., the second network (199)). According to one embodiment, the wireless communication module (192) can support a peak data rate (e.g., 20 Gbps or more) for eMBB realization, a loss coverage (e.g., 164 dB or less) for mMTC realization, or a U-plane latency (e.g., 0.5 ms or less for downlink (DL) and uplink (UL), or 1 ms or less for round trip) for URLLC realization.

[0055] The antenna module (197) can transmit or receive signals or power to or from an external device (e.g., an external electronic device). In one embodiment, the antenna module (197) may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). In one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as the first network (198) or the second network (199), may be selected from the plurality of antennas, for example, by the communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device via the at least one selected antenna. In some embodiments, in addition to the radiator, another component (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module (197).

[0056] According to various embodiments, the antenna module (197) may form a mmWave antenna module. In one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent a first side (e.g., a bottom side) of the printed circuit board and capable of supporting a designated high-frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., an array antenna) disposed on or adjacent a second side (e.g., a top side or a side side) of the printed circuit board and capable of transmitting or receiving signals in the designated high-frequency band.

[0057] At least some of the above components can be interconnected and exchange signals (e.g., commands or data) with each other via a communication method between peripheral devices (e.g., a bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)).

[0058] According to one embodiment, commands or data may be transmitted or received between the electronic device (101) and an external electronic device (104) via a server (108) connected to a second network (199). Each of the external electronic devices (102 or 104) may be the same or a different type of device as the electronic device (101). According to one embodiment, all or part of the operations executed in the electronic device (101) may be executed in one or more of the external electronic devices (102, 104, or 108). For example, when the electronic device (101) is to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device (101) may, instead of or in addition to executing the function or service itself, request one or more external electronic devices to perform the function or at least a part of the service. One or more external electronic devices that receive the request may execute at least a portion of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may process the result as is or additionally and provide it as at least a portion of a response to the request. For this purpose, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. The electronic device (101) may provide an ultra-low latency service by using distributed computing or mobile edge computing, for example. In another embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server utilizing machine learning and / or a neural network. According to one embodiment, the external electronic device (104) or the server (108) may be included in the second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.

[0059] In the detailed description below, reference numerals in the drawings may be used interchangeably or omitted for components that can be easily understood through the preceding embodiments, and their detailed descriptions may also be omitted. An electronic device according to an embodiment disclosed in this document may be implemented by selectively combining components of different embodiments, and components of one embodiment may be replaced by components of another embodiment. For example, it should be noted that the present invention is not limited to specific drawings or embodiments.

[0060] FIG. 2 is a block diagram of electronic device configurations according to one embodiment.

[0061] Referring to FIG. 2, in one embodiment, an electronic device (e.g., server (108), 200 of FIG. 1) may include a communication module (210), a memory (220, e.g., memory (130) of FIG. 1) and / or a processor (230).

[0062] In one embodiment, the communication module (210) may have at least a portion of the same or similar configuration as the communication module (190) of FIG. 1.

[0063] In one embodiment, the communication module (210) may communicate with an external device (e.g., an electronic device (102), an electronic device (104), or a server (108) of FIG. 1). In one embodiment, the external device may be implemented as a user terminal or a server, but is not limited thereto.

[0064] In one embodiment, the communication module (210) may obtain first information from an external device. In one embodiment, the first information may be information about code that a user has entered or plans to enter into a designated application (e.g., an application utilizing generative artificial intelligence). In one embodiment, the first information may include program code comprising multiple lines of code.

[0065] In one embodiment, when the electronic device (200) is implemented as a server, the electronic device (200) can obtain first information from an external device through a communication module (210). Alternatively, in one embodiment, when the electronic device (200) is implemented as an electronic device (e.g., a user terminal) rather than a server, the electronic device (200) can obtain first information through the communication module (210) or obtain first information based on an input received through an input module (e.g., the input module (150) of FIG. 1). An operation method when the electronic device (200) is implemented as a user terminal will be described later.

[0066] The memory (220) can store various data used by at least one component of the electronic device (200). The data can include, for example, software (e.g., a program (140 of FIG. 1)) and input data or output data for commands related thereto. The memory (220) can include volatile memory (e.g., 132 of FIG. 1) or non-volatile memory (e.g., 134 of FIG. 1).

[0067] The program (140) may be stored as software in the memory (220) and may include, for example, an operating system (e.g., 142 in FIG. 1), middleware (e.g., 144 in FIG. 1), or an application (e.g., 146 in FIG. 1).

[0068] In one embodiment, the memory (220) may store a configuration value corresponding to at least one unique identifier. A unique identifier is an identifier whose uniqueness is guaranteed among identifiers included in the code. In one embodiment, the configuration value corresponding to the unique identifier may be a hash value corresponding to the unique identifier.

[0069] In one embodiment, the identification information corresponding to the set value for at least one unique identifier may be information including at least one unique identifier and a set value corresponding to each of the at least one unique identifiers. In one embodiment, the hash value corresponding to the unique identifier may be a value calculated based on a designated algorithm. The designated algorithm may be, but is not limited to, the locality sensitive hashing (LSH) algorithm or a similar algorithm. This will be described later.

[0070] In one embodiment, the processor (230) may have at least a portion of the same or similar configuration as the processor (120) of FIG. 1. In one embodiment, the processor (230) may include one or more processors.

[0071] In one embodiment, the processor (230) may perform various operations by executing instructions stored in memory (220, e.g., memory (130) of FIG. 1).

[0072] According to one embodiment, the processor (230) may receive first information including a plurality of lines via the communication module (210). However, this is not limited thereto, and the first information may of course include a single line (e.g., a line of code).

[0073] According to one embodiment, the processor (230) may verify identification information corresponding to a setting value corresponding to at least one unique identifier. A unique identifier is an identifier whose uniqueness is guaranteed among identifiers included in a code. In one embodiment, the setting value corresponding to the unique identifier may be a hash value corresponding to the unique identifier, and the identification information may be information including a setting value corresponding to at least one unique identifier. In one embodiment, the hash value corresponding to the unique identifier may be a value calculated based on a designated algorithm. The designated algorithm may be, but is not limited to, a locality sensitive hashing (LSH) algorithm or a similar algorithm. This will be described later.

[0074] In one embodiment, the identification information may be stored in the memory (220). In one embodiment, the processor (230) may verify the identification information stored in the memory (220). However, the present invention is not limited thereto, and in one embodiment, the identification information may be stored in an external device (e.g., the electronic device (104) or server (108) of FIG. 1). In one embodiment, the processor (230) may also receive the identification information from the external device through a communication module (e.g., the communication module (190) of FIG. 1).

[0075] According to one embodiment, the processor (230) may convert first information obtained through the electronic device (200) based on identification information corresponding to a set value corresponding to at least one unique identifier.

[0076] For example, the processor (230) may generate converted first information by replacing at least one unique identifier included in the first information with a setting value based on a setting value stored in the memory (220). For example, based on the presence of a token corresponding to a unique identifier among a plurality of tokens included in the first information, the processor (230) may convert the token corresponding to the unique identifier into a setting value corresponding to the identifier.

[0077] In one embodiment, the processor (230) may obtain first information from an external device (e.g., the electronic device (104) or server (108) of FIG. 1) via a communication module. Alternatively, in one embodiment, the first information may be stored in the memory (220). However, the present invention is not limited thereto, and in one embodiment, the first information may be obtained based on a user input received via an input module (e.g., the input module (150) of FIG. 1).

[0078] In one embodiment, the processor (230) may convert the first information based on the identification information. For example, the processor (230) may parse the code included in the first information into first units (e.g., line units). If a token corresponding to a unique identifier exists among the tokens included in the code of the parsed first unit, the processor (230) may convert the token corresponding to the unique identifier into a value (e.g., a hash value) corresponding to the unique identifier based on the identification information.

[0079] Alternatively, for example, if there is a token among the tokens included in the code of the first unit that does not correspond to the unique identifier, the processor (230) may convert the non-corresponding token into a designated hash value. In one embodiment, the designated hash value may be stored in the memory (220), but is not limited thereto, and in one embodiment, the processor (230) may obtain the designated hash value from an external device. Accordingly, the converted first information may be information including a hash value. A specific method of converting the first information will be described in detail with reference to FIGS. 8A and 8B.

[0080] According to one embodiment, the processor (230) may perform line-by-line encoding on the converted first information. In one embodiment, the processor (230) may perform encoding on the first information using a designated encoding algorithm (e.g., Auto Encoder or Bag of Tokens), but is not limited thereto, and it is to be understood that different encoding algorithms may be used. In one embodiment, the processor (230) may perform line-by-line encoding on the converted first information to obtain first information (or first encoded information) encoded on a line-by-line basis.

[0081] According to one embodiment, the processor (230) may determine whether the first information includes a confidential code based on the first encoding information and confidential code information obtained through the electronic device (200). The confidential code is a code (e.g., program code) that includes important information, and is distinguished from other codes by performing a designated operation (e.g., storing the code in a designated memory or identifying data including the code as a confidential code). The confidential code may include at least one code line including at least one unique identifier. In one embodiment, the confidential code information may be information including at least one encoded confidential code. For example, the confidential code information may include encoding information corresponding to each of at least one confidential code, a hash value corresponding to each of the encoding information, and connection information corresponding to the encoding information. In one embodiment, the connection information may be information regarding the connection between each code line of the confidential code. The connection information will be described later. In one embodiment, the confidential code may be a single source code, and at least one confidential code may be stored independently.

[0082] In one embodiment, the confidential code information may include information corresponding to each of at least one confidential code. In one embodiment, the confidential code information may include information (e.g., encoding information) generated on a line-by-line basis corresponding to each confidential code. For example, if the first confidential code among the at least one confidential code includes multiple code lines, the confidential code information may include encoding information generated for each line of the first confidential code. This will be described later.

[0083] In one embodiment, the encoding information may be, but is not limited to, an algorithm used to encode the first information (e.g., Auto Encoder or Bag of Tokens). In one embodiment, the hash value corresponding to each piece of encoding information may be a value calculated based on a designated algorithm. The designated algorithm may be, but is not limited to, a locality sensitive hashing (LSH) algorithm or a similar algorithm.

[0084] In one embodiment, the confidential code information may be stored in the memory (220). In one embodiment, the processor (230) may verify the confidential code information stored in the memory (220). However, the present invention is not limited thereto, and in one embodiment, the confidential code information may be stored in an external device (e.g., the electronic device (104) or server (108) of FIG. 1). In one embodiment, the processor (230) may also receive the confidential code information from the external device through a communication module (e.g., the communication module (190) of FIG. 1).

[0085] In one embodiment, the processor (230) may determine whether the first information includes a confidential code based on the first encoding information and the confidential code information. For example, the processor (230) may use the first encoding information to determine a hash value corresponding to the first information. Based on the confidential code information, if there is a hash value among the hash values ​​corresponding to at least one confidential code that has a similarity greater than a specified value with the hash value corresponding to the first information, the processor (230) may determine that the first information includes a confidential code. A specific method for determining whether the first information includes a confidential code will be described later.

[0086] FIG. 3 is a flowchart illustrating an operating method of an electronic device according to one embodiment.

[0087] In the following examples, the operations may be performed sequentially, but are not necessarily sequential. For example, the order of the operations may be changed, and at least two operations may be performed in parallel. Depending on the implementation, certain operations may be omitted.

[0088] According to FIG. 3, in one embodiment, at operation 301, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) may receive first information (e.g., the first information of FIG. 2) including a plurality of lines. In one embodiment, the electronic device may obtain the first information including the plurality of lines from an external device (e.g., the electronic device (104) or the server (108) of FIG. 1) via a communication module (e.g., the communication module (210) of FIG. 2). Alternatively, in one embodiment, the first information may be obtained based on a user input received via an input module (e.g., the input module (150) of FIG. 1).

[0089] According to one embodiment, in operation 303, the electronic device may generate converted first information by replacing at least one unique identifier included in the first information with a setting value corresponding to at least one unique identifier. In one embodiment, the electronic device may convert the first information acquired through the communication module based on identification information (e.g., identification information of FIG. 2) corresponding to the setting value corresponding to at least one unique identifier.

[0090] In one embodiment, the electronic device may convert the first information based on the identification information. For example, the electronic device may parse the code included in the first information line by line. The electronic device may check the token included in the code of the first line among the parsed codes, and if there is a token corresponding to the unique identifier among the checked tokens, the electronic device may convert the token corresponding to the unique identifier into a hash value corresponding to the unique identifier based on the identification information. Alternatively, for example, if there is a token included in the code of the first line that does not correspond to the unique identifier, the electronic device may convert the non-corresponding token into a designated hash value. A specific method of converting the first information will be described in detail with reference to FIGS. 8A and 8B .

[0091] In one embodiment, at operation 305, the electronic device may perform line-by-line encoding of the converted first information. In one embodiment, the electronic device may encode the converted first information for each line.

[0092] In one embodiment, the electronic device may perform encoding on the first information using a designated encoding algorithm (e.g., Auto Encoder or Bag of Tokens), but is not limited thereto, and of course, different encoding algorithms may be used. In one embodiment, the electronic device may perform line-by-line encoding on the converted first information, thereby obtaining the first information encoded on a line-by-line basis (e.g., the first encoded information of FIG. 2 ).

[0093] According to one embodiment, the electronic device may, in operation 307, determine whether the first information includes a confidential code based on encoded first information (or first encoded information) and confidential code information obtained through the electronic device (e.g., confidential code information of FIG. 2).

[0094] In one embodiment, the confidential code information may be stored in a memory (e.g., memory (220) of FIG. 2). The electronic device may obtain the confidential code information stored in the memory. Alternatively, the confidential code information may be stored in an external device (e.g., electronic device (104) or server (108) of FIG. 1). In one embodiment, the electronic device may also receive the confidential code information from the external device via a communication module (e.g., communication module (190) of FIG. 1). In one embodiment, the electronic device may compare the confidential code information generated for each line based on at least one confidential code with encoded first information to determine whether the first information includes a confidential code.

[0095] In one embodiment, the electronic device may determine whether the first information includes a confidential code based on the first encoding information and the confidential code information. For example, the electronic device may determine a hash value corresponding to the first information using the first encoding information and a designated algorithm (e.g., an LSH algorithm). The electronic device may determine whether, among the hash values ​​corresponding to at least one confidential code, a hash value having a similarity greater than or equal to a designated value with the hash value corresponding to the first information exists based on the confidential code information. If a hash value having a similarity greater than or equal to the designated value exists, the electronic device may determine that the first information includes a confidential code. A specific method for determining whether the first information includes a confidential code will be described later.

[0096] FIG. 4a is a flowchart illustrating a method for checking whether first information (e.g., first information of FIG. 2) includes a confidential code according to one embodiment. FIG. 4b is a diagram illustrating a method for checking whether first information includes a confidential code according to one embodiment.

[0097] According to FIGS. 4A and 4B , in one embodiment, at operation 401, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) can verify at least one first hash value corresponding to encoded first information (e.g., the first encoded information of FIG. 2) using a specified algorithm.

[0098] In one embodiment, the electronic device may verify at least one first hash value corresponding to the first encoding information using a locality sensitive hashing (LSH) algorithm. In one embodiment, the electronic device may verify at least one first hash value corresponding to the first encoding information using a sliding window algorithm.

[0099] For example, as illustrated in FIG. 4B, assume that the first information (410) is a code having multiple lines. The electronic device can use a designated algorithm (e.g., Auto Encoder or Bag of Tokens) to identify first encoding information (420) corresponding to each of the multiple lines. In one embodiment, the first encoding information (420) may include encoding information corresponding to each of the multiple lines. For example, if the first information is a code consisting of four lines, the first encoding information (420) may include encoding information corresponding to each of the four lines.

[0100] In one embodiment, the electronic device may use a sliding window algorithm to identify at least one first hash value (430) corresponding to a first window size. In one embodiment, when the first window size is 2, the electronic device may identify the first hash value (430) for a plurality of adjacent encoding information pieces (e.g., encoding information corresponding to the first line and encoding information corresponding to a line following the first line) among encoding information pieces corresponding to each of a plurality of lines.

[0101] The electronic device can verify the first hash value for the encoding information corresponding to two adjacent lines among four lines, and in this case, three first hash values ​​(430) can be verified. However, this is not limited thereto, and if the first window size is 3, it is of course possible to verify the first hash values ​​(430) for multiple lines (e.g., three) rather than two adjacent lines.

[0102] According to one embodiment, the electronic device may, in operation 403, verify whether there is a second hash value corresponding to at least one first hash value that has been verified among hash values ​​corresponding to encoding information corresponding to the confidential code. In one embodiment, the confidential code information (e.g., the confidential code of FIG. 2) may include encoding information corresponding to each of at least one confidential code, a hash value corresponding to each of the encoding information, and connection information corresponding to the encoding information.

[0103] In one embodiment, the electronic device may compare at least one verified first hash value with a plurality of hash values ​​included in the confidential code information. The electronic device may determine whether, among the plurality of hash values ​​included in the confidential code information, a second hash value exists that has a similarity (e.g., the second similarity in FIG. 7) greater than or equal to a specified value with the at least one verified first hash value. This will be described in detail with reference to FIG. 7.

[0104] In one embodiment, the first hash value corresponding to the first information and the plurality of hash values ​​included in the confidential code information may be values ​​calculated based on the same algorithm (e.g., the LSH algorithm). Since the LSH algorithm is a hash generation algorithm that places elements with high similarity (e.g., Jaccard Similarity) into the same bucket, the electronic device can identify a second hash value among the plurality of hash values ​​included in the confidential code information that has a similarity greater than a specified value with the first hash value.

[0105] According to the above example, the electronic device can determine whether the first information includes a confidential code by comparing only a part of at least one first hash value with the confidential code information, thereby reducing the verification time.

[0106] FIG. 5 is a flowchart illustrating a method for checking whether first information (e.g., first information of FIG. 2) includes a confidential code according to one embodiment.

[0107] According to FIG. 5, in one embodiment, at operation 501, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) may verify at least one piece of encoding information (or second encoding information) associated with a second hash value based on determining that a second hash value (e.g., the second hash value of FIGS. 4A and 4B) exists.

[0108] In one embodiment, the second encoding information is encoding information connected to encoding information mapped to the second hash value. In one embodiment, the encoding information included in the confidential code information (e.g., the confidential code information of FIG. 2) may have a data structure of a graph type. The encoding information connected to the encoding information mapped to the second hash value may include encoding information having a direct connection with the encoding information mapped to the second hash value within the confidential code information, and encoding information having a connection with the encoding information having the direct connection.

[0109] In one embodiment, the electronic device can verify second encoding information based on confidential code information. In one embodiment, the electronic device can verify second encoding information linked to encoding information mapped to a second hash value among the encoding information included in the confidential code information based on the first information.

[0110] According to one embodiment, in operation 503, the electronic device can verify a first similarity between the verified at least one piece of encoding information and the first encoding information (e.g., the first encoding information of FIG. 2). In one embodiment, the electronic device can verify the first similarity by comparing each piece of information (or encoding value) included in the second encoding information with each piece of information (or encoding value) included in the first encoding information, line by line.

[0111] In one embodiment, the electronic device can determine the first similarity using a specified algorithm. For example, the electronic device can determine the similarity between the hash value corresponding to the first line of the first encoded information and the hash value corresponding to the first line of the second encoded information as the first similarity. This will be described in detail with reference to FIG. 6.

[0112] In one embodiment, at operation 505, the electronic device may determine that the first information includes a confidential code based on determining that the first similarity is greater than or equal to a first value. In one embodiment, the first value may be 0.7, but is not limited thereto, and of course, the first value may be a value greater than or equal to 0.7.

[0113] FIG. 6 is a flowchart illustrating a method for confirming a first similarity (e.g., the first similarity of FIG. 5) according to one embodiment.

[0114] According to FIG. 6, in operation 601, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) can check encoding information of a size (or length) corresponding to first information (e.g., the first information of FIG. 2) among at least one encoding information (e.g., the second encoding information of FIG. 5) related to a second hash value (e.g., the second hash value of FIGS. 4A and 4B).

[0115] In one embodiment, the second encoding information (e.g., the second encoding information of FIG. 5) may be encoding information linked to encoding information mapped to the second hash value, and may be encoding information having a length (or number of lines) corresponding to the first information. For example, if the first information includes encoding information corresponding to four lines, the second encoding information may be identified as encoding information corresponding to four lines, including encoding information mapped to the second hash value and three pieces of encoding information linked thereto. Accordingly, the length corresponding to the first information and the length of the second encoding information may be the same.

[0116] In one embodiment, the electronic device can verify second encoding information based on confidential code information (e.g., confidential code information of FIG. 2). In one embodiment, the electronic device can verify second encoding information linked to encoding information mapped to a second hash value among encoding information included in the confidential code information based on the first information.

[0117] According to one embodiment, in operation 603, the electronic device can compare the second encoding information of a size corresponding to the first information with the encoded first information on a line-by-line basis to determine the first similarity. In one embodiment, the electronic device can compare each piece of information (or encoding value) included in the second encoding information with each piece of information (or encoding value) included in the first encoding information (e.g., the first encoding information of FIG. 2) on a line-by-line basis to determine the first similarity.

[0118] In one embodiment, the electronic device may determine the first similarity using a specified algorithm. For example, the electronic device may determine the similarity between the hash value corresponding to the first line of the first encoded information and the hash value corresponding to the first line of the second encoded information as the first similarity.

[0119] For example, the electronic device may perform encoding on each of the first encoding information and the second encoding information, thereby obtaining each piece of encoding information with a reduced data size. The electronic device may determine the similarity between the first encoding information with a reduced data size and the second encoding information with a reduced data size as the first similarity.

[0120] For example, the electronic device may compare the encoding information corresponding to the first line of the first encoding information with the encoding information corresponding to the first line of the second encoding information, determine the similarity corresponding to each of the plurality of lines, and determine the average value of the determined similarities as the first similarity. However, the present invention is not limited thereto, and in one embodiment, the electronic device may determine the first similarity using a similarity acquisition algorithm such as Bag of Encoding.

[0121] In one embodiment, if the length of the second encoding information is less than the length corresponding to the first information, the length corresponding to the first information and the length of the second encoding information may of course be different. In this case, only the first encoding information corresponding to the length of the second encoding information may be compared.

[0122] FIG. 7 is a flowchart illustrating a method for verifying a second hash value (e.g., the second hash value of FIGS. 4A and 4B) according to one embodiment.

[0123] According to FIG. 7, in one embodiment, in operation 701, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) can verify at least one first hash value (e.g., the first hash value of FIGS. 4A and 4B) corresponding to first encoding information (e.g., the first encoding information of FIG. 2) using a locality sensitive hashing (LSH) algorithm.

[0124] In one embodiment, as illustrated in FIG. 4B, it is assumed that the first information (410) is a code having a plurality of lines. In the case where the first window size is 2, the electronic device can use the LSH algorithm to check the first hash value (430) for a plurality of adjacent encoding information pieces (e.g., encoding information corresponding to the first line and encoding information corresponding to a line following the first line) among the encoding information pieces corresponding to each of the plurality of lines. In one embodiment, in the case where the first window size is 3, it is of course possible to check the first hash value (430) for a plurality of lines (e.g., 3) rather than two adjacent lines using the LSH algorithm.

[0125] According to one embodiment, in operation 703, the electronic device can identify, as a second hash value, a hash value having a second similarity greater than or equal to a second value with respect to at least one of the identified first hash values, among the hash values ​​corresponding to each of the at least one confidential code (e.g., the confidential code of FIG. 2).

[0126] In one embodiment, the electronic device may compare at least one verified first hash value with a plurality of hash values ​​included in the confidential code information. The electronic device may determine whether, among the plurality of hash values ​​included in the confidential code information, a second hash value exists that has a second similarity greater than or equal to a specified second value with the at least one verified first hash value.

[0127] In one embodiment, the electronic device may verify whether a second hash value corresponding to at least some of at least one first hash value exists. For example, if there are five first hash values ​​corresponding to the first information, the electronic device may verify whether a second hash value corresponding to a hash value that exists in a relatively higher order among the five first hash values ​​exists. For example, if there is no second hash value corresponding to a hash value that exists in a relatively higher order (e.g., the first hash value), the electronic device may verify whether there is a second hash value corresponding to the second hash value. For example, if there is no second hash value corresponding to each of the five first hash values, the electronic device may verify that the first information does not include a confidential code.

[0128] For example, the electronic device may compare a first hash value corresponding to a unique identifier among at least one first hash value with a plurality of hash values ​​included in the confidential code information. For example, if there is no hash value having a second similarity greater than or equal to the second value with respect to the first hash value corresponding to the unique identifier, the electronic device may determine whether there is a second hash value having a second similarity greater than or equal to the second value with respect to a hash value in the next order of the first hash value corresponding to the unique identifier among the at least one first hash value.

[0129] According to the above example, the electronic device can determine whether the first information includes a confidential code by comparing only a part of at least one first hash value with the confidential code information, thereby reducing the verification time.

[0130] FIG. 8A is a flowchart illustrating a method for converting first information (e.g., first information of FIG. 2) according to one embodiment. FIG. 8B is a diagram illustrating a method for converting first information according to one embodiment.

[0131] According to FIG. 8A, in one embodiment, in operation 801, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) can parse the first information line by line to confirm at least one first sub-information.

[0132] In one embodiment, referring to FIG. 8B, the first information (810) may include information (or code) of multiple lines. The electronic device may parse the first information (810) into first sub-information of multiple lines including sub-information (811) corresponding to the first line.

[0133] According to one embodiment, in operation 803, the electronic device may convert a token included in at least one first sub-information based on identification information (830, e.g., identification information of FIG. 2) corresponding to a set value corresponding to at least one unique identifier.

[0134] In one embodiment, the identification information (830) may be information including at least one unique identifier and a value (e.g., a hash value) corresponding to each of the at least one unique identifier. In one embodiment, the identification information (830) may be stored in a memory (e.g., memory (220) of FIG. 2). In one embodiment, the electronic device may verify the identification information (830) stored in the memory. However, the present invention is not limited thereto, and in one embodiment, the identification information (830) may be stored in an external device (e.g., electronic device (104) or server (108) of FIG. 1). In one embodiment, the electronic device may also verify the identification information (830) from an external device through a communication module (e.g., communication module (210) of FIG. 2).

[0135] In one embodiment, each of the first sub-information of the plurality of lines including the sub-information (811) corresponding to the first line may include at least one token. In one embodiment, the electronic device may convert a token corresponding to the first unique identifier among the tokens included in the at least one first sub-information into a token corresponding to the first unique identifier based on the identification information (830). For example, the electronic device may identify 'Samsung_Int' as the unique identifier among the tokens included in the sub-information (811) corresponding to the first line based on the identification information (830). The electronic device may convert the identified 'Samsung_Int' into a corresponding token '0xA129'.

[0136] In one embodiment, the electronic device can convert a token that does not correspond to a unique identifier. For example, if there is a token called 'add function' that does not correspond to a unique identifier among the tokens included in the sub-information (811) corresponding to the first line, the electronic device can convert it into a general token such as 'FUNC'. Information about the general token may be stored in a memory (e.g., memory (220) of FIG. 2). Alternatively, the electronic device may obtain information about the general token from an external device (e.g., electronic device (104) of FIG. 1 or server (108)) via a communication module (e.g., communication module (210) of FIG. 2).

[0137] In one embodiment, the electronic device can verify first information (or, the converted first information of FIG. 2) including a converted token. For example, the electronic device can verify the converted sub-information (821) corresponding to the first line by converting the token included in the sub-information (811) corresponding to the first line.

[0138] FIG. 9 is a drawing for explaining confidential code information according to one embodiment.

[0139] Referring to FIG. 9, according to one embodiment, confidential code information (950, for example, the confidential code information of FIG. 2) may be information including a plurality of encoded confidential codes. For example, the confidential code information (950) may include encoding information (910) corresponding to at least one confidential code, a hash value (920) corresponding to the encoding information (910), and connection information corresponding to the encoding information. In one embodiment, the hash value (920) may be a value calculated based on encoding information of a plurality of lines (for example, two) among the encoding information (910). Accordingly, the number of lines included in the encoding information (910) and the number of hash values ​​(920) may be different.

[0140] In one embodiment, the connection information may be information regarding the connectivity between encoding information corresponding to each line of code included in the confidential code. The connection information is described in detail with reference to FIG. 10b.

[0141] In one embodiment, only at least a portion (930) of the hash value (920) may be included in the confidential code information (950). For example, the electronic device may extract only at least a portion (e.g., a specified byte size) of the value corresponding to each hash value for each code line and store the extracted value in the confidential code information (950).

[0142] In one embodiment, the confidential code information (950) may include encoding information for each line (or code line) within the confidential code, and a hash value corresponding to each line of encoding information. In one embodiment, the confidential code information (950) may include connection information including information regarding the connectivity between the encoding information for each line within the confidential code.

[0143] FIG. 10A and FIG. 10B are drawings for explaining confidential code information according to one embodiment.

[0144] According to FIG. 10a, according to one embodiment, the confidential code information (1040, for example, the confidential code information of FIG. 2) may be information including a plurality of encoded confidential codes.

[0145] In one embodiment, the confidential code information (1040) may include encoding information (1041) corresponding to a first confidential code (1010), encoding information (1042) corresponding to a second confidential code (1020), and encoding information (1043) corresponding to a third confidential code (1030).

[0146] In one embodiment, the confidential code information (1040) may include connection information (e.g., connection information of FIG. 9) corresponding to a plurality of lines of code included in the confidential code. For example, the confidential code information (1040) may include encoding information (1042) corresponding to a second confidential code (1020), and the confidential code information (1040) may include connection information corresponding to a plurality of lines of code included in the second confidential code (1020).

[0147] In one embodiment, each of the encoding information (1050, 1060, and 1170) illustrated in FIG. 10b is a diagram illustrating information for each code line included in the confidential code. For example, information corresponding to 'N0' may include encoding information, a hash value, and connection information corresponding to the first line of the confidential code. Meanwhile, 'N0', 'N1', and 'N2' may be index values ​​corresponding to each code line of the confidential code according to one embodiment.

[0148] According to FIG. 10b, according to one embodiment, encoding information included in confidential code information (e.g., confidential code information of FIG. 2) may be a designated data structure type (e.g., a linked list or an array). For example, assume that the confidential code included in the confidential code information includes a plurality of encoding information (1050, 1060, and 1070). Each of the plurality of encoding information (1050, 1060, and 1070) may correspond to a line of the confidential code. The encoding information (1050) corresponding to 'N0' may be connected to the encoding information (1060) corresponding to N1 and the encoding information (1070) corresponding to NB. The encoding information (1060) corresponding to N1 may be connected to the encoding information (1070) corresponding to NB. The confidential code information may include connection information (e.g., connection information of FIG. 9) that includes information on the connection relationship between multiple pieces of encoding information, as in the example described above.

[0149] Returning to FIG. 10A, in one embodiment, assume that an added code (1021) within a second confidential code (1020) is confirmed. In one embodiment, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) can confirm encoding information corresponding to the added code (1021) and update confidential code information (1040) based on the encoding information corresponding to the added code (1021). In one embodiment, the electronic device can confirm connection information (1044 and 1045) between the added code (1021) and the existing second confidential code (1020) and update confidential code information (1040) based on the confirmed connection information (1044 and 1045). A specific method for updating confidential code information will be described later.

[0150] FIG. 11a is a flowchart illustrating a method for updating confidential code information (e.g., the confidential code information of FIG. 2) according to one embodiment. FIG. 11b is a diagram illustrating a method for updating confidential code information according to one embodiment. FIG. 11c is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0151] Referring to FIGS. 11A and 11B , according to one embodiment, in operation 1101, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) may perform encoding on a first code (1111) based on the addition of the first code (1111) within the confidential code (1110).

[0152] In one embodiment, the electronic device may determine whether a first code (1111) is added within the confidential code (1110). In one embodiment, the electronic device may perform encoding on the first code (1111) using a specified algorithm. In one embodiment, the electronic device may update the encoding information (1120) such that encoding information (1121) corresponding to the added first code (1111) is added within the encoding information (1120) corresponding to the confidential code (1110). In one embodiment, the electronic device may update the encoding information (1120) based on the position of the first code (1111) within the confidential code (1110). For example, if the first code (1111) within the confidential code (1110) is added to the third line and the fourth line, the encoding information (1121) corresponding to the first code (1111) may also be added to the third line and the fourth line.

[0153] According to one embodiment, in operation 1103, the electronic device can verify the third hash values ​​(1131, 1132, and 1133) corresponding to the encoded first code (1111) and the first connection information, respectively, based on the first code (1111) and the confidential code corresponding to the code line adjacent to the first code (1111).

[0154] In one embodiment, the electronic device can use a sliding window algorithm to verify the third hash values ​​(1131, 1132, and 1133) corresponding to the first code (1111). For example, the electronic device can verify the hash value (1131) for one ('0100...') of the encoding information (1121) corresponding to the first code (1111) and the adjacent encoding information ('1010...'). For example, the electronic device can verify the hash value (1132) for one ('0100...') of the encoding information (1121) corresponding to the first code (1111) and the adjacent other ('1110...'). For example, the electronic device can check the hash value (1133) for the encoding information ('0010...') adjacent to another ('1110...') of the encoding information (1121) corresponding to the first code (1111). In one embodiment, the electronic device can calculate the hash value using the LSH algorithm.

[0155] In one embodiment, the electronic device may update the confidential code information such that the hash value (1130) corresponding to the confidential code (1110) includes third hash values ​​(1131, 1132, and 1133). In FIG. 11B, the hash value (1130) is illustrated to include an index value, but is not limited thereto, and the hash value (1130) may not include an index value corresponding to a code line. In one embodiment, the hash value (1130) may include all hash values ​​calculated based on the encoding information (1120), but is not limited thereto, and may include only at least a portion of the calculated hash values ​​(for example, a hash value of the first 6 digits).

[0156] In one embodiment, each of the encoding information (1140, 1150, 1160, 1170, 1180, and 1190) illustrated in FIG. 11c is a diagram of information for each code line included in the confidential code (1110). For example, information corresponding to 'N0' may include encoding information, a hash value, and connection information corresponding to the first line of the confidential code (1110).

[0157] In one embodiment, referring to FIG. 11C, the electronic device can identify first connection information corresponding to the added first code (1111). In one embodiment, the electronic device can generate information (1180 and 1190) corresponding to the added first code (1111). In one embodiment, the first connection information may be connection information included in each of the information (1180 and 1190) corresponding to the added first code (1111).

[0158] In one embodiment, the electronic device may generate first connection information based on the location of the added first code (1111) within the confidential code (1110). For example, information (1180) corresponding to the third code line may have connectivity with information (1150) corresponding to the second code line. In this case, connectivity between information (1160) corresponding to the third code line before the first code (1111) is added and information (1150) corresponding to the second code line may be maintained. The electronic device may update confidential code information by adding information on connectivity for the added first code (1111) while maintaining information on connectivity for each code line of the existing confidential code (1110).

[0159] In one embodiment, in operation 1105, the electronic device may update confidential code information based on the encoded first code (1121), the third hash values ​​(1131, 1132, and 1133), and the first connection information. In one embodiment, the electronic device may update the encoding information (1120) such that the encoded first code (1121) is included in the encoding information (1120) corresponding to the confidential code. In one embodiment, the electronic device may update the confidential code information such that the third hash values ​​(1131, 1132, and 1133) are included in the hash value (1130) corresponding to the confidential code.

[0160] FIG. 12a is a flowchart illustrating a method for updating confidential code information (e.g., the confidential code information of FIG. 2 ) according to one embodiment. FIG. 12b is a diagram illustrating a method for updating confidential code information according to one embodiment. FIG. 12c is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0161] According to one embodiment, referring to FIGS. 12A and 12B, in operation 1201, an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) may verify a fourth hash value (1231) and second connection information corresponding to at least one code line adjacent to the second code (1211) based on the deletion of the second code (1211) among the confidential codes (1210).

[0162] In one embodiment, the electronic device can determine whether the second code (1211) is deleted within the confidential code (1210). In one embodiment, the electronic device can update the encoding information (1220) such that the encoding information (1221) corresponding to the deleted second code (1211) is deleted within the encoding information (1220) corresponding to the confidential code (1210).

[0163] In one embodiment, the electronic device may verify the fourth hash value (1231) based on encoding information corresponding to at least one code line adjacent to the second code (1211). For example, if the code of the fourth line in the second code (1211) is deleted, the electronic device may verify encoding information corresponding to the second code (1211) and the codes of the adjacent lines (the code of the third line and the code of the fifth line). The electronic device may generate the fourth hash value (1231) for the second code (1211) and the codes of the adjacent lines using a designated algorithm (e.g., the LSH algorithm).

[0164] In one embodiment, although FIG. 12B illustrates that the hash value (1230) includes an index value, it is not limited thereto, and of course, the hash value (1230) may not include an index value corresponding to a code line. In one embodiment, the hash value (1230) may include all hash values ​​calculated based on the encoding information (1220), but is not limited thereto, and of course, it may include only at least a portion of the calculated hash values ​​(for example, the first 6 digits of the hash value).

[0165] In one embodiment, each of the encoding information (1240, 1250, 1260, 1270, 1280, and 1290) illustrated in FIG. 12c is a diagram of information for each code line included in the confidential code (1210). For example, information corresponding to 'N0' may include encoding information, a hash value, and connection information corresponding to the first line of the confidential code (1210).

[0166] In one embodiment, referring to FIG. 12c, the electronic device can identify second connection information corresponding to the deleted second code (1211). In one embodiment, the electronic device can generate second connection information corresponding to the connectivity between the second code (1211) and the codes of adjacent lines (the codes of the third line and the codes of the fifth line).

[0167] In one embodiment, information regarding connectivity prior to the deletion of the second code (1211) may not be deleted. For example, connectivity between information (1280) corresponding to the third code line and information (1290) corresponding to the fourth code line may be maintained. The electronic device may update confidential code information by adding second connection information corresponding to the deleted second code (1211) while maintaining information regarding connectivity per code line of the existing confidential code (1210).

[0168] In one embodiment, the electronic device may update the confidential code information based on each of the fourth hash value (1231) and the second connection information in operation 1203. In one embodiment, the electronic device may update the encoding information (1220) corresponding to the confidential code such that the encoded second code (1221) is deleted from the encoding information (1220). In one embodiment, the electronic device may update the confidential code information such that the fourth hash value (1231) is included in the hash value (1230) corresponding to the confidential code. In one embodiment, the electronic device may update the confidential code information such that the second connection information is included in the confidential code information.

[0169] FIG. 13a is a diagram illustrating a method for updating confidential code information (e.g., confidential code information of FIG. 2) according to one embodiment. FIG. 13b is a diagram illustrating a method for updating confidential code information according to one embodiment.

[0170] According to one embodiment, referring to FIGS. 13A and 13B , an electronic device (e.g., the electronic device (200) of FIG. 2 (e.g., the processor (230))) may, based on a change in a third code (1311) of a confidential code (1310), verify a fifth hash value (1331 and 1332) and third connection information corresponding to the changed third code (1311) and at least one code line adjacent to the third code (1311), respectively.

[0171] In one embodiment, the electronic device can determine whether the third code (1311) within the confidential code (1310) has changed. In one embodiment, the electronic device can update the encoding information (1320) so that the encoding information (1321) corresponding to the changed third code (1311) has changed.

[0172] In one embodiment, the electronic device may verify the fifth hash values ​​(1331 and 1332) based on encoding information corresponding to at least one code line adjacent to the changed third code (1311). For example, if the code of the third line in the third code (1311) has been changed, the electronic device may verify encoding information corresponding to the third code (1311) and the codes of the adjacent lines (the code of the second line and the code of the fourth line). The electronic device may generate the fifth hash values ​​(1331 and 1332) for the third code (1311) and the codes of the adjacent lines, respectively, using a designated algorithm (e.g., the LSH algorithm). In one embodiment, the hash value (1330) may include, but is not limited to, all of the hash values ​​calculated based on the encoding information (1320), and may of course include only at least some of the calculated hash values ​​(e.g., the first six digits of the hash value).

[0173] As an example, let's assume that the code of the third line of FIG. 12B is changed to the code of the third line of FIG. 13A. Since the code of the third line of FIG. 12B has a high similarity to the code of the third line of FIG. 13A, a hash value (1332) identical to some of the hash values ​​included in the existing confidential code information may be generated. In this case, only the index value ('N6') corresponding to the hash value may be added. The electronic device can verify the third connection information based on this. However, the present invention is not limited thereto, and it is of course possible to generate a hash value (1331) different from the hash value included in the existing confidential code information.

[0174] In one embodiment, each of the encoding information (1340, 1350, 1360, 1370, 1380, and 1390) illustrated in FIG. 13B is a diagram of information per code line included in the confidential code (1310). For example, information corresponding to 'N0' may include encoding information, a hash value, and connection information corresponding to the first line of the confidential code (1310). In one embodiment, information per code line included in the confidential code (1310) may include information on a previously deleted code line ('N5'). Accordingly, the number of information per code line included in the confidential code (1310) and the number of lines of the updated confidential code (1310) may, of course, be different.

[0175] In one embodiment, the electronic device can check third connection information corresponding to the changed third code (1311). In one embodiment, the electronic device can generate third connection information corresponding to the connectivity between the third code (1311) and the codes of adjacent lines (the codes of the second line and the codes of the fourth line). For example, the electronic device can generate information corresponding to the connectivity between the third code (1311) and the code of the second line, and generate information corresponding to the connectivity between the third code (1311) and the code of the fourth line, thereby generating the third connection information. In one embodiment, the electronic device can update the confidential code information by adding the third connection information corresponding to the changed third code (1311) while maintaining information on the connectivity of each code line of the existing confidential code.

[0176] In one embodiment, the electronic device may update the confidential code information based on each of the fifth hash values ​​(1331 and 1332) and the third connection information. In one embodiment, the electronic device may update the encoding information (1320) corresponding to the confidential code so that the encoded third code (1321) is changed. In one embodiment, the electronic device may update the confidential code information so that the fifth hash values ​​(1331 and 1332) are included in the hash value (1330) corresponding to the confidential code. In one embodiment, the electronic device may update the confidential code information so that the third connection information is included in the confidential code information.

[0177] Returning to FIG. 2, an electronic device according to one embodiment (e.g., electronic device (101), 200 of FIG. 1) may be implemented as a user terminal (e.g., a desktop).

[0178] According to one embodiment, the electronic device (200) may include an input module (e.g., input module (150) of FIG. 1) and / or a processor (e.g., processor (120) of FIG. 1).

[0179] In one embodiment, the processor may obtain first information via an input module. In one embodiment, the processor may obtain user input for retrieving first information (e.g., source code) stored in a memory (e.g., memory (220) of FIG. 2) via the input module. In one embodiment, the processor may obtain the first information via a keyboard. Alternatively, the processor may obtain user input for receiving first information stored in an external device (e.g., server (108) of FIG. 1) via the input module.

[0180] According to one embodiment, the processor may convert first information acquired through the input module based on identification information corresponding to a set value corresponding to at least one unique identifier. In one embodiment, the identification information may be stored in a memory. In one embodiment, the processor may check the identification information stored in the memory. However, the present invention is not limited thereto, and in one embodiment, the identification information may be stored in an external device (e.g., the electronic device (104) or the server (108) of FIG. 1). In one embodiment, the processor (230) may also receive identification information from an external device through a communication module (e.g., the communication module (190) of FIG. 1).

[0181] In one embodiment, the processor may perform line-by-line encoding of the converted first information. In one embodiment, the processor may perform encoding of the first information using a designated algorithm (e.g., an LSH algorithm or a sliding window algorithm).

[0182] In one embodiment, the processor may obtain confidential code information from an external device. In one embodiment, the processor may obtain confidential code information from the external device via a communication module (e.g., the communication module (190) of FIG. 1 ). However, this is not a limitation, and even if the electronic device is implemented as a user terminal, the confidential code information may be stored in memory.

[0183] According to one embodiment, the processor can determine whether the first information includes a confidential code based on the encoded first information and confidential code information obtained from an external device.

[0184] In one embodiment, if the processor determines that the first information includes a confidential code, it may provide corresponding alarm information. In one embodiment, the electronic device may further include a display module (e.g., display module (160) of FIG. 1 ). The processor may verify notification information indicating that the first information includes a confidential code and display the verified notification information via the display module. However, the present invention is not limited thereto.

[0185] An electronic device according to one embodiment of the present disclosure may include a memory storing a setting value corresponding to at least one unique identifier, a communication module, and a processor. The processor may receive first information including a plurality of lines through the communication module.

[0186] The processor can generate converted first information by replacing at least one unique identifier included in the first information with the setting value based on the setting value stored in the memory.

[0187] The above processor can encode the converted first information in units of each line.

[0188] The processor can determine whether the first information includes a confidential code based on confidential code information generated for each line unit based on at least one confidential code and the encoded first information.

[0189] According to one embodiment, the confidential code information may include encoding information corresponding to each of at least one confidential code, and a hash value corresponding to the encoding information.

[0190] According to one embodiment, the processor can verify at least one first hash value corresponding to the encoded first information using a specified algorithm.

[0191] According to one embodiment, the processor can verify whether, among the hash values ​​corresponding to the encoding information, there is a second hash value corresponding to at least one of the verified first hash values.

[0192] In one embodiment, the processor may verify at least one piece of encoding information associated with the second hash value based on determining that the second hash value exists.

[0193] According to one embodiment, the processor can determine a first similarity between the at least one identified encoding information and the encoded first information.

[0194] In one embodiment, the processor may determine that the first information includes a confidential code based on determining that the first similarity is greater than or equal to a first value.

[0195] In one embodiment, the first information comprises program code comprising a plurality of lines of code, and the at least one confidential code may comprise a plurality of lines of code comprising the at least one unique identifier.

[0196] According to one embodiment, the processor can identify encoding information having a size corresponding to the first information among at least one piece of encoding information related to the second hash value.

[0197] According to one embodiment, the processor can compare the encoded first information with the encoded information of a size corresponding to the first information on a line-by-line basis to determine the first similarity.

[0198] According to one embodiment, the processor may verify at least one first hash value corresponding to a first window size using a sliding window algorithm.

[0199] According to one embodiment, the processor may verify the at least one first hash value using a locality-sensitive hashing (LSH) algorithm.

[0200] Among the hash values ​​corresponding to each of the at least one confidential code, a hash value having a second similarity with the at least one confirmed first hash value greater than or equal to a second value can be identified as the second hash value.

[0201] In one embodiment, the first information may include program code comprising a plurality of lines of code.

[0202] According to one embodiment, the processor can parse the first information line by line to identify at least one first sub-information.

[0203] According to one embodiment, the processor may convert a token included in the at least one first sub-information based on identification information corresponding to a set value corresponding to the plurality of unique identifiers.

[0204] According to one embodiment, the processor may convert a token corresponding to a first unique identifier among tokens included in the at least one first sub-information into a token corresponding to the first unique identifier, based on a setting value corresponding to the at least one unique identifier.

[0205] According to one embodiment, the confidential code information may further include connection information mapped to the encoding information.

[0206] In one embodiment, the processor may perform encoding on the first code based on the addition of the first code within the confidential code.

[0207] According to one embodiment, the processor can verify the third hash value and the first connection information corresponding to the encoded first code, respectively, based on the first code and the confidential code corresponding to the code line adjacent to the first code.

[0208] According to one embodiment, the processor may update the confidential code information based on the encoded first code, the third hash value, and the first connection information.

[0209] According to one embodiment, the confidential code information may further include connection information mapped to the encoding information.

[0210] According to one embodiment, the processor can verify a fourth hash value and second connection information corresponding to at least one code line adjacent to the second code, based on the deletion of the second code among the confidential codes.

[0211] In one embodiment, the processor may update the confidential code information based on each of the fourth hash value and the second connection information.

[0212] The method of operating an electronic device according to one embodiment of the present disclosure may include an operation of receiving first information including a plurality of lines.

[0213] According to one embodiment, the method of operation may include generating converted first information by replacing at least one unique identifier included in the first information with a setting value corresponding to at least one unique identifier.

[0214] According to one embodiment, the operating method may include an operation of encoding the converted first information for each line.

[0215] According to one embodiment, the method may include an operation of checking whether the first information includes a confidential code based on confidential code information generated for each line unit based on at least one confidential code and the encoded first information.

[0216] The above confidential code information may include encoding information corresponding to the at least one confidential code, and a hash value corresponding to the encoding information.

[0217] According to one embodiment, the operation of checking whether the first information includes a confidential code may include an operation of checking at least one first hash value corresponding to the encoded first information using a specified algorithm.

[0218] According to one embodiment, the operation of checking whether the first information includes a confidential code may include an operation of checking whether, among the hash values ​​corresponding to the encoding information, a second hash value corresponding to at least one of the confirmed first hash values ​​exists.

[0219] In one embodiment, the operation of determining whether the first information includes a confidential code may include determining at least one piece of encoding information related to the second hash value based on determining that the second hash value exists.

[0220] According to one embodiment, the operation of checking whether the first information includes a confidential code may include an operation of checking a first similarity between the at least one confirmed encoded information and the encoded first information.

[0221] According to one embodiment, the operation of determining whether the first information includes a confidential code may include an operation of determining that the first information includes a confidential code based on determining that the first similarity is greater than or equal to a first value.

[0222] In one embodiment, the first information comprises program code comprising a plurality of lines of code, and the at least one confidential code may comprise a plurality of lines of code comprising the at least one unique identifier.

[0223] According to one embodiment, the method of operation may include an operation of checking encoding information having a size corresponding to the first information among at least one encoding information related to the second hash value.

[0224] According to one embodiment, the operation of checking the first similarity may include an operation of checking the first similarity by comparing, line by line, encoding information of a size corresponding to the first information and the encoded first information.

[0225] In one embodiment, the operation of verifying the at least one first hash value may include verifying the at least one first hash value corresponding to a first window size using a sliding window algorithm.

[0226] According to one embodiment, the operation of verifying the at least one first hash value may verify the at least one first hash value using a locality-sensitive hashing (LSH) algorithm.

[0227] According to one embodiment, the operation of checking whether the second hash value exists may include an operation of checking, as the second hash value, a hash value having a second similarity greater than or equal to a second value with the at least one confirmed first hash value among the hash values ​​corresponding to each of the at least one confidential codes.

[0228] In one embodiment, the first information may include program code comprising a plurality of lines of code.

[0229] According to one embodiment, the operation of generating the converted first information may include an operation of parsing the first information line by line to confirm at least one first sub-information.

[0230] According to one embodiment, the operation of generating the converted first information may include an operation of converting a token included in the at least one first sub-information based on identification information corresponding to a set value corresponding to the plurality of unique identifiers.

[0231] According to one embodiment, the operation of generating the converted first information may include an operation of converting a token corresponding to a first unique identifier among tokens included in the at least one first sub-information into a token corresponding to the first unique identifier, based on a setting value corresponding to the at least one unique identifier.

[0232] According to one embodiment, the confidential code information may further include connection information mapped to the encoding information.

[0233] According to one embodiment, the method may include performing encoding on the first code based on the addition of the first code within the confidential code.

[0234] According to one embodiment, the method of operation may include an operation of verifying a third hash value and first connection information corresponding to the encoded first code, respectively, based on the first code and a confidential code corresponding to a code line adjacent to the first code.

[0235] According to one embodiment, the method of operation may include updating the confidential code information based on the encoded first code, the third hash value, and the first connection information.

[0236] According to one embodiment, the operating method may include an operation of checking whether the first information includes a confidential code based on the encoded first information and confidential code information obtained through the electronic device.

[0237] An electronic device according to one embodiment of the present disclosure may include a memory, an input module, and a processor that stores a setting value corresponding to at least one unique identifier.

[0238] According to one embodiment, the processor may obtain first information including a plurality of lines through the input module.

[0239] According to one embodiment, the processor may generate converted first information by replacing the at least one unique identifier included in the first information with the setting value based on the setting value stored in the memory.

[0240] According to one embodiment, the processor may encode the converted first information in units of each line.

[0241] According to one embodiment, the processor can determine whether the first information includes a confidential code based on confidential code information generated for each line based on at least one confidential code and the encoded first information.

[0242] In a storage medium storing computer-readable instructions according to one embodiment of the present disclosure, the instructions, when executed by a processor of an electronic device, can cause the electronic device to receive first information including a plurality of lines through a communication module.

[0243] According to one embodiment, the instructions, when executed by a processor of the electronic device, may cause the electronic device to generate converted first information by replacing at least one unique identifier included in the first information with a setting value corresponding to at least one unique identifier stored in a memory.

[0244] According to one embodiment, the instructions, when executed by a processor of the electronic device, may cause the electronic device to encode the converted first information on a line-by-line basis.

[0245] According to one embodiment, the instructions, when executed by a processor of an electronic device, may cause the electronic device to determine whether the first information includes a confidential code based on confidential code information generated for each line based on at least one confidential code and the encoded first information.

[0246] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned will be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains.

[0247] Electronic devices according to the various embodiments disclosed in this document may take various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to the embodiments of this document are not limited to the aforementioned devices.

[0248] The various embodiments of this document and the terminology used therein are not intended to limit the technical features described in this document to specific embodiments, but should be understood to include various modifications, equivalents, or substitutes of the embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the items, unless the context clearly indicates otherwise. In this document, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among those phrases, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used merely to distinguish one component from another, and do not limit the components in any other respect (e.g., importance or order). When a component (e.g., a first component) is referred to as "coupled" or "connected" to another (e.g., a second component), with or without the terms "functionally" or "communicatively," it means that the component can be connected to the other component directly (e.g., wired), wirelessly, or through a third component.

[0249] The term "module" used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integral component, or a minimum unit or part of such a component that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).

[0250] Various embodiments of the present document may be implemented as software (e.g., a program (140)) including one or more instructions stored in a storage medium (e.g., an internal memory (136) or an external memory (138)) readable by a machine (e.g., an electronic device (101)). For example, a processor (e.g., a processor (120)) of the machine (e.g., an electronic device (101)) may call at least one instruction among the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' simply means that the storage medium is a tangible device and does not contain signals (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium.

[0251] According to one embodiment, the method according to various embodiments disclosed in this document may be provided as included in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or may be distributed online (e.g., downloaded or uploaded) through an application store (e.g., Play Store™) or directly between two user devices (e.g., smart phones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily generated in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.

[0252] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separated and placed in other components. According to various embodiments, one or more components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (e.g., a module or a program) may be integrated into a single component. In such a case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. According to various embodiments, the operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.

Claims

1. In electronic devices, Memory set up to store instructions; Communication module, and Contains one or more processors, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Receive first information including a plurality of lines through the above communication module, Generating converted first information by replacing at least one unique identifier included in the first information with a setting value corresponding to the at least one unique identifier stored in the memory based on the setting value stored in the memory, Encode the above converted first information in units of each line, An electronic device characterized in that it includes instructions set to check whether the first information includes a confidential code based on confidential code information generated for each line unit based on at least one confidential code and the encoded first information.

2. In paragraph 1, The above confidential code information includes encoding information corresponding to the at least one confidential code, and a hash value corresponding to the encoding information, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Using a specified algorithm, at least one first hash value corresponding to the encoded first information is verified, An electronic device characterized in that it further includes instructions set to check whether, among the hash values ​​corresponding to the encoding information, there is a second hash value corresponding to at least one of the confirmed first hash values.

3. In paragraph 1 or 2, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Based on the confirmation that the second hash value exists, at least one encoding information related to the second hash value is confirmed, Checking the first similarity between the above-mentioned at least one encoded information and the encoded first information, An electronic device characterized in that it further includes instructions set to determine that the first information includes a confidential code based on determining that the first similarity is greater than or equal to the first value.

4. In any one of paragraphs 1 to 3, The first information includes a program code including a plurality of code lines, wherein said at least one confidential code comprises a plurality of code lines including said at least one unique identifier, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Check the encoding information having a size corresponding to the first information among at least one encoding information related to the second hash value, An electronic device characterized in that it further includes instructions set to compare encoding information of a size corresponding to the first information with the encoded first information on a line-by-line basis to confirm the first similarity.

5. In any one of paragraphs 1 to 4, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: An electronic device, characterized in that it further includes instructions configured to verify at least one first hash value corresponding to a first window size using a sliding window algorithm.

6. In any one of paragraphs 1 to 5, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Using the LSH (locality-sensitive hashing) algorithm, verify the at least one first hash value, An electronic device characterized in that it further includes instructions set to identify, as the second hash value, a hash value having a second similarity greater than or equal to a second value with the at least one confirmed first hash value among the hash values ​​corresponding to each of the at least one confidential codes.

7. In any one of paragraphs 1 to 6, The above first information includes a program code including a plurality of code lines, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Parse the above first information line by line to check at least one first sub-information, An electronic device characterized in that it further includes instructions configured to convert a token included in the at least one first sub-information based on a setting value corresponding to the at least one unique identifier.

8. In any one of paragraphs 1 to 7, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: An electronic device characterized in that it further includes an instruction set to convert a token corresponding to a first unique identifier among tokens included in the at least one first sub-information into a token corresponding to the first unique identifier based on a setting value corresponding to the at least one unique identifier.

9. In any one of paragraphs 1 to 8, The above confidential code information further includes connection information mapped to the above encoding information, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Based on the addition of the first code in the confidential code, encoding is performed for the first code, Based on the first code and the confidential code corresponding to the code line adjacent to the first code, the third hash value and the first connection information corresponding to the encoded first code are each verified, An electronic device characterized in that it further includes instructions set to update the confidential code information based on the encoded first code, the third hash value, and the first connection information.

10. In any one of paragraphs 1 to 9, The above confidential code information further includes connection information mapped to the above encoding information, The instructions, when individually or collectively executed by the one or more processors, cause the electronic device to: Based on the deletion of the second code among the confidential codes, the fourth hash value and the second connection information corresponding to at least one code line adjacent to the second code are each verified, An electronic device characterized in that it further includes instructions set to update the confidential code information based on each of the fourth hash value and the second connection information.

11. In a non-transitory recording medium storing computer-executable instructions, the instructions, when individually or collectively executed by one or more processors of an electronic device, cause the electronic device to: Receiving first information including a plurality of lines, Generating converted first information by replacing at least one unique identifier included in the first information with the setting value based on the setting value corresponding to at least one unique identifier, Encode the above converted first information in units of each line, and A non-transitory recording medium characterized in that it includes instructions set to check whether the first information includes a confidential code based on confidential code information generated for each line unit based on at least one confidential code and the encoded first information.

12. In paragraph 11, The above confidential code information includes encoding information corresponding to the at least one confidential code, and a hash value corresponding to the encoding information, An instruction set to check whether the above first information contains a confidential code is: An instruction set to verify at least one first hash value corresponding to the encoded first information using a specified algorithm, and A non-transitory recording medium, characterized in that it includes an instruction set to check whether a second hash value corresponding to at least one of the confirmed first hash values ​​exists among the hash values ​​corresponding to the encoding information.

13. In paragraph 11 or 12, An instruction set to check whether the above first information contains a confidential code is: An instruction configured to verify at least one piece of encoding information associated with the second hash value based on verifying that the second hash value exists; An instruction set to verify a first similarity between the at least one encoded information verified above and the encoded first information; and A non-transitory recording medium characterized in that it includes instructions set to determine that the first information includes a confidential code based on determining that the first similarity is greater than or equal to a first value.

14. In any one of paragraphs 11 to 13, The first information includes a program code including a plurality of code lines, wherein said at least one confidential code comprises a plurality of code lines including said at least one unique identifier, The above instructions, when executed individually or collectively by one or more processors of the electronic device, cause the electronic device to: Further comprising an instruction set to check encoding information having a size corresponding to the first information among at least one encoding information related to the second hash value, The instruction set to check the above first similarity is: A non-transitory recording medium characterized in that it includes an instruction set to compare the encoded first information with the encoded first information in a line-by-line manner to confirm the first similarity.

15. In any one of paragraphs 11 to 14, An instruction set to verify at least one first hash value, A non-transitory recording medium, characterized in that it includes instructions configured to check at least one first hash value corresponding to a first window size using a sliding window algorithm.

Citation Information

Patent Citations

  • Method, system and computer readable recording medium for desultory change to protect source code of javascript

    KR101157996B1

  • Obfuscation for protection of streaming media and other data flows

    KR1020170108111A

  • Method of protecting secret data when used in a cryptographic algorithm

    KR102352066B1

  • Protecting against cryptographic key exposure in source code

    US8621237B1

  • Method for determining and protecting proprietary source code using mnemonic identifiers

    US8738931B1