KR20210059547A - Blockchain network being capable of encryption based on a smart contract - Google Patents

Blockchain network being capable of encryption based on a smart contract Download PDF

Info

Publication number
KR20210059547A
KR20210059547A KR1020190147134A KR20190147134A KR20210059547A KR 20210059547 A KR20210059547 A KR 20210059547A KR 1020190147134 A KR1020190147134 A KR 1020190147134A KR 20190147134 A KR20190147134 A KR 20190147134A KR 20210059547 A KR20210059547 A KR 20210059547A
Authority
KR
South Korea
Prior art keywords
data
encryption key
smart contract
encryption
blockchain
Prior art date
Application number
KR1020190147134A
Other languages
Korean (ko)
Inventor
박수용
이유정
Original Assignee
서강대학교산학협력단
주식회사 엠블럭
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 서강대학교산학협력단, 주식회사 엠블럭 filed Critical 서강대학교산학협력단
Priority to KR1020190147134A priority Critical patent/KR20210059547A/en
Publication of KR20210059547A publication Critical patent/KR20210059547A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0872Generation of secret information including derivation or calculation of cryptographic keys or passwords using geo-location information, e.g. location data, time, relative position or proximity to other entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • H04L2209/38

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present invention relates to a blockchain network capable of data encryption based on a smart contract. A smart contract of a blockchain network comprises: an encryption key generation module that generates an encryption key; a data encryption module that encrypts data using an encryption key; and a data decryption module for decrypting the encrypted data, If you want to encrypt data and store it in a blockchain, a participating node calls the smart contract to generate an encryption key, encrypts data using the encryption key, generates and propagates a transaction containing the encrypted data, generates a block for the transaction according to a preset consensus algorithm, and records the block in the blockchain.

Description

스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크{Blockchain network being capable of encryption based on a smart contract}Blockchain network being capable of encryption based on a smart contract}

본 발명은 블록체인 네트워크에 관한 것으로서, 더욱 구체적으로는 키 생성 코드, 데이터 암호화 코드 및 데이터 복호화 코드를 포함하는 스마트 컨트랙트를 이용하여, 트랜잭션 별로 데이터를 암호화하고 암호화된 데이터를 복호화할 수 있도록 구성된 것을 특징으로 하는 블록체인 네트워크에 관한 것이다. The present invention relates to a blockchain network, and more specifically, is configured to encrypt data for each transaction and decrypt the encrypted data using a smart contract including a key generation code, a data encryption code, and a data decryption code. It relates to a characteristic blockchain network.

블록체인 네트워크는 네트워크에 참여하는 사용자들이 직접 데이터를 검증하고 합의하여 데이터를 분산 저장하는 것으로서, 중앙 관리 기관 없이 사용자들이 직접 거래할 수 있게 된다. 블록체인은 트랜잭션의 위조 및 변조가 어려우므로 데이터의 신뢰성을 보장받을 수 있을 뿐만 아니라 모든 사용자들이 동일한 블록체인 원장을 보유함으로써 누구나 열람할 수 있기 때문에 데이터의 투명성과 무결성을 보장하게 된다. Blockchain network is a distributed storage of data by users participating in the network verifying and consensus on data, and users can directly transact without a central management authority. Since it is difficult to forgery and alter transactions in the blockchain, the reliability of the data can be guaranteed, and since all users have the same blockchain ledger, anyone can read it, thus ensuring the transparency and integrity of the data.

이러한 블록체인 네트워크는 퍼블릭(Public) 블록체인 네트워크와 프라이빗(Private) 블록체인 네트워크로 나뉘게 된다. 퍼블릭 블록체인 네트워크는 모든 데이터가 공개되며 누구나 네트워크에 참여하여 데이터를 검증하고 블록을 생성할 수 있는 노드가 될 수 있으며, 현재 비트코인 및 이더리움이 퍼블릭 블록체인 네트워크로 이루어진다. These blockchain networks are divided into public blockchain networks and private blockchain networks. The public blockchain network is a node where all data is public and anyone can participate in the network to verify data and generate blocks, and currently Bitcoin and Ethereum are made up of public blockchain networks.

