# US 8,751,822 B2 · Cryptography using quasigroups

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

- Number: US 8,751,822 B2
- Document ID: US8751822B2
- Status: Granted
- Kind: B2
- Application number: 12/974,952
- Filed: 2010-12-21
- Published: 2012-06-21
- Granted: 2014-06-10
- Earliest claimed: 2010-12-20
- Assignees: Motorola Mobility LLC
- Applicants: Lex Aaron Anderson
- Inventors: Lex Aaron Anderson
- Web page: https://patentgrep.com/patent/US8751822B2

## CPC

- G06F 21/14: against software analysis or reverse engineering, e.g. by obfuscation
- H04L 9/002: {Countermeasures against attacks on cryptographic mechanisms (network architectures or network communication protocols for protection against malicious traffic H04L63/1441)}
- H04L 2209/08: Randomization, e.g. dummy operations or using noise
- H04L 2209/16: Obfuscation or hiding, e.g. involving white box
- 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)

## Abstract

A method and apparatus 20 for securing executable code embodying a cipher 12 using a metamorphic algorithm 24. The metamorphic algorithm 24 dynamically executes polymorphic primitives 43, each of which implements a functional component 41 of the cryptographic algorithm 12. When a halting condition is met, the output of the cryptographic algorithm 12 occurs.

## Claims

### Claim 1

A method of securing an executable program comprising a cipher with a plurality of functional components each of which can be implemented by one or more polymorphic code blocks, the method comprising the following in any order:
generating a composite quasigroup isotope for each layer in a plurality of layers, wherein each composite quasigroup isotope defines a cryptographic state for a polymorphic code block of the one or more polymorphic blocks in a respective layer,
receiving input comprising information for encryption or decryption by the cipher,
recursively executing the one or more polymorphic code blocks repeatedly in any sequence and/or in parallel, wherein on execution each polymorphic code block for a layer reads input from memory and generates and writes output to memory using a respective composite quasigroup isotope for the layer, wherein for any instance of execution the input and output might or might not be valid, and
outputting resultant decryption or encryption of the information when the one or more polymorphic code blocks implementing the functional components of the cipher have all been executed to provide valid output, the resultant decryption or encryption of information being the output from one or more of the one or more polymorphic code blocks.

### Claim 2 (depends on 1)

A method according to claim 1 wherein the read input comprises data that originates from a file, another polymorphic code block, network or other data source and upon execution the polymorphic code block executes at least a first transformation based on the data to generate the output.

### Claim 3 (depends on 2)

A method according to claim 2 further comprising checking for a halting condition,
wherein the read input further comprises an input hash value, the output further comprises an output hash value, and each polymorphic code block comprises an identifier,
wherein upon execution each polymorphic code block executes a hash transformation based on the input hash value and identifier to generate the output hash value, and
wherein checking for the halting condition in at least one polymorphic code block comprises:
comparing the output hash value of that polymorphic code block to an expected value, and
determining occurrence of the halting condition when the output hash value of that polymorphic code block is the expected value.

### Claim 4 (depends on 1)

A method according to claim 1 wherein invalid output from a polymorphic code block occurs when one or more of the following occur:
the polymorphic code block has the wrong cryptographic state,
the polymorphic code block reads input originating from a wrong polymorphic code block or other data source,
the read input is invalid.

### Claim 5 (depends on 1)

A method according to claim 1 wherein a plurality of finite-state automata code blocks each generate the composite quasigroup isotope for each respective layer that defines the cryptographic state for the polymorphic code block in that layer.

### Claim 6 (depends on 5)

A method according to claim 5 further comprising decrypting inputs read into and encrypting outputs written from the one or more polymorphic code blocks, wherein each such polymorphic code block is in a respective layer and decrypts and/or encrypts inputs and/or outputs using the composite quasigroup isotope for that respective layer.

### Claim 7 (depends on 6)

A method according to claim 6 wherein a polymorphic code block in a respective layer correctly decrypts input when the composite quasigroup isotope for that layer is a parastrophe of the composite quasigroup isotope used to encrypt that input.

### Claim 8 (depends on 1)

