CN114417374A - Intelligent contract business card method, device, equipment and storage medium based on block chain - Google Patents

Intelligent contract business card method, device, equipment and storage medium based on block chain Download PDF

Info

Publication number
CN114417374A
CN114417374A CN202111639480.2A CN202111639480A CN114417374A CN 114417374 A CN114417374 A CN 114417374A CN 202111639480 A CN202111639480 A CN 202111639480A CN 114417374 A CN114417374 A CN 114417374A
Authority
CN
China
Prior art keywords
user
business card
account
information
block chain
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111639480.2A
Other languages
Chinese (zh)
Inventor
宗瑞
李子阳
邱振涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weway Shenzhen Network Technology Co ltd
Original Assignee
Weway Shenzhen Network Technology Co ltd
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 Weway Shenzhen Network Technology Co ltd filed Critical Weway Shenzhen Network Technology Co ltd
Priority to CN202111639480.2A priority Critical patent/CN114417374A/en
Publication of CN114417374A publication Critical patent/CN114417374A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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
    • 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/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a block chain technology, and discloses an intelligent contract business card method based on a block chain, which comprises the following steps: after a user blockchain account is activated, indexing mechanism information of a mechanism to which the user blockchain account belongs, respectively writing the user blockchain account, a user identifier in user basic information and a mechanism blockchain account in mechanism information into a plurality of account fields of an initial business card, generating an encryption key and a decryption key corresponding to the encryption key, encrypting personal information in the user basic information by using the encryption key to obtain encrypted information, calculating a hash value of the personal information, writing the hash value, the encryption key and the encrypted information into a content field in the initial business card, and respectively encrypting the decryption key by using a public key of the mechanism account and a public key of an employee account and writing the encrypted decryption key into the fields to obtain the user business card. The invention also provides an intelligent contract business card device based on the block chain, electronic equipment and a storage medium. The invention can solve the problem of low safety of business card generation.

Description