그리고, 프라이빗 블록체인 네트워크는 기업을 위하여 개발되었으며, 사적 블록체인, 폐쇄형 블록체인, 허가형 블록체인, 기업형 블록체인 또는 엔터프라이즈 블록체인이라고도 불리우며, 허가된 참여자 외의 거래 내역과 여러 행동(Action)은 공유되지 않고 추적할 수 없다. 그리고, 프라이빗 블록체인 네트워크에 참여하기 위하여, 한 명의 주체로부터 허가된 참여자만이 참여하여 블록을 생성할 수 있으며, 프라이빗 블록체인의 대표적인 사례로는 하이퍼레저 패브릭(Hyperledger Fabric)이 있다. 하이퍼레저 패브릭은 허락된 참여자만 블록체인 네트워크에 참여 가능하며 네트워크내에서 조직(Organization)을 구성하고 논리적 묶음(Channel)으로 서로 다른 원장의 공유가 가능하다. In addition, the private blockchain network was developed for enterprises, and is also called a private blockchain, a closed blockchain, a permissioned blockchain, an enterprise blockchain, or an enterprise blockchain. It is not shared and cannot be tracked. And, in order to participate in a private blockchain network, only a participant authorized by one subject can participate and create a block, and a representative example of a private blockchain is Hyperledger Fabric. Hyperledger Fabric allows only authorized participants to participate in the blockchain network, and it is possible to form an organization within the network and share different ledgers in a logical channel.

따라서, 퍼블릭 블록체인은 블록체인 원장이 모든 노드들이 열람할 수 있기 때문에, 각 사용자들이 공개하고 싶지 않거나 공개되어서는 안 되는 데이터들도 퍼블릭 블록체인에서는 공개될 수 밖에 없는 문제점이 발생한다. Therefore, in the public blockchain, since the blockchain ledger can be viewed by all nodes, data that each user does not want to or should not disclose can only be disclosed in the public blockchain.

또한, 각 데이터를 암호화시키고자 하는 경우, 블록체인 네트워크를 구성하는 모든 노드가 암호화 프로토콜을 구비하고 있어야 하므로, 각 노드의 성능에 따라 제한이 많이 발생하게 된다. In addition, when each data is to be encrypted, since all nodes constituting the blockchain network must have an encryption protocol, there are many restrictions depending on the performance of each node.

이에 본 발명은 퍼블릭 블록체인에서, 각 노드들이 별도의 암호화 프로토콜을 구비하지 않고 있더라도, 공개하고 싶지 않거나 공개되어서는 안되는 데이터들을 저장하고, 권한있는 사용자만이 열람하거나 확인할 수 있도록 하는 방안을 제안하고자 한다. Accordingly, the present invention is to propose a method in which data that do not want to be disclosed or that should not be disclosed can be stored in a public blockchain, and that only authorized users can view or check data even if each node does not have a separate encryption protocol. do.

한국공개특허공보 제 10-2019-0099365호Korean Patent Application Publication No. 10-2019-0099365 한국등록특허공보 제 10-1849912호Korean Registered Patent Publication No. 10-1849912 한국공개특허공보 제 10-2019-0042567호Korean Patent Application Publication No. 10-2019-0042567

전술한 문제점을 해결하기 위한 본 발명의 목적은 각 트랜잭션별로 데이터를 암호화하거나 복호화할 수 있도록 한 블록체인 네트워크를 제공하는 것이다. An object of the present invention for solving the above-described problem is to provide a blockchain network capable of encrypting or decrypting data for each transaction.

전술한 기술적 과제를 달성하기 위한 본 발명의 특징에 따른 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크는, 블록체인을 구비한 다수의 참여 노드들로 이루어지는 블록체인 네트워크에 대한 것으로서, 상기 블록체인에는 데이터에 대한 암호화 및 복호화를 실행하는 스마트 컨트랙트가 저장된 블록을 포함하고, A blockchain network capable of encrypting data based on a smart contract according to a feature of the present invention for achieving the above-described technical problem is for a blockchain network consisting of a plurality of participating nodes equipped with a blockchain, and the blockchain Contains a block in which a smart contract that performs encryption and decryption of data is stored,

상기 스마트 컨트랙트는, 암호화키를 생성하는 암호화키 생성 모듈; 암호화키를 이용하여 데이터를 암호화시키는 데이터 암호화 모듈; 및 암호화된 데이터를 복호화시키는 데이터 복호화 모듈;을 포함하는 것을 특징으로 하며, The smart contract includes an encryption key generation module for generating an encryption key; A data encryption module for encrypting data using an encryption key; And a data decryption module for decrypting the encrypted data,

상기 참여 노드는 데이터를 암호화시켜 블록체인에 저장하고자 하는 경우, 상기 스마트 컨트랙트를 호출하여 암호화키를 생성하고, 상기 암호화키를 이용하여 데이터를 암호화시킨 후, 암호화된 데이터를 포함하는 트랜잭션을 생성하여 전파하고, 사전 설정된 합의 알고리즘에 따라 상기 트랜잭션에 대한 블록을 생성하고, 상기 블록을 블록체인에 기록한다. When the participating node encrypts data and wants to store it in the blockchain, it calls the smart contract to generate an encryption key, encrypts the data using the encryption key, and creates a transaction including the encrypted data. It propagates, generates a block for the transaction according to a preset consensus algorithm, and records the block in the blockchain.

