# US 2022/0286272 A1 · Method and apparatus for neural network model encryption and decryption

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0286272 A1
- Document ID: US20220286272A1
- Status: Published application
- Kind: A1
- Application number: 17/684,542
- Filed: 2022-03-02
- Published: 2022-09-08
- Earliest claimed: 2021-03-02
- Assignees: Hon Hai Precision Industry Co., Ltd.
- Applicants: Hon Hai Precision Industry Co., Ltd.
- Inventors: WEI-CHUN WANG; JUNG-HAO YANG; CHIH-TE LU; CHIN-PIN KUO
- Web page: https://patentgrep.com/patent/US20220286272A1

## CPC

- G06F 21/6209: {to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself}
- H04L 9/0625: {with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI}
- G06F 21/602: {Providing cryptographic facilities or services}
- G06N 3/10: Interfaces, programming languages or software development kits, e.g. for simulating neural networks
- H04L 9/0631: {Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms}
- H04L 9/0643: {Hash functions, e.g. MD5, SHA, HMAC or f9 MAC}
- H04L 9/0866: {involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics}
- H04L 9/0894: {Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method for neural network model encryption and decryption includes a first apparatus stores a neural network model and obtains hardware configuration information of the first apparatus, and obtains an encryption key accordingly; encrypts the neural network model by a predetermined encryption algorithm; a second apparatus obtains the encrypted neural network model from the first apparatus, transmits a decryption request to the first apparatus, obtains the hardware configuration information from the first apparatus, obtains a decryption key based on the hardware configuration information; and decrypts the encrypted neural network model by a predetermined decryption algorithm.

## Claims

### Claim 1

A method of neural network model encryption applied in a first apparatus storing a neural network model, the method comprising:
obtaining hardware configuration information of the first apparatus applying the neural network model, and obtaining an encryption key based on the hardware configuration information; and
encrypting the neural network model by a predetermined encryption algorithm.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising:
if the first apparatus invoking the encrypted neural network model, obtaining a decryption key based on the hardware configuration information; and
if the decryption key matches to the encryption key, decrypting the encrypted neural network model by a predetermined decryption algorithm.

### Claim 3 (depends on 2)

The method according to claim 2, further comprising:
if the first apparatus receiving a decryption request from a second apparatus, determining whether the second apparatus is an authorized apparatus;
if the second apparatus is an authorized apparatus, transmitting the hardware configuration information to the second apparatus; or
if the second apparatus is not an authorized apparatus, refusing the decryption request.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the encrypting the neural network model by a predetermined encryption algorithm comprises:
reading a first structural definition file of the neural network model; and
encrypting the first structural definition file by the predetermined encryption algorithm, to obtain the encrypted neural network model.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the obtaining an encryption key based on the hardware configuration information further comprises:
calculating the hardware configuration information through a secure hash algorithm (SHA) to obtain the encryption key.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising:
storing the encrypted neural network model to a database of the first apparatus.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the predetermined encryption algorithm comprises a data encryption standard (DES) algorithm and an advanced encryption standard (AES) algorithm.

### Claim 8

A method for neural network model decryption applied in a second apparatus, wherein the neural network model is stored in a first apparatus, an encryption key is obtained based on a hardware configuration information of the first apparatus applying the neural network model, the method comprises:
the second apparatus obtaining an encrypted neural network model encrypted by the first apparatus from the first apparatus;
if the encrypted neural network model is invoked, the second apparatus transmits a decryption request to the first apparatus, if the second apparatus is determined to be an authorized apparatus by the first apparatus, obtaining the hardware configuration information from the first apparatus;
in response to the hardware configuration information, the second apparatus obtains a decryption key based on the hardware configuration information; and
if the decryption key matches the encryption key, decrypting the encrypted neural network model by a predetermined decryption algorithm.

### Claim 9 (depends on 8)

The method according to claim 8, wherein the decrypting the encrypted neural network model by a predetermined decryption algorithm comprises:
reading a second structural definition file of the encrypted neural network model; and
decrypting the second structural definition file by the predetermined decryption algorithm, to obtaining a decrypted neural network model.

### Claim 10 (depends on 8)

The method according to claim 8, wherein the second apparatus obtains a decryption key based on the hardware configuration information further comprises:
calculating the hardware configuration information through a secure hash algorithm (SHA) to obtain the decryption key.

### Claim 11 (depends on 8)

The method according to claim 8, wherein the decryption request comprises an unique identifier of the second apparatus and an indication of decrypting the neural network model.

### Claim 12 (depends on 8)

The method according to claim 8, wherein the predetermined decryption algorithm comprises a data encryption standard (DES) algorithm and an advanced encryption standard (AES) algorithm.

### Claim 13 (depends on 8)

The method according to claim 8, further comprising:
if the decryption key does not match the encryption key, outputting indication for indicating decryption failure.

### Claim 14

A method for neural network model encryption and decryption comprises:
a first apparatus storing a neural network model and obtaining hardware configuration information of the first apparatus applying the neural network model, and obtaining an encryption key based on the hardware configuration information;
the first apparatus encrypting the neural network model by a predetermined encryption algorithm;
a second apparatus obtaining the encrypted neural network model from the first apparatus;
if the encrypted neural network model being invoked, the second apparatus transmitting a decryption request to the first apparatus, if the second apparatus being determined to be an authorized apparatus by the first apparatus, obtaining the hardware configuration information from the first apparatus;
in response to the hardware configuration information, the second apparatus obtaining a decryption key based on the hardware configuration information; and
if the decryption key matches the encryption key, decrypting the encrypted neural network model by a predetermined decryption algorithm.

### Claim 15 (depends on 14)

The method according to claim 14, further comprises:
if the decryption key does not match the encryption key, the second apparatus outputting indication for indicating decryption failure.

### Claim 16 (depends on 14)

The method according to claim 14, wherein the comprises:
if the second apparatus being determined to be an unauthorized apparatus by the first apparatus, the first apparatus refusing the decryption request.

### Claim 17 (depends on 14)

The method according to claim 14, wherein the first apparatus encrypting the neural network model by a predetermined encryption algorithm further comprises:
reading a first structural definition file of the neural network model; and
encrypting the first structural definition file by the predetermined encryption algorithm, to obtain the encrypted neural network model.

### Claim 18 (depends on 14)

The method according to claim 14, wherein the obtaining an encryption key based on the hardware configuration information comprises:
calculating the hardware configuration information through a secure hash algorithm (SHA) to obtain the encryption key;
wherein the second apparatus obtains a decryption key based on the hardware configuration information comprises:
calculating the hardware configuration information through the secure hash algorithm to obtain the decryption key.

### Claim 19 (depends on 14)

The method according to claim 14, wherein the decrypting the encrypted neural network model by a predetermined decryption algorithm comprises:
reading a second structural definition file of the encrypted neural network model; and
decrypting the second structural definition file by the predetermined decryption algorithm, to obtaining a decrypted neural network model.

### Claim 20 (depends on 14)

The method according to claim 14, wherein the predetermined encryption algorithm and the predetermined decryption algorithm comprises a data encryption standard (DES) algorithm and an advanced encryption standard (AES) algorithm.