The method of claim 1 further comprising checking for a halting condition using at least one polymorphic code block, wherein outputting resultant decryption or encryption of the information occurs when the halting condition occurs, the halting condition occurring when the one or more polymorphic code blocks implementing the functional components of the cipher have all been executed to provide valid output, the resultant decryption or encryption of information being the output from one or more of the one or more polymorphic code blocks.

### Claim 9

A method of creating a metamorphic algorithm to implement a cipher, comprising:
generating a composite quasigroup isotope for each layer in a plurality of layers, wherein each composite quasigroup isotope defines a cryptographic state for a polymorphic code block in a respective layer;
receiving a cipher,
decomposing the cipher into polymorphic code blocks, where each polymorphic code block for a respective layer implements a functional component of the cipher using output from another polymorphic code block or other data source and a respective composite quasigroup isotope for the respective layer, and
compiling a cipher kernel that upon execution recursively executes repeatedly polymorphic code blocks in a non-sequential and/or parallel manner to read input and write output that might or might not be valid.

### Claim 10

An apparatus for securely implementing an executable program comprising a cipher with a plurality of functional components each of which can be implemented by one or more polymorphic code blocks, the apparatus comprising:
an input for receiving information for encryption or decryption by the cipher,
an output for providing encrypted or decrypted information, and
a processor configured to, in any order:
generate a composite quasigroup isotope for each layer in a plurality of layers, wherein each composite quasigroup isotope defines a cryptographic state for a polymorphic code block of the one or more polymorphic blocks in a respective layer,
recursively execute the one or more polymorphic code blocks repeatedly in any sequence and/or in parallel, wherein on execution each polymorphic code block for a layer reads input from memory and generates and writes output to memory using a respective composite quasigroup isotope for the layer, wherein for any instance of execution the input and output might or might not be valid, and
output resultant decryption or encryption of the information when the one or more polymorphic code blocks implementing the functional components of the cipher have all been executed to provide valid output, the resultant decryption or encryption of information being the output from one or more of the one or more polymorphic code blocks.

### Claim 11 (depends on 10)

An apparatus according to claim 10 wherein the read input comprises data that originates from a file, another polymorphic code block, network or other data source and upon execution the polymorphic code block executes at least a first transformation based on the data to generate the output.

### Claim 12 (depends on 11)

An apparatus according to claim 11 further comprising checking for a halting condition,
wherein the read input further comprises an input hash value, the output further comprises an output hash value, and each polymorphic code block comprises an identifier,
wherein upon execution each polymorphic code block executes a hash transformation based on the input hash value and identifier to generate the output hash value, and
wherein checking for the halting condition in at least one polymorphic code block comprises:
comparing the output hash value of that polymorphic code block to an expected value, and
determining occurrence of the halting condition when the output hash value of that polymorphic code block is the expected value.

### Claim 13 (depends on 12)

An apparatus according to claim 12 wherein a plurality of finite-state automata code blocks each generate the composite quasigroup isotope for each respective layer that defines the cryptographic state for the polymorphic code block in that layer.

### Claim 14 (depends on 13)

An apparatus according to claim 13 wherein the one or more polymorphic code blocks decrypt inputs read and encrypt outputs written, wherein each such polymorphic code block is in a respective layer and decrypts and/or encrypts inputs and/or outputs using the composite quasigroup isotope for that respective layer.

### Claim 15 (depends on 14)

An apparatus according to claim 14 wherein a polymorphic code block in a respective layer correctly decrypts input when the composite quasigroup isotope for that layer is a parastrophe of the composite quasigroup isotope used to encrypt that input.

### Claim 16 (depends on 10)

An apparatus according to claim 10 wherein invalid output from a polymorphic code block occurs when one or more of the following occur:
the polymorphic code block has the wrong cryptographic state,
the polymorphic code block reads input originating from a wrong polymorphic code block or other data source,
the read input is invalid.

### Claim 17

An apparatus for creating a metamorphic algorithm to implement a cipher, comprising:
an input for receiving a cryptographic algorithm,
a processor configured to:
generate a composite quasigroup isotope for each layer in a plurality of layers, wherein each composite quasigroup isotope defines a cryptographic state for a polymorphic code block in a respective layer,
receive a cipher,
decompose the cipher into polymorphic code blocks, where each polymorphic code block for a respective layer implements a functional component of the cipher using output from another polymorphic code block or other data source and a respective composite quasigroup isotope for the respective layer, and
compile a cipher kernel that upon execution recursively executes repeatedly polymorphic code blocks in a non-sequential and/or parallel manner to read input and write output that might or might not be valid.

### Claim 18

A non-transitory computer readable medium containing instructions for a computer to perform a method of securing an executable program comprising a cipher with a plurality of functional components each of which can be implemented by one or more polymorphic code blocks, the method comprising the following in any order:
generating a composite quasigroup isotope for each layer in a plurality of layers, wherein each composite quasigroup isotope defines a cryptographic state for a polymorphic code block of the one or more polymorphic blocks in a respective layer;
receiving input comprising information for encryption or decryption by the cipher,
recursively executing the one or more polymorphic code blocks repeatedly in any sequence and/or in parallel, wherein on execution each polymorphic code block for a layer reads input from memory and generates and writes output to memory using a respective composite quasigroup isotope for the layer, wherein for any instance of execution the input and output might or might not be valid, and
outputting resultant decryption or encryption of the information when the one or more polymorphic code blocks implementing the functional components of the cipher have all been executed to provide valid output, the resultant decryption or encryption of information being the output from one or more of the one or more polymorphic code blocks.

### Claim 19 (depends on 18)

A non-transitory computer readable medium according to claim 18 wherein the read input comprises data that originates from a file, another polymorphic code block, network or other data source and upon execution the polymorphic code block executes at least a first transformation based on the data to generate the output.

### Claim 20 (depends on 19)

A non-transitory computer readable medium according to claim 19 further comprising checking for a halting condition,
wherein the read input further comprises an input hash value, the output further comprises an output hash value, and each polymorphic code block comprises an identifier,
wherein upon execution each polymorphic code block executes a hash transformation based on the input hash value and identifier to generate the output hash value, and
wherein checking for the halting condition in at least one polymorphic code block comprises:
comparing the output hash value of that polymorphic code block to an expected value, and
determining occurrence of the halting condition when the output hash value of that polymorphic code block is the expected value.

### Claim 21 (depends on 20)

A non-transitory computer readable medium according to claim 20 wherein a plurality of finite-state automata code blocks each generate the composite quasigroup isotope for each respective layer that defines the cryptographic state for the polymorphic code block in that layer.

### Claim 22 (depends on 21)

A non-transitory computer readable medium according to claim 21 further comprising decrypting inputs read into and encrypting outputs written from the one or more polymorphic code blocks, wherein each such polymorphic code block is in a respective layer and decrypts and/or encrypts inputs and/or outputs using the composite quasigroup isotope for that respective layer.

### Claim 23 (depends on 22)

A non-transitory computer readable medium according to claim 22 wherein a polymorphic code block in a respective layer correctly decrypts input when the composite quasigroup isotope for that layer is a parastrophe of the composite quasigroup isotope used to encrypt that input.

### Claim 24 (depends on 18)

A non-transitory computer readable medium according to claim 18 wherein invalid output from a polymorphic code block occurs when one or more of the following occur:
the polymorphic code block has the wrong cryptographic state,
the polymorphic code block reads input originating from a wrong polymorphic code block or other data source,
the read input is invalid.

### Claim 25

A non-transitory computer readable medium carrying instruction for a computer to perform a method of creating a metamorphic algorithm to implement a cipher, comprising:
generating a composite quasigroup isotope for each layer in a plurality of layers, wherein each composite quasigroup isotope defines a cryptographic state for a polymorphic code block in a respective layer,
receiving a cipher,
decomposing the cipher into polymorphic code blocks, where each polymorphic code block for a respective layer implements a functional component of the cipher using output from another polymorphic code block or other data source and a respective composite quasigroup isotope for the respective layer, and
compiling a cipher kernel that upon execution recursively executes repeatedly polymorphic code blocks in a non-sequential and/or parallel manner to read input and write output that might or might not be valid.