전술한 특징에 따른 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크에 있어서, 상기 암호화키 생성 모듈은, 현재 시간에 대한 타임스탬프(Timestamp)를 기반으로 하여 생성된 무작위 수를 이용하여 암호화키를 생성하여 제공하는 것이 바람직하다. In a blockchain network capable of encrypting data based on a smart contract according to the above-described characteristics, the encryption key generation module generates an encryption key using a random number generated based on a timestamp for the current time. It is desirable to produce and provide.

전술한 특징에 따른 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크에 있어서, 상기 데이터 암호화 모듈은, 암호화키 생성 모듈에 의해 생성된 암호화키와 데이터를 입력받고, 입력된 데이터에 대하여 상기 암호화키를 이용하여, 무작위로 설정된 연산들을 수행하여 데이터를 암호화하며, 연산을 수행한 연산 집합 및 암호화된 데이터를 제공하는 것이 바람직하다. In a blockchain network capable of encrypting data based on a smart contract according to the above-described characteristics, the data encryption module receives the encryption key and data generated by the encryption key generation module, and the encryption key for the input data. It is preferable to encrypt data by performing randomly set operations and to provide a set of operations and encrypted data.

전술한 특징에 따른 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크에 있어서, 상기 데이터 암호화 모듈은, 데이터의 각 바이트(byte)에 대하여 암호화키를 이용한 연산을 수행하여 데이터의 길이만큼 암호화하고, 암호화된 데이터의 길이는 암호화 키의 길이와 같거나 이보다 작은 것이 더욱 바람직하다. In a blockchain network capable of encrypting data based on a smart contract according to the above-described characteristics, the data encryption module performs an operation using an encryption key for each byte of data, and encrypts it by the length of the data, It is more preferable that the length of the encrypted data is equal to or smaller than the length of the encryption key.

전술한 특징에 따른 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크에 있어서, 상기 연산 집합은 데이터의 각 바이트(byte)에 대하여 적용된 연산들을 순서대로 나열한 집합인 것이 바람직하다. In a blockchain network capable of encrypting data based on a smart contract according to the above-described characteristics, the operation set is preferably a set in which operations applied to each byte of data are arranged in order.

전술한 특징에 따른 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크에 있어서, 상기 데이터 복호화 모듈은, 암호화된 데이터, 암호화 키 및 연산집합을 입력받고, 입력된 암호화된 데이터와 암호화 키를 바이트(byte)로 변환시키고, 암호화된 데이터의 각 바이트에 대하여 암호화 키를 이용하여 연산집합의 연산을 수행하여 데이터를 복호화하는 것이 바람직하다. In a blockchain network capable of encrypting data based on a smart contract according to the above-described characteristics, the data decryption module receives encrypted data, an encryption key, and an operation set, and converts the input encrypted data and encryption key into bytes ( byte), and decrypting the data by performing an operation of an operation set using an encryption key for each byte of the encrypted data.

본 발명에 따른 블록체인 네트워크는 스마트 컨트랙트를 이용하여 퍼블릭 네트워크에서도 각 트랜잭션의 데이터들을 암호화하여 블록체인에 기록할 수 있도록 함으로써, 공개하지 않고자 하는 데이터들도 안전하게 블록체인에 등록할 수 있게 된다. The blockchain network according to the present invention enables data of each transaction to be encrypted and recorded in the blockchain even in the public network using smart contracts, so that data that is not intended to be disclosed can be safely registered in the blockchain.

특히, 본 발명에 따른 블록체인 네트워크는 스마트 컨트랙트를 활용함으로서, 각 참여 노드들이 암호화 프로토콜의 설치없이도 각 데이터들을 암호화시켜 기록할 수 잇게 된다. In particular, the blockchain network according to the present invention utilizes a smart contract, so that each participating node can encrypt and record each data without installing an encryption protocol.

또한, 본 발명에 따른 블록체인 네트워크는 암호화에 사용된 암호화키를 공유함으로써, 데이터를 공유하고자 하는 사용자들과 데이터를 공유할 수 있게 된다. In addition, the blockchain network according to the present invention can share data with users who wish to share data by sharing the encryption key used for encryption.