Intelligent contract business card method, device, equipment and storage medium based on block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a method and a device for intelligent contract business cards based on block chains, electronic equipment and a computer readable storage medium.
Background
In the work and social contact of various industries, business cards are always in an indispensable role, and the business cards are rarely passed on to clients, however, with the change of consumption forms and the popularization of the internet, face-to-face marketing is no longer the only method, many users gradually provide another consumption mode by using the internet, and electronic business cards are also generated according to the consumption mode of the network.
The existing electronic business card generating method generally acquires user related data from a database of a merchant and generates the electronic business card by combining an existing business card template, the method cannot ensure the timeliness of the user related data and the accuracy of generating the electronic business card, and meanwhile, the safety of generating the business card through the user related data is not high enough.
Disclosure of Invention
The invention provides a block chain-based intelligent contract business card method, a block chain-based intelligent contract business card device and a computer-readable storage medium, and mainly aims to solve the problem that the safety of business card generation is not high enough.
In order to achieve the above object, the invention provides a block chain-based intelligent contract business card method, which comprises the following steps:
acquiring user basic information and a user block chain account, and activating the user block chain account;
after the user block chain account is activated, indexing mechanism information of a mechanism to which the user block chain account belongs, and respectively writing the user block chain account, a user identifier in the user basic information and a mechanism block chain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card;
generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting personal information in the user basic information by using the encryption key to obtain encrypted information;
calculating a hash value of the personal information based on a preset hash algorithm, and writing the hash value, the encryption key and the encryption information into a content field in the initial business card;
writing the mechanism account number in the mechanism information into an account number field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account number, and writing the encrypted first ciphertext into a ciphertext field corresponding to the account number field;
and encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card.
Optionally, the activating the user blockchain account includes:
inquiring a corresponding user according to the user block chain account, and acquiring a public key corresponding to the user;
and writing the public key and the user block chain account number into an activated account number list on a preset block chain.
Optionally, the calculating the hash value of the personal information based on a preset hash algorithm includes:
judging whether the size of the personal information meets a preset filling requirement or not;
if the size of the personal information meets the filling requirement, adding a value of a first digit at the tail of the personal information to obtain first filling data;
if the size of the personal information does not meet the filling requirement, performing bit filling processing on the personal information to obtain second filling data;
and inputting the first filling data or the second filling data into a preset hash function buffer for data processing to obtain a hash value corresponding to the personal information.
Optionally, after obtaining the user business card, the method further includes:
acquiring an instruction for executing business card operation on the user business card, and analyzing and processing the instruction;
when the analyzed instruction is a name card sharing operation, carrying out name card sharing operation on the user name card according to the user block chain account; or
When the analyzed instruction is used for updating the business card, utilizing the mechanism block chain account to execute business card updating operation on the user business card; or
And when the analyzed instruction is to destroy the business card, setting the state field in the user business card to be destroyed by using the mechanism block chain account.
Optionally, the performing a business card sharing operation on the user business card according to the user blockchain account includes:
acquiring an account of a sharing object, and inquiring a public key corresponding to the account of the sharing object based on an activated account list on the block chain;
searching an encrypted ciphertext corresponding to the user blockchain account in the user business card, and decrypting the encrypted ciphertext by using a private key of the user blockchain account to obtain a decrypted ciphertext;
and writing the account number of the sharing object into an account number field of the user business card, encrypting the decryption ciphertext by using a public key corresponding to the account number of the sharing object, and storing the encrypted decryption ciphertext into a ciphertext field corresponding to the account number field to obtain the sharing business card.
Optionally, the performing a business card update operation on the user business card by using the mechanism blockchain account includes:
carrying out Hash operation on the pre-acquired information to be updated to obtain standard updating information, and writing the standard updating information into a Hash value field of the user business card;
and reading an encryption key in the user business card by using the organization block chain account, encrypting the information to be updated by using the encryption key, writing the encrypted information to be updated into an information field in the user business card, and obtaining the updated business card.
Optionally, the generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm includes:
acquiring a preset generating element, a preset cyclic group and an order corresponding to the cyclic group;
constructing a cycle interval based on the cycle group order, and randomly selecting a random number in the cycle interval;
calculating a discrete number corresponding to the generator according to a preset discrete formula;
and constructing an encryption key according to the discrete number, the generator, the random number and the order, and enabling the random number to be the decryption key.
In order to solve the above problem, the present invention further provides a block chain-based intelligent contract business card device, including:
the account activation module is used for acquiring the basic information of a user and a user block chain account and activating the user block chain account;
a field filling module, configured to index mechanism information of a mechanism to which the user blockchain account belongs after the user blockchain account is subjected to activation processing, and write the user blockchain account, a user identifier in the user basic information, and a mechanism blockchain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card, respectively;
the key generation module is used for generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting personal information in the user basic information by using the encryption key to obtain encrypted information;
the business card creating module is used for calculating a hash value of the personal information based on a preset hash algorithm, writing the hash value, the encryption key and the encryption information into a content field in the initial business card, writing a mechanism account number in the mechanism information into an account number field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account number, writing an encrypted first ciphertext into a ciphertext field corresponding to the account number field, encrypting the decryption key by using a public key corresponding to a user account number in the user basic information, and writing an encrypted second ciphertext and the user account number into the field to obtain the user business card.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the above-described blockchain-based smart contract business card method.
In order to solve the above problem, the present invention also provides a computer-readable storage medium having at least one computer program stored therein, the at least one computer program being executed by a processor in an electronic device to implement the above-mentioned intelligent contract business card method based on a blockchain.
The embodiment of the invention generates an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, encrypts personal information in the user basic information by using the encryption key to obtain encrypted information, encrypts the personal information by using the encryption key and stores data uplink to ensure the safety of key data, encrypts the decryption key by using a public key corresponding to the institution account, writes the encrypted ciphertext into a ciphertext field corresponding to the account field, and ensures that only a holder corresponding to the institution account can view the decryption key, thereby decrypting a plaintext. And encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card. Therefore, the intelligent contract business card method, the intelligent contract business card device, the electronic equipment and the computer-readable storage medium based on the block chain can solve the problem that the safety of business card generation is not high enough.
Drawings
Fig. 1 is a schematic flow chart of a block chain-based intelligent contract business card method according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of a block chain based intelligent contract business card apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for implementing the intelligent contract business card method based on a blockchain according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an intelligent contract business card method based on a block chain. The execution subject of the intelligent contract business card method based on the block chain includes but is not limited to at least one of the electronic devices of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the blockchain-based smart contract business card method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, a schematic flow chart of a method for intelligent contract business cards based on a block chain according to an embodiment of the present invention is shown. In this embodiment, the intelligent contract business card method based on a block chain includes:
and S1, acquiring the basic information of the user and the user block chain account, and activating the user block chain account.
In the embodiment of the present invention, the user basic information may be basic information of a plurality of employees in a certain company, such as employee names, positions, mailboxes, employee job numbers, contact information, and the like. The basic information of the user can be acquired from a third-party database, wherein the third-party database is a database for storing a large amount of user related information, and centralized control and management of data are realized.
Specifically, the activating the user blockchain account includes:
inquiring a corresponding user according to the user block chain account, and acquiring a public key corresponding to the user;
and writing the public key and the user block chain account number into an activated account number list on a preset block chain.
Specifically, a user needs to activate a block chain account of the user, and the activation processing process is to write the block chain account of the user and a corresponding public key into an activation account list on the block chain, where the activation account list includes a plurality of accounts, public keys, and statuses. The block chain comprises a first block chain node, a second block chain node, a third block chain node, an N-1 block chain node and an Nth block chain node, wherein N is a positive integer, and the value of N can be preset. The block chain nodes are connected with each other to form a block cross chain network, and the block chain nodes can transmit information with each other and update synchronously.
And S2, after the user block chain account is activated, indexing mechanism information of a mechanism to which the user block chain account belongs, and writing the user block chain account, a user identifier in the user basic information and a mechanism block chain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card respectively.
In the embodiment of the present invention, after the user block chain account is activated, mechanism information of a mechanism to which the user block chain account belongs is indexed, where the user block chain account is a block chain account of an employee, the mechanism information of the mechanism to which the user block chain account belongs is company information of a company to which the employee is located, and the company information includes, but is not limited to, the mechanism block chain account.
Specifically, the user blockchain account, the user identifier in the user basic information, and the mechanism blockchain account in the mechanism information are respectively written into a plurality of account fields of a pre-constructed initial business card, where the pre-constructed initial business card includes a plurality of preset account fields, for example, an id field, an issuer field, an owner field, a status field, and an info-hash field, an encrypt _ key field, and an info (ciphertext) field inside the content.
For example, the user block chain account is written into an owner field, the organization block chain account is written into an issuer field, the user identification, i.e., the employee work number, in the user basic information is written into an id field, and the status field is set to be activated.
S3, generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting the personal information in the user basic information by using the encryption key to obtain encrypted information.
In the embodiment of the invention, an encryption key and a decryption key corresponding to the encryption key are generated based on a preset encryption algorithm, and the personal information in the user basic information is encrypted by using the encryption key, so that the storage safety of the user basic information is further ensured. The encryption algorithm can be generally divided into a symmetric encryption algorithm and an asymmetric encryption algorithm, wherein the symmetric encryption algorithm refers to that encryption and decryption use the same key, such as a DES encryption algorithm or an AES encryption algorithm. The asymmetric encryption algorithm needs two keys, namely a public key and a private key, the public key and the private key are a pair, and if the public key is used for encrypting data, only the corresponding private key can be used for decrypting the data. The asymmetric encryption algorithm includes but is not limited to RSA algorithm, D-H algorithm, and SM2 algorithm.
In an embodiment of the present invention, the generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm includes:
acquiring a preset generating element, a preset cyclic group and an order corresponding to the cyclic group;
constructing a cycle interval based on the cycle group order, and randomly selecting a random number in the cycle interval;
calculating a discrete number corresponding to the generator according to a preset discrete formula;
and constructing an encryption key according to the discrete number, the generator, the random number and the order, and enabling the random number to be the decryption key.
In detail, in the embodiment of the present invention, the adopted encryption algorithm is an ElGamal encryption algorithm, a preset generator G and a loop group G of q-th order are obtained, a loop interval {1, … …, q-1} is constructed based on the loop group order q, one x is randomly selected from the loop interval as a random number, and the discrete formula h is GxCalculating a discrete number corresponding to the generator, and constructing the discrete number h, the generator g, the random number x and the order q to obtain an encryption key (h, g, x, q), wherein the random number x is the decryption key.
In another embodiment of the present invention, the generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm includes:
randomly acquiring two different prime numbers;
and respectively carrying out asymmetric calculation processing on the prime numbers to obtain an encryption key and a decryption key.
Specifically, the respectively performing asymmetric computation on the prime numbers to obtain an encryption key and a decryption key includes:
for two different prime numbers p and q obtained at random, the product n ═ pq is calculated,
Figure BDA0003443044610000081
Figure BDA0003443044610000082
selecting one to satisfy
Figure BDA0003443044610000083
The integer e is used as an encryption key;
selecting one to satisfy
Figure BDA0003443044610000084
The integer d is used as a decryption key.
In detail, the encryption algorithm adopted in the embodiment of the present invention is an RSA algorithm.
The encrypted information can be decrypted only by using the corresponding decryption key, the existence of the decryption key ensures that data can be decrypted only when the decryption key is obtained, and the data cannot be viewed and decrypted when the decryption key is not obtained.
In detail, the personal information in the user basic information is encrypted by using the encryption key to obtain encrypted information. And the personal information in the user basic information is the name, position, mailbox and the like of the employee.
S4, calculating the hash value of the personal information based on a preset hash algorithm, and writing the hash value, the encryption key and the encryption information into the content field in the initial business card.
In the embodiment of the present invention, the hash algorithm may convert a data into a flag, and the flag has a very close relationship with each byte in the data before conversion. The Hash Algorithm includes an MD4(Message Digest Algorithm 4) Algorithm, a Hash function (Message Digest Algorithm 5) Algorithm, and an SHA-1(Secure Hash Algorithm 1) Algorithm, wherein in the present embodiment, the Hash value of the personal information may be calculated using the Hash function Algorithm. The hash function algorithm, a widely used cryptographic hash function, may produce a 128-bit hash value to ensure that the information is transmitted in a complete and consistent manner.
Specifically, the calculating the hash value of the personal information based on a preset hash algorithm includes:
judging whether the size of the personal information meets a preset filling requirement or not;
if the size of the personal information meets the filling requirement, adding a value of a first digit at the tail of the personal information to obtain first filling data;
if the size of the personal information does not meet the filling requirement, performing bit filling processing on the personal information to obtain second filling data;
and inputting the first filling data or the second filling data into a preset hash function buffer for data processing to obtain a hash value corresponding to the personal information.
In detail, whether the size of the personal information meets the preset filling requirement or not is judged, namely whether the result of the modulo of the size of the personal information by 512 is 448 or not is judged. If the size of the personal information meets the filling requirement, namely the result of modulo 512 by the size of the personal information is 448, adding a 64-bit value at the end of the personal information, wherein the content of the value is the length of the personal information, and if the size of the personal information does not meet the filling requirement, performing bit-filling processing on the personal information, wherein the bit-filling processing refers to filling the spliced character string with one 1bit and then continuously filling a plurality of 0 bits until the filling requirement is met.
Further, a content field in the initial business card includes an info-hash field, an encrypt _ key field, and an info (ciphertext) field, the encryption key is written into the encrypt _ key field, the hash value is written into the info-hash field, and the encryption information is written into the info (ciphertext) field.
S5, writing the mechanism account in the mechanism information into the account field in the initial business card, encrypting the decryption key by using the public key corresponding to the mechanism account, and writing the encrypted first ciphertext into the ciphertext field corresponding to the account field.
In the embodiment of the invention, the initial business card further comprises a holder _ list part, the holder _ list part comprises a plurality of account fields and decryption _ key (ciphertext) fields corresponding to the account fields, the mechanism account number in the mechanism information is written into the account field in the initial business card, that is, the mechanism account number is written into the account field in the holder _ list part, the decryption private key is encrypted by using the public key corresponding to the mechanism account number, and the encrypted first ciphertext is written into the decryption _ key (ciphertext) field corresponding to the account field containing the mechanism account number.
S6, encrypting the decryption key by using the public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card.
In the embodiment of the invention, the user account in the user basic information is written into a field in the initial business card, that is, the employee account is filled into an account field in a holder _ list part, a public key corresponding to the employee account is used for encrypting the decryption private key, and an encrypted second ciphertext is written into a decryption _ key (ciphertext) field corresponding to the account field containing the employee account, so that the user business card is obtained.
Specifically, after obtaining the user business card, the method further comprises:
acquiring an instruction for executing business card operation on the user business card, and analyzing and processing the instruction;
when the analyzed instruction is a name card sharing operation, carrying out name card sharing operation on the user name card according to the user block chain account; or
When the analyzed instruction is used for updating the business card, utilizing the mechanism block chain account to execute business card updating operation on the user business card; or
And when the analyzed instruction is to destroy the business card, setting the state field in the user business card to be destroyed by using the mechanism block chain account.
Further, the performing a business card sharing operation on the user business card according to the user blockchain account includes:
acquiring an account of a sharing object, and inquiring a public key corresponding to the account of the sharing object based on an activated account list on the block chain;
searching an encrypted ciphertext corresponding to the user blockchain account in the user business card, and decrypting the encrypted ciphertext by using a private key of the user blockchain account to obtain a decrypted ciphertext;
and writing the account number of the sharing object into an account number field of the user business card, encrypting the decryption ciphertext by using a public key corresponding to the account number of the sharing object, and storing the encrypted decryption ciphertext into a ciphertext field corresponding to the account number field to obtain the sharing business card.
In detail, firstly, an account of a sharing object is obtained, the account of the sharing object is searched in the activated account list and is set as pubkeyX, an encrypted ciphertext corresponding to the user block chain account is searched in the user business card, namely, the corresponding encrypted ciphertext is read from a holder _ list part of the user business card, the encrypted ciphertext is decrypted by using a private key of an owner field storing the user block chain account, the decrypted result is set as deccryptX, the account of the sharing object is filled in an account field in the holder _ list part, the deccryptX is encrypted by using pubkeyX, and the encrypted ciphertext is filled in a deccrypt _ key field corresponding to the holder _ list.
Specifically, the performing a business card update operation on the user business card by using the mechanism blockchain account includes:
carrying out Hash operation on the pre-acquired information to be updated to obtain standard updating information, and writing the standard updating information into a Hash value field of the user business card;
and reading an encryption key in the user business card by using the organization block chain account, encrypting the information to be updated by using the encryption key, writing the encrypted information to be updated into an information field in the user business card, and obtaining the updated business card.
Since the information on the user business card may be outdated information, for example, the mobile phone number, the employment company and the position may be outdated due to changes in real life, in order to ensure the accuracy of the business card, the business card of the user needs to be updated. Usually, when receiving a command for updating the user name card, the user name card is updated.
In detail, only the mechanism block chain account, namely the Issuer account, can update the business card content, namely only the company can update the business card content of the staff, the staff cannot update the business card of the staff, the Issuer account performs hash operation on information to be updated, the result of the hash operation is written into an info _ hash field of the content, the Issuer account reads an encrypt _ key field of the content and is used for encrypting the information to be updated, the encrypt _ key is used for encrypting the information to be updated, and then the encrypted information to be updated is written into the info field.
Further, when the analyzed instruction is to destroy the business card, the status field in the user business card is set to be destroyed by using the mechanism block chain account. The business card can be destroyed by some and only the issuer account number, namely, only the company can destroy the business card of the employee, and the employee cannot destroy the business card of the employee.
The embodiment of the invention generates an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, encrypts personal information in the user basic information by using the encryption key to obtain encrypted information, encrypts the personal information by using the encryption key and stores data uplink to ensure the safety of key data, encrypts the decryption key by using a public key corresponding to the institution account, writes the encrypted ciphertext into a ciphertext field corresponding to the account field, and ensures that only a holder corresponding to the institution account can view the decryption key, thereby decrypting a plaintext. And encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card. Therefore, the intelligent contract business card method based on the block chain can solve the problem that the safety of business card generation is not high enough.
The embodiment of the invention generates an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, encrypts personal information in the user basic information by using the encryption key to obtain encrypted information, encrypts the personal information by using the encryption key and stores data uplink to ensure the safety of key data, encrypts the decryption key by using a public key corresponding to the institution account, writes the encrypted ciphertext into a ciphertext field corresponding to the account field, and ensures that only a holder corresponding to the institution account can view the decryption key, thereby decrypting a plaintext. And encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card. Therefore, the intelligent contract business card method based on the block chain can solve the problem that the safety of business card generation is not high enough.
Fig. 2 is a functional block diagram of a smart contract business card apparatus based on a block chain according to an embodiment of the present invention.
The intelligent contract business card device 100 based on the block chain can be installed in electronic equipment. According to the implemented functions, the intelligent contract business card device 100 based on the block chain can comprise an account number activation module 101, a field filling module 102, a key generation module 103 and a business card creation module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the account activation module 101 is configured to acquire user basic information and a user blockchain account, and activate the user blockchain account;
the field filling module 102 is configured to index mechanism information of a mechanism to which the user blockchain account belongs after the user blockchain account is activated, and write the user blockchain account, a user identifier in the user basic information, and a mechanism blockchain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card, respectively;
the key generation module 103 is configured to generate an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypt personal information in the user basic information by using the encryption key to obtain encrypted information;
the business card creating module 104 is configured to calculate a hash value of the personal information based on a preset hash algorithm, write the hash value, the encryption key, and the encryption information into a content field in the initial business card, write a mechanism account in the mechanism information into an account field in the initial business card, encrypt the decryption key using a public key corresponding to the mechanism account, write an encrypted first ciphertext into a ciphertext field corresponding to the account field, encrypt the decryption key using a public key corresponding to a user account in the user basic information, and write an encrypted second ciphertext and the user account into the field to obtain the user business card.
In detail, the specific implementation of each module of the intelligent contract business card device 100 based on the block chain is as follows:
step one, acquiring basic information of a user and a user block chain account, and activating the user block chain account.
In the embodiment of the present invention, the user basic information may be basic information of a plurality of employees in a certain company, such as employee names, positions, mailboxes, employee job numbers, contact information, and the like. The basic information of the user can be acquired from a third-party database, wherein the third-party database is a database for storing a large amount of user related information, and centralized control and management of data are realized.
Specifically, the activating the user blockchain account includes:
inquiring a corresponding user according to the user block chain account, and acquiring a public key corresponding to the user;
and writing the public key and the user block chain account number into an activated account number list on a preset block chain.
Specifically, a user needs to activate a block chain account of the user, and the activation processing process is to write the block chain account of the user and a corresponding public key into an activation account list on the block chain, where the activation account list includes a plurality of accounts, public keys, and statuses. The block chain comprises a first block chain node, a second block chain node, a third block chain node, an N-1 block chain node and an Nth block chain node, wherein N is a positive integer, and the value of N can be preset. The block chain nodes are connected with each other to form a block cross chain network, and the block chain nodes can transmit information with each other and update synchronously.
And secondly, after the user block chain account is activated, indexing mechanism information of a mechanism to which the user block chain account belongs, and writing the user block chain account, a user identifier in the user basic information and a mechanism block chain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card respectively.
In the embodiment of the present invention, after the user block chain account is activated, mechanism information of a mechanism to which the user block chain account belongs is indexed, where the user block chain account is a block chain account of an employee, the mechanism information of the mechanism to which the user block chain account belongs is company information of a company to which the employee is located, and the company information includes, but is not limited to, the mechanism block chain account.
Specifically, the user blockchain account, the user identifier in the user basic information, and the mechanism blockchain account in the mechanism information are respectively written into a plurality of account fields of a pre-constructed initial business card, where the pre-constructed initial business card includes a plurality of preset account fields, for example, an id field, an issuer field, an owner field, a status field, and an info-hash field, an encrypt _ key field, and an info (ciphertext) field inside the content.
For example, the user block chain account is written into an owner field, the organization block chain account is written into an issuer field, the user identification, i.e., the employee work number, in the user basic information is written into an id field, and the status field is set to be activated.
And thirdly, generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting the personal information in the user basic information by using the encryption key to obtain encrypted information.
In the embodiment of the invention, an encryption key and a decryption key corresponding to the encryption key are generated based on a preset encryption algorithm, and the personal information in the user basic information is encrypted by using the encryption key, so that the storage safety of the user basic information is further ensured. The encryption algorithm can be generally divided into a symmetric encryption algorithm and an asymmetric encryption algorithm, wherein the symmetric encryption algorithm refers to that encryption and decryption use the same key, such as a DES encryption algorithm or an AES encryption algorithm. The asymmetric encryption algorithm needs two keys, namely a public key and a private key, the public key and the private key are a pair, and if the public key is used for encrypting data, only the corresponding private key can be used for decrypting the data. The asymmetric encryption algorithm includes but is not limited to RSA algorithm, D-H algorithm, and SM2 algorithm.
In an embodiment of the present invention, the generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm includes:
acquiring a preset generating element, a preset cyclic group and an order corresponding to the cyclic group;
constructing a cycle interval based on the cycle group order, and randomly selecting a random number in the cycle interval;
calculating a discrete number corresponding to the generator according to a preset discrete formula;
and constructing an encryption key according to the discrete number, the generator, the random number and the order, and enabling the random number to be the decryption key.
In detail, in the embodiments of the present inventionThe adopted encryption algorithm is an ElGamal encryption algorithm, a preset generator G and a q-order cyclic group G are obtained, a cyclic interval {1, … …, q-1} is constructed based on the cyclic group order q, an x is randomly selected from the cyclic interval as a random number, and the discrete formula h is GxCalculating a discrete number corresponding to the generator, and constructing the discrete number h, the generator g, the random number x and the order q to obtain an encryption key (h, g, x, q), wherein the random number x is the decryption key.
In another embodiment of the present invention, the generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm includes:
randomly acquiring two different prime numbers;
and respectively carrying out asymmetric calculation processing on the prime numbers to obtain an encryption key and a decryption key.
Specifically, the respectively performing asymmetric computation on the prime numbers to obtain an encryption key and a decryption key includes:
for two different prime numbers p and q obtained at random, the product n ═ pq is calculated,
Figure BDA0003443044610000151
Figure BDA0003443044610000152
selecting one to satisfy
Figure BDA0003443044610000153
The integer e is used as an encryption key;
selecting one to satisfy
Figure BDA0003443044610000154
The integer d is used as a decryption key.
In detail, the encryption algorithm adopted in the embodiment of the present invention is an RSA algorithm.
The encrypted information can be decrypted only by using the corresponding decryption key, the existence of the decryption key ensures that data can be decrypted only when the decryption key is obtained, and the data cannot be viewed and decrypted when the decryption key is not obtained.
In detail, the personal information in the user basic information is encrypted by using the encryption key to obtain encrypted information. And the personal information in the user basic information is the name, position, mailbox and the like of the employee.
And fourthly, calculating a hash value of the personal information based on a preset hash algorithm, and writing the hash value, the encryption key and the encryption information into a content field in the initial business card.
In the embodiment of the present invention, the hash algorithm may convert a data into a flag, and the flag has a very close relationship with each byte in the data before conversion. The Hash Algorithm includes an MD4(Message Digest Algorithm 4) Algorithm, a Hash function (Message Digest Algorithm 5) Algorithm, and an SHA-1(Secure Hash Algorithm 1) Algorithm, wherein in the present embodiment, the Hash value of the personal information may be calculated using the Hash function Algorithm. The hash function algorithm, a widely used cryptographic hash function, may produce a 128-bit hash value to ensure that the information is transmitted in a complete and consistent manner.
Specifically, the calculating the hash value of the personal information based on a preset hash algorithm includes:
judging whether the size of the personal information meets a preset filling requirement or not;
if the size of the personal information meets the filling requirement, adding a value of a first digit at the tail of the personal information to obtain first filling data;
if the size of the personal information does not meet the filling requirement, performing bit filling processing on the personal information to obtain second filling data;
and inputting the first filling data or the second filling data into a preset hash function buffer for data processing to obtain a hash value corresponding to the personal information.
In detail, whether the size of the personal information meets the preset filling requirement or not is judged, namely whether the result of the modulo of the size of the personal information by 512 is 448 or not is judged. If the size of the personal information meets the filling requirement, namely the result of modulo 512 by the size of the personal information is 448, adding a 64-bit value at the end of the personal information, wherein the content of the value is the length of the personal information, and if the size of the personal information does not meet the filling requirement, performing bit-filling processing on the personal information, wherein the bit-filling processing refers to filling the spliced character string with one 1bit and then continuously filling a plurality of 0 bits until the filling requirement is met.
Further, a content field in the initial business card includes an info-hash field, an encrypt _ key field, and an info (ciphertext) field, the encryption key is written into the encrypt _ key field, the hash value is written into the info-hash field, and the encryption information is written into the info (ciphertext) field.
And fifthly, writing the mechanism account in the mechanism information into an account field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account, and writing the encrypted first ciphertext into a ciphertext field corresponding to the account field.
In the embodiment of the invention, the initial business card further comprises a holder _ list part, the holder _ list part comprises a plurality of account fields and decryption _ key (ciphertext) fields corresponding to the account fields, the mechanism account number in the mechanism information is written into the account field in the initial business card, that is, the mechanism account number is written into the account field in the holder _ list part, the decryption private key is encrypted by using the public key corresponding to the mechanism account number, and the encrypted first ciphertext is written into the decryption _ key (ciphertext) field corresponding to the account field containing the mechanism account number.
And step six, encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card.
In the embodiment of the invention, the user account in the user basic information is written into a field in the initial business card, that is, the employee account is filled into an account field in a holder _ list part, a public key corresponding to the employee account is used for encrypting the decryption private key, and an encrypted second ciphertext is written into a decryption _ key (ciphertext) field corresponding to the account field containing the employee account, so that the user business card is obtained.
Specifically, after obtaining the user business card, the method further comprises:
acquiring an instruction for executing business card operation on the user business card, and analyzing and processing the instruction;
when the analyzed instruction is a name card sharing operation, carrying out name card sharing operation on the user name card according to the user block chain account; or
When the analyzed instruction is used for updating the business card, utilizing the mechanism block chain account to execute business card updating operation on the user business card; or
And when the analyzed instruction is to destroy the business card, setting the state field in the user business card to be destroyed by using the mechanism block chain account.
Further, the performing a business card sharing operation on the user business card according to the user blockchain account includes:
acquiring an account of a sharing object, and inquiring a public key corresponding to the account of the sharing object based on an activated account list on the block chain;
searching an encrypted ciphertext corresponding to the user blockchain account in the user business card, and decrypting the encrypted ciphertext by using a private key of the user blockchain account to obtain a decrypted ciphertext;
and writing the account number of the sharing object into an account number field of the user business card, encrypting the decryption ciphertext by using a public key corresponding to the account number of the sharing object, and storing the encrypted decryption ciphertext into a ciphertext field corresponding to the account number field to obtain the sharing business card.
In detail, firstly, an account of a sharing object is obtained, the account of the sharing object is searched in the activated account list and is set as pubkeyX, an encrypted ciphertext corresponding to the user block chain account is searched in the user business card, namely, the corresponding encrypted ciphertext is read from a holder _ list part of the user business card, the encrypted ciphertext is decrypted by using a private key of an owner field storing the user block chain account, the decrypted result is set as deccryptX, the account of the sharing object is filled in an account field in the holder _ list part, the deccryptX is encrypted by using pubkeyX, and the encrypted ciphertext is filled in a deccrypt _ key field corresponding to the holder _ list.
Specifically, the performing a business card update operation on the user business card by using the mechanism blockchain account includes:
carrying out Hash operation on the pre-acquired information to be updated to obtain standard updating information, and writing the standard updating information into a Hash value field of the user business card;
and reading an encryption key in the user business card by using the organization block chain account, encrypting the information to be updated by using the encryption key, writing the encrypted information to be updated into an information field in the user business card, and obtaining the updated business card.
Since the information on the user business card may be outdated information, for example, the mobile phone number, the employment company and the position may be outdated due to changes in real life, in order to ensure the accuracy of the business card, the business card of the user needs to be updated. Usually, when receiving a command for updating the user name card, the user name card is updated.
In detail, only the mechanism block chain account, namely the Issuer account, can update the business card content, namely only the company can update the business card content of the staff, the staff cannot update the business card of the staff, the Issuer account performs hash operation on information to be updated, the result of the hash operation is written into an info _ hash field of the content, the Issuer account reads an encrypt _ key field of the content and is used for encrypting the information to be updated, the encrypt _ key is used for encrypting the information to be updated, and then the encrypted information to be updated is written into the info field.
Further, when the analyzed instruction is to destroy the business card, the status field in the user business card is set to be destroyed by using the mechanism block chain account. The business card can be destroyed by some and only the issuer account number, namely, only the company can destroy the business card of the employee, and the employee cannot destroy the business card of the employee.
The embodiment of the invention generates an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, encrypts personal information in the user basic information by using the encryption key to obtain encrypted information, encrypts the personal information by using the encryption key and stores data uplink to ensure the safety of key data, encrypts the decryption key by using a public key corresponding to the institution account, writes the encrypted ciphertext into a ciphertext field corresponding to the account field, and ensures that only a holder corresponding to the institution account can view the decryption key, thereby decrypting a plaintext. And encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card. Therefore, the intelligent contract business card device based on the block chain can solve the problem that the safety of business card generation is not high enough.
Fig. 3 is a schematic structural diagram of an electronic device implementing a smart contract business card method based on a blockchain according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program, such as a smart contract business card program based on a blockchain, stored in the memory 11 and operable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (for example, executing a block chain-based smart contract business card program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as code of a smart contract business card program based on a block chain, etc., but also to temporarily store data that has been output or will be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The intelligent contract business card program based on block chain stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when run in the processor 10, can realize:
acquiring user basic information and a user block chain account, and activating the user block chain account;
after the user block chain account is activated, indexing mechanism information of a mechanism to which the user block chain account belongs, and respectively writing the user block chain account, a user identifier in the user basic information and a mechanism block chain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card;
generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting personal information in the user basic information by using the encryption key to obtain encrypted information;
calculating a hash value of the personal information based on a preset hash algorithm, and writing the hash value, the encryption key and the encryption information into a content field in the initial business card;
writing the mechanism account number in the mechanism information into an account number field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account number, and writing the encrypted first ciphertext into a ciphertext field corresponding to the account number field;
and encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring user basic information and a user block chain account, and activating the user block chain account;
after the user block chain account is activated, indexing mechanism information of a mechanism to which the user block chain account belongs, and respectively writing the user block chain account, a user identifier in the user basic information and a mechanism block chain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card;
generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting personal information in the user basic information by using the encryption key to obtain encrypted information;
calculating a hash value of the personal information based on a preset hash algorithm, and writing the hash value, the encryption key and the encryption information into a content field in the initial business card;
writing the mechanism account number in the mechanism information into an account number field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account number, and writing the encrypted first ciphertext into a ciphertext field corresponding to the account number field;
and encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A block chain-based intelligent contract business card method is characterized by comprising the following steps:
acquiring user basic information and a user block chain account, and activating the user block chain account;
after the user block chain account is activated, indexing mechanism information of a mechanism to which the user block chain account belongs, and respectively writing the user block chain account, a user identifier in the user basic information and a mechanism block chain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card;
generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting personal information in the user basic information by using the encryption key to obtain encrypted information;
calculating a hash value of the personal information based on a preset hash algorithm, and writing the hash value, the encryption key and the encryption information into a content field in the initial business card;
writing the mechanism account number in the mechanism information into an account number field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account number, and writing the encrypted first ciphertext into a ciphertext field corresponding to the account number field;
and encrypting the decryption key by using a public key corresponding to the user account in the user basic information, and writing the encrypted second ciphertext and the user account into a field to obtain the user business card.
2. The blockchain-based smart contract business card method of claim 1, wherein the activating the user blockchain account number comprises:
inquiring a corresponding user according to the user block chain account, and acquiring a public key corresponding to the user;
and writing the public key and the user block chain account number into an activated account number list on a preset block chain.
3. A blockchain-based smart contract business card method as set forth in claim 1, wherein the calculating of the hash value of the personal information based on a preset hash algorithm includes:
judging whether the size of the personal information meets a preset filling requirement or not;
if the size of the personal information meets the filling requirement, adding a value of a first digit at the tail of the personal information to obtain first filling data;
if the size of the personal information does not meet the filling requirement, performing bit filling processing on the personal information to obtain second filling data;
and inputting the first filling data or the second filling data into a preset hash function buffer for data processing to obtain a hash value corresponding to the personal information.
4. A block chain based smart contract business card method in accordance with claim 1, wherein after obtaining a user business card, said method further comprises:
acquiring an instruction for executing business card operation on the user business card, and analyzing and processing the instruction;
when the analyzed instruction is a name card sharing operation, carrying out name card sharing operation on the user name card according to the user block chain account; or
When the analyzed instruction is used for updating the business card, utilizing the mechanism block chain account to execute business card updating operation on the user business card; or
And when the analyzed instruction is to destroy the business card, setting the state field in the user business card to be destroyed by using the mechanism block chain account.
5. The method for intelligent contract business cards based on block chains as claimed in claim 4, wherein the business card sharing operation performed on the user business card according to the user block chain account number comprises:
acquiring an account of a sharing object, and inquiring a public key corresponding to the account of the sharing object based on an activated account list on the block chain;
searching an encrypted ciphertext corresponding to the user blockchain account in the user business card, and decrypting the encrypted ciphertext by using a private key of the user blockchain account to obtain a decrypted ciphertext;
and writing the account number of the sharing object into an account number field of the user business card, encrypting the decryption ciphertext by using a public key corresponding to the account number of the sharing object, and storing the encrypted decryption ciphertext into a ciphertext field corresponding to the account number field to obtain the sharing business card.
6. The blockchain-based smart contract business card method of claim 4, wherein performing a business card update operation on the user business card using the organizational blockchain account number comprises:
carrying out Hash operation on the pre-acquired information to be updated to obtain standard updating information, and writing the standard updating information into a Hash value field of the user business card;
and reading an encryption key in the user business card by using the organization block chain account, encrypting the information to be updated by using the encryption key, writing the encrypted information to be updated into an information field in the user business card, and obtaining the updated business card.
7. The blockchain-based smart contract business card method according to claim 1, wherein the generating of the encryption key and the decryption key corresponding to the encryption key based on the preset encryption algorithm includes:
acquiring a preset generating element, a preset cyclic group and an order corresponding to the cyclic group;
constructing a cycle interval based on the cycle group order, and randomly selecting a random number in the cycle interval;
calculating a discrete number corresponding to the generator according to a preset discrete formula;
and constructing an encryption key according to the discrete number, the generator, the random number and the order, and enabling the random number to be the decryption key.
8. An intelligent contract business card apparatus based on a blockchain, the apparatus comprising:
the account activation module is used for acquiring the basic information of a user and a user block chain account and activating the user block chain account;
a field filling module, configured to index mechanism information of a mechanism to which the user blockchain account belongs after the user blockchain account is subjected to activation processing, and write the user blockchain account, a user identifier in the user basic information, and a mechanism blockchain account in the mechanism information into a plurality of account fields of a pre-constructed initial business card, respectively;
the key generation module is used for generating an encryption key and a decryption key corresponding to the encryption key based on a preset encryption algorithm, and encrypting personal information in the user basic information by using the encryption key to obtain encrypted information;
the business card creating module is used for calculating a hash value of the personal information based on a preset hash algorithm, writing the hash value, the encryption key and the encryption information into a content field in the initial business card, writing a mechanism account number in the mechanism information into an account number field in the initial business card, encrypting the decryption key by using a public key corresponding to the mechanism account number, writing an encrypted first ciphertext into a ciphertext field corresponding to the account number field, encrypting the decryption key by using a public key corresponding to a user account number in the user basic information, and writing an encrypted second ciphertext and the user account number into the field to obtain the user business card.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the blockchain based smart contract business card method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the blockchain-based smart contract business card method of any one of claims 1 to 7.
CN202111639480.2A 2021-12-29 2021-12-29 Intelligent contract business card method, device, equipment and storage medium based on block chain Pending CN114417374A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111639480.2A CN114417374A (en) 2021-12-29 2021-12-29 Intelligent contract business card method, device, equipment and storage medium based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111639480.2A CN114417374A (en) 2021-12-29 2021-12-29 Intelligent contract business card method, device, equipment and storage medium based on block chain

Publications (1)

Publication Number Publication Date
CN114417374A true CN114417374A (en) 2022-04-29

Family

ID=81269710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111639480.2A Pending CN114417374A (en) 2021-12-29 2021-12-29 Intelligent contract business card method, device, equipment and storage medium based on block chain

Country Status (1)

Country Link
CN (1) CN114417374A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074115A (en) * 2023-03-06 2023-05-05 广州市悦智计算机有限公司 Method for realizing cross-chain encryption session based on intelligent contract
CN117097476A (en) * 2023-10-19 2023-11-21 浪潮云洲工业互联网有限公司 Data processing method, equipment and medium based on industrial Internet

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116074115A (en) * 2023-03-06 2023-05-05 广州市悦智计算机有限公司 Method for realizing cross-chain encryption session based on intelligent contract
CN116074115B (en) * 2023-03-06 2023-06-23 广州市悦智计算机有限公司 Method for realizing cross-chain encryption session based on intelligent contract
CN117097476A (en) * 2023-10-19 2023-11-21 浪潮云洲工业互联网有限公司 Data processing method, equipment and medium based on industrial Internet
CN117097476B (en) * 2023-10-19 2024-01-26 浪潮云洲工业互联网有限公司 Data processing method, equipment and medium based on industrial Internet

Similar Documents

Publication Publication Date Title
CN113112252B (en) Resource transfer method and device based on block chain, electronic equipment and storage medium
CN114417374A (en) Intelligent contract business card method, device, equipment and storage medium based on block chain
CN112732297B (en) Method and device for updating federal learning model, electronic equipment and storage medium
CN114124502B (en) Message transmission method, device, equipment and medium
CN112394974A (en) Code change comment generation method and device, electronic equipment and storage medium
CN114389889B (en) File full life cycle management method and device based on block chain technology
CN112217642A (en) Data encryption sharing method and device, electronic equipment and computer storage medium
CN114625976B (en) Data recommendation method, device, equipment and medium based on federal learning
CN115048664A (en) Data security storage method, device, equipment and medium based on solid state disk
CN111612458A (en) Method and device for processing block chain data and readable storage medium
CN113420049A (en) Data circulation method and device, electronic equipment and storage medium
CN111695097A (en) Login checking method and device and computer readable storage medium
CN115374150A (en) Character string data query method and device, electronic equipment and storage medium
CN115840787A (en) Supply chain data sharing method, device, equipment and medium based on block chain
CN112217639B (en) Data encryption sharing method and device, electronic equipment and computer storage medium
CN113162763A (en) Data encryption and storage method and device, electronic equipment and storage medium
CN114629663B (en) Block chain-based digital commodity transaction method and device
CN115643090A (en) Longitudinal federal analysis method, device, equipment and medium based on privacy retrieval
CN113918517A (en) Multi-type file centralized management method, device, equipment and storage medium
CN112540839A (en) Information changing method, device, electronic equipment and storage medium
CN111611601A (en) Multi-data-party user analysis model joint training method and device and storage medium
CN112446765A (en) Product recommendation method and device, electronic equipment and computer-readable storage medium
CN112182598A (en) Public sample ID identification method, device, server and readable storage medium
CN115311061B (en) Electronic transaction management method, device, equipment and storage medium based on digital authentication
CN114785860B (en) Encryption and decryption-based data response method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination