Automobile sharing method based on privacy protection of block chain
By adopting a combination technology of homomorphic encryption, hash function and digital signature algorithms in the field of car sharing, the problem of privacy protection of multiple blockchain administrator nodes and data is solved, and the identity anonymity and data privacy of users and vehicles are effectively protected.
Patent Information
- Application Number
- CN202510326710.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-20
AI Technical Summary
The prior art relies on multiple blockchain administrator nodes in the field of automotive sharing, and fails to ensure data privacy through multi-party security calculations, and cannot effectively protect users' sensitive information.
The homomorphic encryption algorithm is used to encrypt private information, generate pseudonyms for users and vehicles through hash functions, realize identity anonymity, and use digital signature algorithms to authenticate to ensure data integrity and privacy.
It realizes the protection of the identity anonymity and data privacy of users and vehicles, ensures the security and privacy of information, and enables car sharing services to be carried out efficiently and safely.
Smart Images

Figure CN120185789A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sharing economy and blockchain privacy protection, and particularly to a method for sharing cars. Background Art
[0002] With the booming development of the sharing economy, especially in the field of urban transportation, the car-sharing model has become a new type of travel mode. As an innovative starting point, shared cars provide convenient travel options for urban residents. However, the subsequent security and identity management issues have urgently emerged. In the process of using shared cars, how to ensure the safety of vehicles, the authenticity of users' identities, and the credibility of transactions has become an urgent problem to be solved. Traditional identity authentication methods, such as authentication based on user names, passwords, or identity cards, have disadvantages such as poor security, easy to be tampered with or stolen. In the scenario of shared cars, the user identity verification not only needs to consider the accuracy of identity, but also needs to ensure the privacy of data and protect the sensitive information of users. Therefore, how to efficiently design a secure and efficient identity authentication and management method has become an important challenge for shared car service platforms and vehicle providers.
[0003] Blockchain technology has the characteristics of decentralization, immutability, and transparency and credibility, and has been widely applied in various industries. Blockchain uses encryption algorithms to ensure the security of data, can effectively prevent data from being tampered with and is transparent and credible, solving the forgery problem; the authentication system based on blockchain can provide a more secure and reliable solution for the identity verification of shared cars, avoiding single-point failures and information leakage problems in the centralized authentication system. Although some blockchain-based identity authentication methods have been applied in different fields, in the field of shared cars, there are still some deficiencies in the existing technologies. The invention patent with the publication number CN112039870B discloses a vehicle-mounted network authentication method and system for privacy protection based on blockchain. This patent realizes the anonymity of user identities through hash algorithms and secure multi-party computing, and at the same time ensures that user identities are traceable. However, this patent requires multiple online blockchain administrator nodes to participate in the distributed decryption session and lacks the privacy protection of users' off-chain sensitive data. Summary of the Invention
[0004] In view of the technical problems that existing solutions rely on multiple blockchain administrator nodes and fail to ensure data privacy through multi-party secure computing, the present invention proposes a blockchain-based privacy protection method for car sharing. The present invention uses a homomorphic encryption algorithm to encrypt privacy information, ensuring the secure transmission of off-chain data; generates pseudonyms for users and vehicles participating in the car sharing scheme through a hash function, achieving identity anonymity; and uses a digital signature algorithm for identity verification, ensuring the correctness of user identities and the integrity of data. The method of the present invention can ensure the security and privacy of information, enabling the participants in the sharing economy to interact efficiently and securely.
[0005] To achieve the above object, the technical solution of the present invention is implemented as follows:
[0006] A blockchain-based privacy protection method for car sharing, comprising the steps of:
[0007] S1: Set up a blockchain network and deploy a smart contract in the blockchain network;
[0008] S2: Initialize the service platform based on the elliptic curve algorithm and generate a Paillier public key PK and a Paillier private key SK using the Paillier algorithm;
[0009] S3: Initialize the vehicle user and the vehicle provider respectively based on the elliptic curve algorithm and the hash function;
[0010] S4: When sharing is needed, the vehicle user encrypts and transmits the rental duration based on the Paillier public key PK, the service platform authenticates the vehicle user, uploads the encrypted transmission information after authentication to the blockchain for storage and calculates the encrypted car sharing cost;
[0011] S5: The service platform generates an encrypted contract based on the encrypted car sharing cost, the vehicle user and the vehicle provider decrypt the encrypted contract and confirm the contract respectively and send confirmation information to the service platform respectively;
[0012] S6: The service platform decrypts the confirmation information, completes the transfer of the right of use by executing the smart contract, records the transaction status using the blockchain, and ends the car sharing service after the usage time expires or the vehicle user returns the vehicle.
[0013] The method for initializing the service platform is as follows:
[0014] S2.1: The service platform executes the elliptic curve algorithm: Select a cyclic additive group of prime order r defined on a non-singular elliptic curve E in the finite field F q and select a generator P; in the finite field F and select a generator P; in the finite field F qRandomly select an integer SK within it AS As the private key of the service platform, and calculate the public key PK of the service platform through scalar multiplication AS = P·SK AS ;
[0015] S2.2. The service platform selects a hash function:
[0016]
[0017] h1 represents mapping a binary string of any length to the set of non-zero residue classes modulo r;
[0018] h2: {0,1} * →{0,1} k ;
[0019] h2 represents mapping a binary string of any length to a binary string of a fixed length k.
[0020] The method for generating the Paillier public key PK and the Paillier private key SK using the Paillier algorithm is as follows:
[0021] S2.3. The service platform selects two large prime numbers p and d with the same number of binary digits in the finite field F q ; Calculate the modulus n = p×d, and the modulus n is used as the first parameter of the Paillier public key PK; Calculate the Carmichael function value λ = lcm(p - 1, d - 1) through the Carmichael function, where lcm(·) represents the least common multiple function, and the Carmichael function value λ is used as the first parameter of the Paillier private key SK;
[0022] S2.4. The service platform selects an integer such that the integer g is relatively prime to n 2 and the order of the integer g is a multiple of the modulus n, and the integer g is used as the second parameter of the Paillier public key PK;
[0023] is the multiplicative group modulo n 2 ;
[0024] S2.5. The service platform calculates the modular inverse μ = (L(g λ mod n 2 )) -1 mod n, where the auxiliary function mod represents the modular operation, and the modular inverse μ is used as the second parameter of the Paillier private key SK;
[0025] S2.6. Finally, generate the Paillier public key PK: (n, g) and the Paillier private key SK: (λ, μ); the Paillier public key PK serves as the encryption key and operation key for homomorphic encryption; the Paillier private key SK is used for decryption.
[0026] The method for initializing the vehicle user is as follows:
[0027] S3.1. The vehicle user generates the vehicle user public key PK VD and the vehicle user private key SK VD based on the elliptic curve algorithm and the hash function h1; the vehicle user generates the vehicle user pseudonym DID VD using the Keccak-256 hash function through the public key PK VD ;
[0028] The method for initializing the vehicle provider is as follows:
[0029] S3.2. The vehicle provider generates the vehicle provider public key PK VP and the vehicle provider private key SK VP based on the elliptic curve algorithm and the hash function h1; the vehicle provider generates the vehicle provider pseudonym DID VP using the Keccak-256 hash function through the vehicle provider public key PK VP ; the vehicle provider generates the vehicle pseudonym CID for the vehicle identification number VIN using the hash function h2 j , and the vehicle provider encrypts and transmits the vehicle provider's identity, the pseudonym CID j of the available vehicles, and the rent based on the Paillier public key PK; the service platform performs identity authentication using the vehicle provider public key PK VP and stores the encrypted transmission information in the blockchain.
[0030] The implementation method of step S3.1 is as follows: Based on the elliptic curve algorithm, the vehicle user selects a random number s in the finite field F q , calculates the parameter R = s·P according to the generator P, and generates the vehicle user private key SK i using the hash function h1 according to the vehicle user's real identity information ID VD = h1(ID i ||R), where || represents the string concatenation operation; calculates the vehicle user public key PK VD = SK VD ·P according to the scalar multiplication; the vehicle user public key PK VDInput the Keccak-256 hash function, calculate the blockchain external account address of the vehicle user represented by the hash value, and intercept some bytes of the blockchain external account address of the vehicle user as the vehicle user pseudonym DID VD .
[0031] The method for the vehicle provider described in step S3.2 to generate a vehicle pseudonym CID for the vehicle identification number VIN using the hash function h2 j is as follows: The vehicle provider concatenates the vehicle identification number with the current timestamp T1 and uses the hash function h2 to generate a vehicle pseudonym CID for the selectable vehicle j = h2(VIN||T1);
[0032] The method for the vehicle provider described in step S3.2 to encrypt and transmit the vehicle provider identity, the vehicle pseudonym CID of the selectable vehicle j and the rent based on the Paillier public key PK is as follows: The vehicle provider concatenates the vehicle pseudonym CID of the selectable vehicle j and the vehicle provider pseudonym DID VP and then encrypts them using the vehicle provider private key SK VP to obtain the encrypted identification information The vehicle provider uses a cryptographically secure random number generator to select a random number Ω within the finite field F q and uses the Paillier public key PK to encrypt the random number Ω and the rent y respectively to obtain the encrypted rent E PK (y) and the encrypted random number E PK (Ω). The encrypted identification information E SKVP (CID j ||DID VP ), the encrypted rent E PK (y) and the encrypted random number E PK (Ω) are combined into a string {E SKVP (CID j ||DID VP ),E PK (y),E PK (Ω)} and sent to the service platform, where E * represents the encryption operation.
[0033] The method for the vehicle user described in step S4 to encrypt and transmit the rental duration based on the Paillier public key PK is as follows: The vehicle user uses a cryptographically secure random number generator to select a random number δ within the finite field F q and uses the vehicle user private key SK VD to digitally sign the vehicle user pseudonym DID VD to obtain the vehicle user digital signature sig(DIDVD ) and use the Paillier public key PK to encrypt the random number δ and the rental duration t respectively to obtain the encrypted random number E PK (δ) and the encrypted rental duration E PK (t), obtain the pseudonym CID of the vehicle applied for use from the blockchain s , and form a string {sig(DID VD ) of the vehicle user's digital signature, the pseudonym CID of the vehicle applied for use s , the encrypted random number E PK (δ) and the encrypted rental duration E PK (t) and send it to the service platform; VD ), CID s , E PK (t), E PK (δ)}
[0034] The method for the service platform to authenticate the vehicle user, upload the encrypted transmission information after authentication to the blockchain for storage and calculate the encrypted car sharing cost is as follows:
[0035] The service platform uses the vehicle user's public key PK VD , authenticate the vehicle user's digital signature sig(DID VD ), after successful authentication, upload the vehicle user's pseudonym DID VD and the vehicle user's encrypted random number E PK (δ) to the blockchain for storage, obtain the encrypted rent E PK (y) and the encrypted rental duration E PK (t) from the blockchain and obtain the rental duration t through the Paillier private key SK, and calculate the encrypted car sharing cost E PK (Rent) = E PK (t × y) = E PK (y) t mod n 2 .
[0036] The method for the service platform to generate an encrypted contract based on the car sharing cost is as follows:
[0037] The service platform uses the Paillier private key SK to decrypt the encrypted car sharing cost E PK (Rent) to obtain the car sharing cost Rent, and encrypt the car sharing cost Rent, the service terms Terms and the timestamp T2 of the contract formation using the service platform's private key SK AS to obtain the encrypted contract C = E SKAS(Rent||T2||Terms), the service platform sends the encrypted contract C to the vehicle user and the vehicle provider respectively.
[0038] The methods for the vehicle user and the vehicle provider to decrypt the encrypted contract and confirm the contract respectively and send confirmation information to the service platform are as follows:
[0039] The vehicle provider uses the service platform public key PK AS to decrypt the encrypted contract C, and verifies the freshness of the message according to the timestamp T2; after satisfying the verification formula and the vehicle provider accepts the terms in the contract, the vehicle provider uses the vehicle provider private key E SKVP to splice and encrypt the vehicle real-time location information l and the key k to unlock the vehicle, and then encrypts them with the vehicle provider encryption random number E PK (Ω) to form the vehicle provider confirmation information {E SKVP (l||k),E PK (Ω)} and sends it to the service platform;
[0040] The vehicle user uses the service platform public key PK AS to decrypt the encrypted contract C, and verifies the freshness of the message according to the timestamp T2. After satisfying the verification formula and the vehicle user accepts the service terms Terms in the contract, the vehicle user uses the vehicle user private key E SKVD to encrypt the vehicle user encryption random number E PK (δ) to obtain the vehicle user confirmation information E SKVD (E PK (δ)) and sends it to the service platform.
[0041] The method for the service platform to decrypt the confirmation information and complete the transfer of the right of use by executing the smart contract is as follows:
[0042] S6.11. The service platform uses the vehicle provider public key PK VP to decrypt the vehicle provider confirmation information {E SKVP (l||k),E PK (Ω)}, and compares the vehicle provider encryption random number E PK (Ω) with the vehicle provider encryption random number stored in the blockchain;
[0043] The service platform uses the vehicle user public key PK VD to decrypt the vehicle user confirmation information E VD (E PK (δ)), and compares the vehicle user encryption random number E PK (δ) with the vehicle user encryption random number stored in the blockchain; when the condition is satisfied and the received EPK (δ) = E stored in the blockchain PK (δ) && received E PK (Ω) = E stored in the blockchain PK (Ω), then the vehicle provider and the vehicle user reach an agreement on the service terms;
[0044] S6.12. After reaching an agreement on the service terms, the service platform uploads the pseudonyms of the user vehicle provider, the vehicle user, and the vehicle pseudonym {DID VD , DID VP , CID s} to the smart contract, and charges the vehicle user by executing the smart contract to complete the issuance of the real-time location information l of the vehicle and the key k for unlocking the vehicle.
[0045] Advantages of the present invention: The present invention constructs a blockchain-based car-sharing solution according to service authorization requirements, and uses the hash algorithm to generate pseudonyms for users. This identity anonymity makes it difficult for the identity information of vehicle users and vehicle providers to be misused or leaked. Digital signatures are used to verify identities, which can ensure the authenticity and integrity of data, and avoid security vulnerabilities such as data forgery and identity theft. The payment for the cost of shared cars and the transfer of the right to use are completed through smart contracts, realizing the openness and transparency of authorization and the traceability of transactions. And sensitive data related to user privacy such as time and money are encrypted homomorphically to protect user privacy to the greatest extent. By using mechanisms such as timestamps and random numbers, replay attacks can be resisted and repeated authentication can be prevented. The present invention can ensure effective authentication and cooperation among vehicle users, vehicle providers, and service platforms, while ensuring information security and privacy, enabling the participating parties in the sharing economy to interact efficiently and securely. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0047] Figure 1 It is the network structure diagram of the present invention.
[0048] Figure 2 It is the flowchart of a blockchain-based privacy protection car-sharing method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0050] A method for car sharing with privacy protection based on blockchain, as Figure 2 shown, includes the steps:
[0051] S1: Build a blockchain network and deploy a smart contract in the blockchain network. The blockchain network adopted in this embodiment is the Ethereum network, which is used to store vehicle transaction information. As Figure 1 shown, the overall network of the present invention includes a blockchain network, a service platform, vehicle users, and vehicle providers.
[0052] S2: Initialize the service platform based on the elliptic curve algorithm and generate a Paillier public key PK and a Paillier private key SK using the Paillier algorithm (a homomorphic encryption algorithm).
[0053] The method for initializing the service platform is as follows:
[0054] S2.1: The service platform executes the elliptic curve algorithm: Select a cyclic additive group of prime order r defined on a non-singular elliptic curve E: y q = x 2 + ax + b mod q on the finite field F 3 and select a generator P; where q is a prime number representing the size of the finite field F , mod represents the modulo operation, and the coefficients a and b of the elliptic curve satisfy the discriminant: Δ = 4a q + 27b 3 ≠ 0 mod q to ensure the curve is smooth. The size of the finite field determines the number of points (i.e., the additive group) on the elliptic curve. Randomly select an integer SK 2 within the finite field F q as the service platform private key, and calculate the service platform public key PK AS through scalar multiplication on the elliptic curve AS = P·SK AS .
[0055] S2.2: The service platform randomly selects two hash functions:
[0056] h1: h1 represents mapping a binary string of any length to the set of non-zero residue classes modulo r; {0,1} *denotes the set of all finite-length binary strings consisting of 0s and 1s, denotes the set of residue classes modulo r, where r is a positive integer, denotes the multiplicative group formed by the non-zero elements in
[0057] h2: {0, 1} * → {0, 1} k ; h2 denotes mapping a binary string of any length to a binary string of a fixed length k; {0, 1} k denotes the set consisting of k-bit binary strings.
[0058] The method for generating the Paillier public key PK and the Paillier private key SK using the Paillier algorithm is as follows:
[0059] S2.3. The service platform selects two large prime numbers p and d with the same number of binary digits in the finite field F q ; calculates the modulus n = p × d, and the modulus n is used as the first parameter of the Paillier public key PK; calculates the Carmichael function value λ = lcm(p - 1, d - 1) through the Carmichael function, where lcm(·) represents the least common multiple function, and the Carmichael function value λ is used as the first parameter of the Paillier private key SK.
[0060] S2.4. The service platform selects an integer such that the integer g is relatively prime to n 2 and the order of the integer g is a multiple of the modulus n, and the integer g is used as the second parameter of the Paillier public key PK; denotes the set of residue classes modulo n 2 , is the multiplicative group formed by the multiplicatively invertible elements in gcd(·) represents the greatest common divisor, gcd(x, n 2 ) = 1 means that x and n 2 are relatively prime.
[0061] S2.5. The service platform calculates the modular inverse μ = (L(g λ mod n 2 )) -1 mod n, where the auxiliary function mod represents the modular operation, and the modular inverse μ is used as the second parameter of the Paillier private key SK.
[0062] S2.6. Finally, generate the Paillier public key PK: (n, g) and the Paillier private key SK: (λ, μ); the Paillier public key PK is used as the encryption key and operation key for homomorphic encryption, and is used to allow all participants to encrypt sensitive information during subsequent authentication processes. The Paillier private key SK is used for decryption and is saved by the service platform.
[0063] Service platform public parameters
[0064] S3: Initialize the vehicle user and the vehicle provider based on the elliptic curve algorithm and the hash function respectively.
[0065] The method for initializing the vehicle user is as follows:
[0066] S3.1: Specifically, the vehicle user generates the vehicle user public key PK VD and the vehicle user private key SK VD based on the elliptic curve algorithm and the hash function h1; the vehicle user uses the public key PK VD to generate the vehicle user pseudonym DID VD using the Keccak-256 hash function:
[0067] Based on the elliptic curve algorithm, the vehicle user selects a random number s in the finite field F q , calculates the parameter R = s·P according to the generator P, and generates the vehicle user private key SK i using the hash function h1 based on the vehicle user's real identity information ID VD = h1(ID i ||R), where || represents the string concatenation operation; calculates the vehicle user public key PK VD = SK VD ·P according to the scalar multiplication; inputs the vehicle user public key PK VD into the Keccak-256 hash function, calculates the blockchain external account address of the vehicle user represented by a 32-byte hash value, and intercepts the last 20 bytes of the blockchain external account address of the vehicle user as the vehicle user pseudonym DID VD .
[0068] The method for initializing the vehicle provider is as follows:
[0069] S3.2: S3.21: Specifically, the vehicle provider generates the vehicle provider public key PK VP and the vehicle provider private key SK VP : The vehicle provider selects a random number s in the finite field F qThe random number n is selected from the above, and the parameter N = n × P is calculated based on the generator P, and the real identity information ID of the vehicle provider is used j Generate vehicle provider private key SK VP =h1(ID j ||N), || represents string concatenation; the vehicle provider public key PK is calculated based on scalar multiplication VP =SK VP ·P.
[0070] Furthermore, the vehicle provider uses the public key PK VP Generate vehicle provider pseudonymous DID using Keccak-256 hash function VP :The vehicle provider's public key PK VP Input the Keccak-256 hash function and generate the vehicle provider's blockchain external account address for it. Take the last 20 bytes of the vehicle provider's blockchain external account address as the vehicle provider's pseudonymous DID VP .
[0071] S3.22: The vehicle provider uses the hash function h2 to generate a pseudonymous CID for the vehicle identification number VIN. j :The vehicle provider concatenates the vehicle identification code with the current timestamp and uses the hash function h2 to generate a pseudonymous CID for the available vehicle j =h2(VIN||T1), T1 is the current timestamp.
[0072] Furthermore, the vehicle provider uses the Paillier public key PK to identify the vehicle provider and the pseudonym CID of the available vehicles. j Encrypted transmission of rentals: Vehicle providers will be able to select the vehicle's pseudonymous CID j and vehicle provider pseudonym DID VP After splicing, use the vehicle provider's private key SK VP Encryption to obtain encrypted identification information The vehicle provider uses a cryptographically secure random number generator (CSPRNG) over a finite field F q Select a random number Ω and use the Paillier public key PK to encrypt the random number Ω and the rent y to obtain the encrypted rent E PK (y) and encrypted random number E PK (Ω), the encrypted identification information Crypto Rent E PK (y) and encrypted random number E PK (Ω) composed of strings Sent to the service platform; E * Represents an encryption operation.
[0073] S3.23: The service platform authenticates the vehicle user and stores the encrypted information and identity information of the vehicle provider using the blockchain:
[0074] The service platform uses the public key PK of the vehicle provider VP to verify the encrypted identification information and stores the pseudonym DID of the vehicle provider VP , the pseudonym CID of the available vehicle j , the encrypted random number E of the vehicle provider PK (Ω) and the encrypted rent E PK (y) in the blockchain.
[0075] S4: When sharing is needed, the vehicle user encrypts and transmits the rental duration based on the Paillier public key PK. The service platform authenticates the vehicle user and uploads the authenticated encrypted transmission information to the blockchain for storage and calculates the encrypted car-sharing cost.
[0076] S4.1: The method by which the vehicle user encrypts and transmits the rental duration based on the Paillier public key PK is as follows:
[0077] The vehicle user uses a cryptographically secure pseudorandom number generator (CSPRNG) to select a random number δ within a finite field and uses the private key SK of the vehicle user VD to digitally sign the pseudonym DID of the vehicle user VD to obtain the digital signature sig(DID VD ), and encrypts the random number δ and the rental duration t respectively using the Paillier public key PK to obtain the encrypted random number E PK (δ) and the encrypted rental duration E PK (t). The vehicle user obtains the pseudonym CID of the vehicle applied for use from the blockchain s , and forms a string {sig(DID VD ), CID s , E PK (δ), E PK (t)} by combining the digital signature sig(DID VD ), the pseudonym CID of the vehicle applied for use s , the encrypted random number E PK (t), and the encrypted rental duration E PK and sends it to the service platform.
[0078] S4.2: The method by which the service platform authenticates the vehicle user, uploads the authenticated encrypted transmission information to the blockchain for storage and calculates the encrypted car-sharing cost is as follows:
[0079] The service platform utilizes the public key PK of the vehicle user VD , to authenticate the digital signature sig(DID VD ) of the vehicle user. After successful authentication, the pseudonym DID of the vehicle user VD and the encrypted random number E PK (δ) of the vehicle user are uploaded to the blockchain for storage. Based on the encrypted rent E PK (y) and the encrypted rental duration E PK (t) obtained from the blockchain, after obtaining the rental duration t (E SK (E PK (t)) = t) through the Paillier private key SK, use the multiplicative homomorphism of Paillier to calculate the encrypted car-sharing cost E PK (Rent) = E PK (t × y) = E PK (y) t mod n 2 .
[0080] S5: The service platform generates an encrypted contract based on the encrypted car-sharing cost. The vehicle user and the vehicle provider decrypt the encrypted contract and confirm the contract respectively and send confirmation messages to the service platform respectively.
[0081] S5.1: The method for the service platform to generate an encrypted contract based on the car-sharing cost is as follows:
[0082] The service platform decrypts the encrypted car-sharing cost E PK (Rent) using the Paillier private key SK to obtain the car-sharing cost Rent. The car-sharing cost Rent, the service terms Terms, and the timestamp T2 of the contract formation are encrypted using the service platform private key SK AS to obtain the encrypted contract The service platform sends the encrypted contract C to the vehicle user and the vehicle provider respectively.
[0083] S5.2: The implementation method for the vehicle user and the vehicle provider to decrypt and confirm the encrypted terms respectively and send confirmation messages to the service platform respectively is as follows:
[0084] S5.21: The vehicle provider decrypts the encrypted contract C using the public key PK of the service platform AS , and verifies the freshness of the message according to the timestamp T2. The verification formula is T now - T2 ≤ Δt, T now is the current time, and Δt is the maximum acceptable time interval. After satisfying the verification formula and the vehicle provider accepts the terms in the contract, the vehicle provider uses the private key of the vehicle provider Concatenate and encrypt the real-time vehicle location information l and the key k for unlocking the vehicle, and then combine it with the encrypted random number E PK of the vehicle provider to form the vehicle provider confirmation information and send it to the service platform.
[0085] S5.22: When the vehicle is used, the public key PK AS of the service platform is used to decrypt the encrypted contract C, and the freshness of the message is verified according to the timestamp T2. After the verification formula is satisfied and the vehicle user accepts the service terms Terms in the contract, the vehicle user uses the private key of the vehicle user to encrypt the encrypted random number E PK (δ) to obtain the vehicle user confirmation information and send it to the service platform.
[0086] S6: The service platform decrypts the confirmation information, completes the transfer of the right of use by executing the smart contract, records the transaction status using the blockchain, and ends the car-sharing service after the usage time expires or the vehicle user returns the vehicle.
[0087] S6.1: The method for the service platform to decrypt the confirmation information and complete the transfer of the right of use by executing the smart contract is as follows:
[0088] S6.11: The service platform uses the public key PK VP of the vehicle provider to decrypt the vehicle provider confirmation information , and compares the encrypted random number E PK (Ω) of the vehicle provider with the encrypted random number of the vehicle provider stored in the blockchain; the service platform uses the public key PK VD of the vehicle user to decrypt the vehicle user confirmation information E VD (E PK (δ)), and compares the encrypted random number E PK (δ) of the vehicle user with the encrypted random number of the vehicle user stored in the blockchain; both the encrypted random number E PK (Ω) of the vehicle provider and the encrypted random number E PK (δ) of the vehicle user are compared successfully, that is, the received E PK (δ) = the E PK (δ) stored in the blockchain && the received E PK (Ω) = the E PK (Ω) stored in the blockchain, then the vehicle provider and the vehicle user reach an agreement on the service terms.
[0089] S6.12: The service platform will use the pseudonyms of the vehicle provider, the vehicle user, and the vehicle {DI V DD , DI V D P , CI is uploaded to the smart contract, and the smart contract is executed to charge the vehicle user, completing the distribution of the real-time vehicle location information l and the key k for unlocking the vehicle. The main function SContract() of the smart contract records the vehicle sharing cost through the contract account and stores the vehicle location information l and the key k for unlocking the vehicle through the function uploadRentalInfo(). After the vehicle user pays the vehicle sharing cost Rent, the vehicle user obtains the location information l and the key k for unlocking the vehicle through the function getVehicleInfo(). The vehicle sharing cost Rent will be transferred from the contract account to the vehicle user, and at the same time, the vehicle user can query their balance through the function getBalance(user).
[0090] S6.2. When the vehicle is in use, the blockchain records the vehicle usage time through a timer. The on-chain status of the vehicle is {ID i , CID s , PK VD , invaild}, which can be queried in real time by all participating parties. Here, invaild means that the vehicle is currently unavailable. After the time expires or the driver actively ends the vehicle sharing, the on-chain status of the vehicle becomes {ID i , CID s , PK VD , vaild}, and vaild means that it can continue to participate in the next round of sharing.
[0091] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A privacy-preserving car sharing method based on blockchain, characterized in that: Includes steps: S1: Build a blockchain network and deploy smart contracts in the blockchain network; S2: Initialize the service platform based on the elliptic curve algorithm and use the Paillier algorithm to generate the Paillier public key PK and the Paillier private key SK; S3: Initialize the vehicle user and the vehicle provider respectively based on the elliptic curve algorithm and the hash function; S4: When sharing is required, the vehicle user encrypts and transmits the rental time based on the Paillier public key PK. The service platform authenticates the vehicle user, uploads the encrypted transmission information after authentication to the blockchain for storage, and calculates the encrypted car sharing cost. S5: The service platform generates an encrypted contract based on the encrypted car sharing price, and the vehicle user and the vehicle provider decrypt and confirm the encrypted contract respectively and send confirmation information to the service platform respectively; S6: The service platform decrypts the confirmation information, completes the transfer of usage rights by executing the smart contract, uses the blockchain to record the transaction status, and ends the car sharing service after the usage time expires or the vehicle user returns the vehicle.
2. The privacy-preserving car sharing method based on blockchain according to claim 1, characterized in that: The method for initializing the service platform is: S2.
1. The service platform executes the elliptic curve algorithm: in the finite field F q Choose a cyclic additive group of prime order r defined on a non-singular elliptic curve E And select the generator P; in the finite field F q In the AS As the service platform private key, and calculate the service platform public key PK through scalar multiplication AS =P·SK AS ; S2.
2. The service platform selects the hash function: h1 means mapping a binary string of arbitrary length to a set of non-zero remainder classes modulo r; h2:{0,1} * →{0,1} k ; h2 means mapping a binary string of arbitrary length into a binary string of fixed length k.
3. The privacy-preserving car sharing method based on blockchain according to claim 2 is characterized in that: The method of generating the Paillier public key PK and the Paillier private key SK using the Paillier algorithm is: S2.3, service platform in finite domain F q Select two large prime numbers p and d with the same number of binary digits; calculate the modulus n = p × d, and use the modulus n as the first parameter of the Paillier public key PK; calculate the Carmichael function value λ = lcm(p-1, d-1) by using the Carmichael function, where lcm(·) represents the least common multiple function, and use the Carmichael function value λ as the first parameter of the Paillier private key SK; S2.
4. The service platform selects an integer So that integers g and n 2 They are mutually prime, and the order of the integer g is a multiple of the modulus n. The integer g serves as the second parameter of the Paillier public key PK. modulo n 2 The multiplication group of ; S2.5, the service platform calculates the inverse module μ = (L (g λ modn 2 )) -1 modn, where the auxiliary function mod represents modular operation, and the modular inverse element μ is used as the second parameter of the Paillier private key SK; S2.
6. Finally, the Paillier public key PK: (n, g) and the Paillier private key SK: (λ, μ) are generated; the Paillier public key PK is used as the encryption key and operation key of homomorphic encryption; the Paillier private key SK is used for decryption.
4. The privacy-preserving car sharing method based on blockchain according to claim 2 or 3, characterized in that: The method for initializing the vehicle user is as follows: S3.
1. The vehicle user generates the vehicle user public key PK based on the elliptic curve algorithm and hash function h1 VD and the vehicle user's private key SK VD ; Vehicle users use public key PK VD Generate vehicle user pseudonym DID using Keccak-256 hash function VD ; The method for initializing the vehicle provider is as follows: S3.
2. The vehicle provider generates the vehicle provider public key PK based on the elliptic curve algorithm and hash function h1 VP and the vehicle provider private key SK VP ; The vehicle provider uses the vehicle provider public key PK VP Generate vehicle provider pseudonymous DID using Keccak-256 hash function VP ; The vehicle provider uses the hash function h2 to generate the vehicle pseudonym CID for the vehicle identification code VIN j The vehicle provider uses the Paillier public key PK to identify the vehicle provider and the pseudonym CID of the available vehicles. j and rent are encrypted for transmission; the service platform uses the public key PK of the vehicle provider based on the encrypted transmission information VP Authentication is performed and the encrypted transmitted information is stored in the blockchain.
5. The privacy-preserving car sharing method based on blockchain according to claim 4 is characterized in that: The implementation method of step S3.1 is: based on the elliptic curve algorithm, the vehicle user is in the finite field F q The random number s is selected from the generator P, and the parameter R = s·P is calculated based on the real identity information ID of the vehicle user. i Use the hash function h1 to generate the vehicle user's private key SK VD =h1(ID i ||R), || represents the string concatenation operation; the vehicle user public key PK is calculated based on scalar multiplication VD =SK VD P; the vehicle user's public key PK VD Input the Keccak-256 hash function, calculate the vehicle user's blockchain external account address represented by the hash value, and intercept part of the bytes of the vehicle user's blockchain external account address as the vehicle user's pseudonymous DID VD .
6. The privacy-preserving car-sharing method based on blockchain according to claim 5 is characterized in that: The vehicle provider described in step S3.2 uses the hash function h2 to generate a vehicle pseudonym CID for the vehicle identification code VIN j The method is as follows: the vehicle provider concatenates the vehicle identification code with the current timestamp T1, and uses the hash function h2 to generate a pseudonym CID for the available vehicle. j =h2(VIN||T1); The vehicle provider described in step S3.2 uses the Paillier public key PK to identify the vehicle provider and the pseudonym CID of the available vehicle. j The method for encrypted transmission of the rental fee is as follows: the vehicle provider will select the pseudonym CID of the vehicle j and vehicle provider pseudonym DID VP After splicing, use the vehicle provider's private key SK VP Encryption is performed to obtain the encrypted identification information E SKVP (CID j ||DID VP ); The vehicle provider uses a cryptographically secure random number generator in a finite field F q Select a random number Ω and use the Paillier public key PK to encrypt the random number Ω and the rent y to obtain the encrypted rent E PK (y) and encrypted random number E PK (Ω), the encrypted identification information E SKVP (CID j ||DID VP ), Crypto Rent E PK (y) and encrypted random number E PK (Ω) forms a string {E SKVP (CID j ||DID VP ),E PK (y),E PK (Ω)} is sent to the service platform, where E * Represents an encryption operation.
7. The privacy-preserving car sharing method based on blockchain according to claim 5 or 6, characterized in that: The method for the vehicle user to encrypt and transmit the rental time based on the Paillier public key PK in step S4 is: the vehicle user uses a cryptographically secure random number generator in a finite field F q The random number δ is selected internally, and the private key SK of the vehicle user is used VD DID for vehicle users VD Digital signature is performed to obtain the vehicle user's digital signature sig (DID VD ), and use the Paillier public key PK to encrypt the random number δ and the rental time t to obtain the encrypted random number E PK (δ) and encrypted lease duration E PK (t) Obtain the pseudonymous CID of the vehicle being applied for from the blockchain s , the vehicle user's digital signature sig(DID VD ), the pseudonym CID of the vehicle you are applying to use s , encrypted random number E PK (δ) and encrypted lease duration E PK (t) string composed of {sig(DID VD ),CID s ,E PK (t),E PK (δ)} sent to the service platform; The service platform authenticates the vehicle user, uploads the encrypted transmission information after authentication to the blockchain for storage, and calculates the encrypted car sharing cost as follows: The service platform uses the vehicle user's public key PK VD , digital signature sig(DID VD ) to authenticate the identity. After successful authentication, the vehicle user's pseudonym DID will be VD and the encrypted random number E of the vehicle user PK (δ) Uploaded to the blockchain for storage, and the encrypted rent E obtained from the blockchain PK (y) and the encrypted rental duration E PK (t) and obtain the rental time t through the Paillier private key SK, and calculate the encrypted car sharing cost E using the Paillier public key PK according to the Paillier multiplication homomorphism PK (Rent)=E PK (t×y)=E PK (y) t modn 2 .
8. The privacy-preserving car-sharing method based on blockchain according to claim 7 is characterized in that: The method for the service platform to generate an encrypted contract based on the car sharing cost is: The service platform uses the Paillier private key SK to encrypt the car sharing price E PK (Rent) is decrypted to obtain the car sharing price Rent, and the car sharing price Rent is combined with the terms of service Terms and the timestamp T2 of the contract formation using the service platform private key SK AS Encryption results in an encrypted contract C=E SKAS (Rent||T2||Terms), the service platform sends the encrypted contract C to the vehicle user and the vehicle provider respectively.
9. The privacy-preserving car-sharing method based on blockchain according to claim 8, characterized in that: The method for the vehicle user and the vehicle provider to respectively decrypt and confirm the encrypted contract and send confirmation information to the service platform is: The vehicle provider uses the service platform public key PK AS Decrypt the encrypted contract C and verify the freshness of the message based on the timestamp T2; after the verification formula is satisfied and the vehicle provider accepts the terms in the contract, the vehicle provider uses the vehicle provider private key E SKVP The real-time location information l of the vehicle and the key k for unlocking the vehicle are concatenated and encrypted with the random number E encrypted by the vehicle provider. PK (Ω) constitutes the vehicle provider confirmation information {E SKVP (l||k),E PK (Ω)} sent to the service platform; Vehicle users use the service platform public key PK AS Decrypt the encrypted contract C and verify the freshness of the message according to the timestamp T2. After the verification formula is satisfied and the vehicle user accepts the terms of service in the contract, the vehicle user uses the vehicle user private key E SKVD Encrypt the random number E for the vehicle user PK (δ) Encrypt to obtain the vehicle user confirmation information E SKVD (E PK (δ)) and sent to the service platform.
10. The privacy-preserving car sharing method based on blockchain according to claim 9 is characterized in that: The service platform decrypts the confirmation information and completes the transfer of the right of use by executing the smart contract as follows: S6.
11. The service platform uses the vehicle provider's public key PK VP Confirm information to vehicle provider SKVP (l||k),E PK (Ω)} is decrypted and the vehicle provider encrypted random number E PK (Ω) is compared with the vehicle provider’s encrypted random number stored in the blockchain; The service platform uses the vehicle user's public key PK VD Confirm information to vehicle users E VD (E PK (δ)) is decrypted and the vehicle user encrypted random number E PK (δ) is compared with the encrypted random number of the vehicle user stored in the blockchain; when the condition is met, the received E PK (δ) = E stored in the blockchain PK (δ)&&Received E PK (Ω) = E stored in the blockchain PK (Ω), then the vehicle provider and the vehicle user reach an agreement on the terms of service; S6.
12. After the service terms are agreed upon, the service platform will use the user's vehicle provider pseudonym, vehicle user pseudonym and vehicle pseudonym {DID VD ,DID VP ,CID s }Upload it to the smart contract, charge the vehicle user by executing the smart contract, and complete the distribution of the car's real-time location information l and the key k for unlocking the vehicle.
Citation Information
Patent Citations
A privacy-preserving vehicular network authentication method and system based on blockchain.
CN112039870B