도 1은 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트의 구성을 개략적으로 도시한 블록도이다.
도 2는 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트 중 암호화키 생성 모듈의 일 실시형태에 대한 동작을 순차적으로 도시한 흐름도이며, 도 3은 상기 암호화키 생성 모듈의 일 실시형태에 대한 코드이다.
도 4는 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트 중 데이터 암호화 모듈의 일 실시형태에 대한 동작을 순차적으로 도시한 흐름도이며, 도 5는 상기 데이터 암호화 모듈의 일 실시형태에 대한 코드이다.
도 6은 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트 중 데이터 복호화 모듈의 일 실시형태에 대한 동작을 순차적으로 도시한 흐름도이며, 도 7은 상기 데이터 복호화 모듈의 일 실시형태에 대한 코드이다.
1 is a block diagram schematically showing the configuration of a smart contract in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention.
2 is a flowchart sequentially showing the operation of an embodiment of an encryption key generation module among smart contracts in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. Is a code for an embodiment of the encryption key generation module.
4 is a flowchart sequentially showing the operation of an embodiment of a data encryption module among smart contracts in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. This is the code for one embodiment of the data encryption module.
6 is a flowchart sequentially showing the operation of an embodiment of a data decryption module among smart contracts in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. This is a code for an embodiment of the data decoding module.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크의 구조 및 동작에 대하여 구체적으로 설명한다. Hereinafter, the structure and operation of a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention will be described in detail with reference to the accompanying drawings.

본 발명에 따른 블록체인을 구비한 다수의 참여 노드들로 이루어지는 블록체인 네트워크는, 상기 블록체인에는 데이터에 대한 암호화 및 복호화를 실행하는 스마트 컨트랙트가 저장된 블록을 포함한다. A block chain network comprising a plurality of participating nodes having a block chain according to the present invention includes a block in which a smart contract that performs encryption and decryption of data is stored in the block chain.

도 1은 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트의 구성을 개략적으로 도시한 블록도이다. 도 1을 참조하면, 본 발명에 따른 블록체인 네트워크의 사전 설정되어 저장된 스마트 컨트랙트(10)는, 암호화키를 생성하는 암호화키 생성 모듈(100), 암호화키를 이용하여 데이터를 암호화시키는 데이터 암호화 모듈(200), 및 암호화된 데이터를 복호화시키는 데이터 복호화 모듈(300)을 포함한다. 1 is a block diagram schematically showing the configuration of a smart contract in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. Referring to FIG. 1, a pre-set and stored smart contract 10 of a blockchain network according to the present invention includes an encryption key generation module 100 for generating an encryption key, and a data encryption module for encrypting data using an encryption key. 200, and a data decryption module 300 for decrypting the encrypted data.

상기 블록체인 네트워크를 구성하는 참여 노드는 암호화하여 블록체인에 저장하고자 하는 데이터가 발생하면, 스마트 컨트랙트의 암호화키 생성 모듈을 호출한다. 상기 암호화키 생성 모듈은 암호화키를 생성하고, 생성된 암호화키를 상기 참여 노드에게 제공힌다. When data to be encrypted and stored in the blockchain is generated by the participating nodes constituting the blockchain network, the encryption key generation module of the smart contract is called. The encryption key generation module generates an encryption key and provides the generated encryption key to the participating node.

상기 참여 노드는 암호화키 생성 모듈로부터 제공받은 암호화키와 데이터를 인수로 하여 스마트 컨트랙트의 데이터 암호화 모듈을 호출한다. 상기 데이터 암호화 모듈은 암호화키를 이용하여 상기 데이터를 암호화시키고, 암호화된 데이터 및 연산 집합을 상기 참여 노드에게 제공한다. The participating node calls the data encryption module of the smart contract by taking the encryption key and data provided from the encryption key generation module as arguments. The data encryption module encrypts the data using an encryption key, and provides the encrypted data and operation set to the participating node.

상기 참여 노드는 암호화된 데이터를 포함하는 트랜잭션을 생성하여 전파하고, 사전 설정된 합의 알고리즘에 따라 상기 트랜잭션에 대한 블록을 생성하고, 상기 블록을 블록체인에 기록한다. The participating node generates and propagates a transaction including encrypted data, generates a block for the transaction according to a preset consensus algorithm, and records the block in the blockchain.

한편, 상기 참여 노드는 블록체인으로부터 암호화된 데이터를 수신하면, 암호화키, 암호화된 데이터 및 연산 집합을 인수로 하여 스마트 컨트랙트의 데이터 복호화 모듈을 호출한다. 상기 데이터 복호화 모듈은 암호화키 및 연산 집합을 이용하여 상기 암호화된 데이터를 복호화하여 상기 참여 노드에게 제공한다. On the other hand, when the participating node receives the encrypted data from the blockchain, it calls the data decryption module of the smart contract with the encryption key, the encrypted data, and the operation set as arguments. The data decryption module decrypts the encrypted data using an encryption key and an operation set and provides it to the participating node.

전술한 구성을 갖는 본 발명에 따른 블록체인 네트워크는 퍼블릭 네트워크이지만, 각 노드들이 별도의 암호화 프로토콜을 가지고 있지 않더라도, 스마트 컨트랙트를 이용하여, 공개하지 않고자 하는 데이터들을 암호화하여 블록의 형태로 블록체인에 기록할 수 있게 된다. The blockchain network according to the present invention having the above-described configuration is a public network, but even if each node does not have a separate encryption protocol, a block chain in the form of a block by encrypting data that is not intended to be disclosed using a smart contract. You will be able to write on it.

이하, 첨부된 도면을 참조하여 본 발명에 따른 데이터 암호화 및 복호화를 위한 스마트 컨트랙트에 대하여 구체적으로 설명한다. Hereinafter, a smart contract for data encryption and decryption according to the present invention will be described in detail with reference to the accompanying drawings.

상기 암호화키 생성 모듈은 데이터에 대한 암호화키를 생성하는 기능을 수행하는 스마트 컨트랙트 코드로서, 현재 시간 타임 스탬프를 기반으로 하여 무작위 수를 생성하여 암호화키로 제공한다. 도 2는 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트 중 암호화키 생성 모듈의 일 실시형태에 대한 동작을 순차적으로 도시한 흐름도이며, 도 3은 상기 암호화키 생성 모듈의 일 실시형태에 대한 코드이다.The encryption key generation module is a smart contract code that performs a function of generating an encryption key for data, and generates a random number based on a current time stamp and provides it as an encryption key. 2 is a flowchart sequentially showing the operation of an embodiment of an encryption key generation module among smart contracts in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. Is a code for an embodiment of the encryption key generation module.

도 2 및 도 3을 참조하면, 본 발명에 따른 암호화키 생성 모듈은, 현재 시간 타임 스탬프(Time Stamp)를 기반으로 하여 무작위 수를 생성한다. 이때, 암호화키는 16진수의 64자리 259bit로 이루어진다. 이때, i는 256 자리의 암호화키를 생성하기 위하여 256번 반복하도록 0부터 255까지 1씩 증가하는 변수이다. 현재 시간과 i를 더한 값을 2로 나눈 나머지를 키(key) 배열의 i번째에 대입하며 256번 반복하게 된다. 이렇게 256번 반복하여 key가 생성되면 함수가 종료된다. 2 and 3, the encryption key generation module according to the present invention generates a random number based on a current time stamp. At this time, the encryption key consists of 259 bits of 64 hexadecimal numbers. In this case, i is a variable that increases by 1 from 0 to 255 so as to repeat 256 times to generate a 256-digit encryption key. The current time plus i is divided by 2 and the remainder is assigned to the i-th in the key array, and it repeats 256 times. When the key is generated by repeating 256 times in this way, the function is terminated.

도 3을 참조하면, 사용자가 CreateKey 함수를 호출하면 타임스탬프를 기반으로 랜덤한 수를 16진수로 1Btye씩 생성하여 총 32 byte의 키를 생성한다. Referring to FIG. 3, when a user calls the CreateKey function, a random number based on a timestamp is generated in hexadecimal by 1Btye, thereby generating a total of 32 bytes of keys.

상기 데이터 암호화 모듈은 암호화키를 이용하여 데이터를 암호화시키는 기능을 수행하는 스마트 컨트랙트 코드로서, 사용자로부터 상기 암호화키 생성 모듈로부터 제공된 암호화키와 데이터를 인수로 받아, 상기 데이터를 암호화시키게 된다. 도 4는 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트 중 데이터 암호화 모듈의 일 실시형태에 대한 동작을 순차적으로 도시한 흐름도이며, 도 5는 상기 데이터 암호화 모듈의 일 실시형태에 대한 코드이다.The data encryption module is a smart contract code that performs a function of encrypting data using an encryption key, and encrypts the data by receiving the encryption key and data provided from the encryption key generation module from a user. 4 is a flowchart sequentially showing the operation of an embodiment of a data encryption module among smart contracts in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. This is the code for one embodiment of the data encryption module.

도 4 및 도 5를 참조하면, 본 발명에 따른 데이터 암호화 모듈은, 사용자인 참여 노드로부터 데이터와 암호화키를 입력받고, 입력된 데이터와 암호화키를 Byte로 변환한다. 변환된 암호화키와 데이터를 1 byte씩 연산하여 암호화한다. 데이터의 i번째 byte의 값과 암호화키의 i+1번째 byte 값에 대하여 임의의 연산을 수행하여 데이터를 암호화하고, 데이터의 길이만큼 암호화키와 암호화한다. 이때, 각 byte에 대하여 사용되는 연산은 사전 설정된 연산 그룹으로부터 무작위로 선택된 연산으로서, +(SUM), -(SUBSTRACT), ^(XOR), ~(^)(Not(XOR)) 등을 포함하는 연산 그룹으로부터 무작위로 선택될 수 있다. 암호화키를 32 byte로 고정시키는 경우, 데이터의 길이가 암호화키의 길이보다 길 경우에는, 32로 나눈 나머지값을 key byte의 인덱스로 넣어 계산할 수 있다. 각 byte에 대하여 사용한 데이터 암호화 연산은 랜덤이며, 상기 데이터 암호화 모듈은 연산 집합(op_Set)과 암호화된 데이터를 사용자에게 반환하게 된다. 상기 연산 집합은, 데이터의 각 바이트에 대하여, 사전 설정된 연산 그룹으로부터 무작위로 선택하여 적용한 연산들을 순차적으로 나열한 집합이다. 4 and 5, the data encryption module according to the present invention receives data and an encryption key from a participating node that is a user, and converts the input data and encryption key into bytes. The converted encryption key and data are calculated and encrypted by 1 byte. Data is encrypted by performing a random operation on the value of the i-th byte of the data and the value of the i+1th byte of the encryption key, and the encryption key and encryption are performed for the length of the data. At this time, the operation used for each byte is an operation selected at random from a preset operation group, including +(SUM), -(SUBSTRACT), ^(XOR), ~(^)(Not(XOR)), etc. It can be randomly selected from a group of operations. When the encryption key is fixed to 32 bytes, when the length of the data is longer than the length of the encryption key, the remaining value divided by 32 can be calculated by putting the index of the key byte. The data encryption operation used for each byte is random, and the data encryption module returns an operation set (op_Set) and encrypted data to the user. The operation set is a set in which operations selected and applied at random from a preset operation group are sequentially arranged for each byte of data.

한편, 연산 그룹에 포함되는 각 연산들을 숫자로 표현하고, 데이터 암호화에 사용된 연산들에 대한 연산 집합에는 각 연산들에 대한 숫자들을 표시하도록 하는 것이 바람직하다. 예컨대, 연산 그룹에 +(SUM), -(SUBSTRACT), ^(XOR), ~(^)(Not(XOR))의 4개의 연산이 있는 경우, 각각 0,1,2,3를 할당하고, 암호화 연산시 0은 덧셈, 2는 뺄셈, 3은 XOR, 4는 Not XOR 연산을 수행하게 된다. On the other hand, it is preferable to express each operation included in the operation group as a number, and to display the numbers for each operation in the operation set for the operations used for data encryption. For example, if there are four operations +(SUM), -(SUBSTRACT), ^(XOR), ~(^)(Not(XOR)) in the operation group, 0,1,2,3 are assigned respectively, In encryption operation, 0 is added, 2 is subtracted, 3 is XOR, and 4 is Not XOR.

상기 데이터 복호화 모듈은 암호화된 데이터를 복호화하는 기능을 수행하는 스마트 컨트랙트 코드로서, 사용자로부터 암호화된 데이터, 암호화키 및 연산집합을 입력받아 상기 암호화된 데이터를 복호화하고, 복호화된 데이터를 제공한다. 도 6은 본 발명의 바람직한 실시예에 따른 스마트 컨트랙트를 기반으로 하여 데이터 암호화가능한 블록체인 네트워크에 있어서, 스마트 컨트랙트 중 데이터 복호화 모듈의 일 실시형태에 대한 동작을 순차적으로 도시한 흐름도이며, 도 7은 상기 데이터 복호화 모듈의 일 실시형태에 대한 코드이다.The data decryption module is a smart contract code that performs a function of decrypting encrypted data, receives encrypted data, an encryption key, and an operation set from a user, decrypts the encrypted data, and provides the decrypted data. 6 is a flowchart sequentially showing the operation of an embodiment of a data decryption module among smart contracts in a blockchain network capable of encrypting data based on a smart contract according to a preferred embodiment of the present invention. This is a code for an embodiment of the data decoding module.

도 6 및 도 7을 참조하면, 본 발명에 따른 데이터 복호화 모듈은, 사용자로부터 암호화된 데이터, 암호화키 및 연산집합을 입력받고, 입력된 데이터와 암호화키를 byte로 변환하고, 데이터의 i번째 byte값과 암호화키의 i+1번째의 byte값을 연산집합의 i번째 연산을 수행하여 데이터를 복호화한다. 6 and 7, the data decryption module according to the present invention receives encrypted data, encryption key, and operation set from a user, converts the input data and encryption key into bytes, and converts the i-th byte of data. The data is decrypted by performing the i-th operation of the operation set on the value and the i+1th byte value of the encryption key.

이상에서 본 발명에 대하여 그 바람직한 실시예를 중심으로 설명하였으나, 이는 단지 예시일 뿐 본 발명을 한정하는 것이 아니며, 본 발명이 속하는 분야의 통상의 지식을 가진 자라면 본 발명의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 그리고, 이러한 변형과 응용에 관계된 차이점들은 첨부된 청구 범위에서 규정하는 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다. In the above, the present invention has been described with reference to its preferred embodiments, but these are only examples and do not limit the present invention, and those of ordinary skill in the field to which the present invention pertains will not depart from the essential characteristics of the present invention. It will be appreciated that various modifications and applications not exemplified above are possible in the range. And, differences related to these modifications and applications should be construed as being included in the scope of the present invention defined in the appended claims.

10 : 스마트 컨트랙트
100 : 암호화키 생성 모듈
200 : 데이터 암호화 모듈
300 : 데이터 복호화 모듈
10: Smart contract
100: encryption key generation module
200: data encryption module
300: data decoding module

Claims (6)

블록체인을 구비한 다수의 참여 노드들로 이루어지는 블록체인 네트워크에 있어서,
상기 블록체인에는 데이터에 대한 암호화 및 복호화를 실행하는 스마트 컨트랙트가 저장된 블록을 포함하고,
상기 스마트 컨트랙트는,
암호화키를 생성하는 암호화키 생성 모듈;
암호화키를 이용하여 데이터를 암호화시키는 데이터 암호화 모듈; 및
암호화된 데이터를 복호화시키는 데이터 복호화 모듈;을 포함하는 것을 특징으로 하며,
상기 참여 노드는 데이터를 암호화시켜 블록체인에 저장하고자 하는 경우,
상기 스마트 컨트랙트를 호출하여 암호화키를 생성하고, 상기 암호화키를 이용하여 데이터를 암호화시킨 후, 암호화된 데이터를 포함하는 트랜잭션을 생성하여 전파하고, 사전 설정된 합의 알고리즘에 따라 상기 트랜잭션에 대한 블록을 생성하고, 상기 블록을 블록체인에 기록하는 것을 특징으로 하는 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크.
In a block chain network consisting of a number of participating nodes equipped with a block chain,
The blockchain includes a block in which a smart contract that performs encryption and decryption of data is stored,
The smart contract,
An encryption key generation module for generating an encryption key;
A data encryption module for encrypting data using an encryption key; And
Characterized in that it comprises a; a data decryption module for decrypting the encrypted data,
When the participating node wants to encrypt data and store it in the blockchain,
Generates an encryption key by calling the smart contract, encrypts data using the encryption key, generates and propagates a transaction including the encrypted data, and creates a block for the transaction according to a preset consensus algorithm And, a blockchain network capable of encrypting data based on a smart contract, characterized in that the block is recorded in the blockchain.
제1항에 있어서, 상기 암호화키 생성 모듈은,
현재 시간에 대한 타임스탬프(Timestamp)를 기반으로 하여 생성된 무작위 수를 이용하여 암호화키를 생성하여 제공하는 것을 특징으로 하는 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크.
The method of claim 1, wherein the encryption key generation module,
A blockchain network capable of encrypting data based on a smart contract, characterized in that an encryption key is generated and provided using a random number generated based on a timestamp for the current time.
제1항에 있어서, 상기 데이터 암호화 모듈은,
암호화키 생성 모듈에 의해 생성된 암호화키와 데이터를 입력받고,
입력된 데이터에 대하여 상기 암호화키를 이용하여, 무작위로 설정된 연산들을 수행하여 데이터를 암호화하며,
연산을 수행한 연산 집합 및 암호화된 데이터를 제공하는 것을 특징으로 하는 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크.
The method of claim 1, wherein the data encryption module,
Receive the encryption key and data generated by the encryption key generation module,
Encrypting the data by performing randomly set operations on the input data using the encryption key,
A blockchain network capable of encrypting data based on a smart contract, characterized by providing a set of operations performed and encrypted data.
제3항에 있어서, 상기 데이터 암호화 모듈은
데이터의 각 바이트(byte)에 대하여 암호화키를 이용한 연산을 수행하여 데이터의 길이만큼 암호화하고, 암호화된 데이터의 길이는 암호화 키의 길이와 같거나 이보다 작은 것을 특징으로 하는 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크.
The method of claim 3, wherein the data encryption module
Data based on a smart contract, characterized in that each byte of data is encrypted by the length of the data by performing an operation using an encryption key, and the length of the encrypted data is equal to or less than the length of the encryption key. Encryptable blockchain network.
제3항에 있어서, 상기 연산 집합은
데이터의 각 바이트(byte)에 대하여 적용된 연산들을 순서대로 나열한 집합인 것을 특징으로 하는 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크.
The method of claim 3, wherein the set of operations is
A blockchain network capable of encrypting data based on a smart contract, characterized in that it is a set of operations applied to each byte of data in order.
제1항에 있어서, 상기 데이터 복호화 모듈은,
암호화된 데이터, 암호화 키 및 연산집합을 입력받고,
입력된 암호화된 데이터와 암호화 키를 바이트(byte)로 변환시키고,
암호화된 데이터의 각 바이트에 대하여 암호화 키를 이용하여 연산집합의 연산을 수행하여 데이터를 복호화하는 것을 특징으로 하는 스마트 컨트랙트를 기반으로 한 데이터 암호화 가능한 블록체인 네트워크.
The method of claim 1, wherein the data decoding module,
Receive encrypted data, encryption key and operation set,
Converts the input encrypted data and encryption key into bytes,
A blockchain network capable of encrypting data based on a smart contract, characterized in that the data is decrypted by performing an operation of an operation set using an encryption key for each byte of encrypted data.
KR1020190147134A 2019-11-15 2019-11-15 Blockchain network being capable of encryption based on a smart contract KR20210059547A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190147134A KR20210059547A (en) 2019-11-15 2019-11-15 Blockchain network being capable of encryption based on a smart contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190147134A KR20210059547A (en) 2019-11-15 2019-11-15 Blockchain network being capable of encryption based on a smart contract

Publications (1)

Publication Number Publication Date
KR20210059547A true KR20210059547A (en) 2021-05-25

Family

ID=76145789

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190147134A KR20210059547A (en) 2019-11-15 2019-11-15 Blockchain network being capable of encryption based on a smart contract

Country Status (1)

Country Link
KR (1) KR20210059547A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230089364A (en) * 2021-12-13 2023-06-20 서울과학기술대학교 산학협력단 TMTO cryptocurrency decryption system and method using smart contract
WO2024117755A1 (en) * 2022-12-01 2024-06-06 서강대학교 산학협력단 System and device for controlling data access using blockchain-based substitution encryption, and method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101849912B1 (en) 2017-05-25 2018-04-19 주식회사 코인플러그 Method for providing certificate service based on smart contract and server using the same
KR20190042567A (en) 2016-08-30 2019-04-24 커먼웰쓰 사이언티픽 앤드 인더스트리얼 리서치 오가니제이션 Dynamic access control on block chaining
KR20190099365A (en) 2018-02-17 2019-08-27 주식회사 드림아이디어소프트 Data management and item transaction of Mobile game users based on Blockchain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190042567A (en) 2016-08-30 2019-04-24 커먼웰쓰 사이언티픽 앤드 인더스트리얼 리서치 오가니제이션 Dynamic access control on block chaining
KR101849912B1 (en) 2017-05-25 2018-04-19 주식회사 코인플러그 Method for providing certificate service based on smart contract and server using the same
KR20190099365A (en) 2018-02-17 2019-08-27 주식회사 드림아이디어소프트 Data management and item transaction of Mobile game users based on Blockchain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230089364A (en) * 2021-12-13 2023-06-20 서울과학기술대학교 산학협력단 TMTO cryptocurrency decryption system and method using smart contract
WO2024117755A1 (en) * 2022-12-01 2024-06-06 서강대학교 산학협력단 System and device for controlling data access using blockchain-based substitution encryption, and method thereof

Similar Documents

Publication Publication Date Title
US11818262B2 (en) Method and system for one-to-many symmetric cryptography and a network employing the same
HU225077B1 (en) Method and apparatus for providing for the recovery of a cryptographic key
US11177950B2 (en) Key generation for use in secured communication
JP2022528925A (en) Computer-implemented methods and systems for encrypting data
Huang et al. EABDS: Attribute‐Based Secure Data Sharing with Efficient Revocation in Cloud Computing
KR20210063619A (en) Attribute-based access control system in a blockchain network and method thereof
CA3056814A1 (en) Symmetric cryptographic method and system and applications thereof
ITGE20110091A1 (en) METHOD OF ENCRYPTION AND DRAWING
KR20210059547A (en) Blockchain network being capable of encryption based on a smart contract
US11411720B2 (en) Key distribution system, terminal device, key distribution method, and program
Gupta et al. Enhancement of Cloud Security and removal of anti-patterns using multilevel encryption algorithms.
CN115001730A (en) Role attribute-based access control system and method in distributed scene
KR20140055093A (en) System and method of distrubuted data storage, restoration
Tarawneh Cryptography: Recent Advances and Research Perspectives
Kothandan Modified Blowfish Algorithm to Enhance its Performance and Security
Gulati et al. SMS Encryption Using AES On Android Application
Tarawneh Perspective Chapter: Cryptography–Recent Advances and Research Perspectives
Brid et al. Secured Re-Encryption in Un-Reliable Cloud Using File Sharing
Adjei et al. Enhancing security in the cloud using encryption in a client centric access control mechanism
Baselios Mathews et al. Secure Data Sharing in Multiple Cloud Servers Using Forward and Backward Secrecy
Thakur et al. Multimedia Content Security with Random Key Generation Approach in Cloud Computing
CN113282913A (en) Password replacement method and device
ASCII et al. Green Global Foundation©
Adamouski Encryption technology other than PKI
JP2005269587A (en) Key sharing system, encryption system and file authentication system

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E601 Decision to refuse application