The present invention relates generally to electronic computing devices and computer systems, and more specifically, to securing software and firmware on devices and systems which are accessible to attack.
The use of computers, electronic computing devices and computer software in all of their various forms is recognized to be very common and is growing every day. As well, with the pervasiveness of powerful communication networks, the ease with which computer software programs and data files may be accessed, exchanged, copied and distributed is also growing daily. In order to take advantage of these computer and communication systems and the efficiencies that they offer, there is a need for a method of storing and exchanging computer software and data securely.
One method of maintaining confidentiality or privacy that has demonstrated widespread use and acceptance is encryption of data using secret cryptographic keys. Existing encryption systems are designed to protect their secret keys or other secret data against a “black box attack”. This is a situation where an attacker has knowledge of the algorithm and may examine various inputs to and outputs from the algorithm, but has no visibility into the execution of the algorithm itself (such as an adaptive chosen input/output attack).
While cryptographic systems relying on the black box model are very common, it has been shown that this model does not reflect reality. Often, the attacker is in a position to observe at least some aspect of the execution of the algorithm, and has sufficient access to the targeted algorithm to mount a successful attack (i.e. side-channel attacks such as timing analysis, power analysis, cache attacks, fault injection, etc.) Such attacks are often referred to as “grey-box” attacks, the assumption being that the attacker is able to observe at least part of the system execution.
Recognizing this, an effort has been made to design encryption algorithms and data channels which are resistant to a more powerful attack model—the “white box attack”. A white box attack is an attack on a software algorithm in which it is assumed that the attacker has full visibility into the execution of the algorithm. To date, such protection systems have met with reasonable success, but as such protection systems have become more and more sophisticated, so has the sophistication of the attacking techniques (such as encoding reduction attacks, statistical bucketing attacks and homomorphic mapping attacks). Thus, many existing white box protection systems are being shown to be ineffective against concerted attacks.
Obfuscation of software by means of simple encodings has been in use for some time. In order to be useful, applications of such encodings in software obfuscation must not increase the time and space consumption of the software unduly, so such encodings are typically relatively simple. Hence, while they can protect software in bulk, they do not provide a high degree of security. There are many communication boundaries in software which represent particular vulnerabilities: passage of data in unprotected form into or out of an obfuscated program, passage of data into or out of a cipher implementation in software or hardware, and the like. The strength of prior encoding strategies typically is sharply limited by the data sizes which they protect. For conventional encodings, such protected items are on the order of 32 bits, sometimes 64 bits, and sometimes smaller pieces of data such as characters or bytes. Given the limitations of encodings and the operand sizes, fairly swift brute-force cracking of such encodings cannot be prevented in general.
There is therefore a need for more effective secret-hiding and tamper-resistance techniques, providing protection of software code and data in general, as well as protection of secret cryptographic keys, biometric data, encrypted data and the like. It also is desirable to provide a much stronger form of protection for software boundaries than conventional simple encodings.
Embodiments of the present invention aim generally at providing more effective secret-hiding and tamper-resistance techniques, providing protection of software code and data without fear that security will be breached.
The methods and systems disclosed herein are not limited to any particular underlying program. They may be applied to cryptographic systems, but equally, may be applied to non-cryptographic systems. As well, the software code that is being protected does not dictate what is done to protect it, so the protection techniques are not constrained by the underlying code. This may provide an advantage over other protection techniques which can leave or create patterns that are based on the underlying code. Such patterns may provide weaknesses that can be exploited by attackers.
Some embodiments disclosed herein provide “profound data dependence”, which can make it difficult or impossible to unentangle or distinguish the protected code and the code which is providing protection. For example, AES algorithms typically execute the same way all the time, no matter what the input data is. This makes it straightforward for an attacker to know what he is looking for and where to find it. Most white box protection systems have a rigid equation structure which does not address this type of problem. That is, an attacker may know what types of operations or effects to look for, and where in code or execution to look to find those operations or effects. In contrast, embodiments disclosed herein may provide coding which is not rigid, such as where each iteration of a protection algorithm results in a different encoding. Thus, the system is extremely non-repeatable. Among other things, this may make embodiments disclosed herein more resistant to a “compare” type attack, in which an attacker changes 1 bit and observes how the targeted program changes. In some embodiments disclosed herein, if an attacker changes 1 bit, then the protected code will look completely different.
As a matter of overview, the embodiments of tools, families of tools, and techniques described herein may generally be grouped as follows:
The obfuscation techniques described herein may be implemented wherever the overhead can be accommodated. White box protection systems typically have larger overheads than the techniques described herein, and are therefore at a disadvantage.
Some embodiments include systems and techniques for software protection that operate by applying bijective “base” functions to the targeted code. These base functions are pairs of mutually-inverse functions ƒK, ƒK−1 which are used, for example, to encode an operation, and then un-encode the operation at a later point in a software application. The encoding obscures the original function and the data which it generates. There is no loss of information, as the unencoding operation accommodates for the encoding operation, “undoing” or “reversing” its effect later in the encoded application. Base function pairs may be chosen such that an attacker cannot easily find or determine the inverse function. That is, given a function ƒK, the inverse ƒK−1 may not be found easily without the key K. The key K may be used at code generation time, but then discarded once the functions ƒK, ƒK−1 have been generated and applied to the targeted code. These base function pairs are also lossless, i.e. mathematically invertible. The protected software application does not need to decode a function or process completely to use it elsewhere in the targeted code, as the encoding and unencoding changes are included within the encoded application. In some embodiments it may be preferred that the base functions are “deeply non-linear”, thus making homomorphic attacks more difficult. In some embodiments, base function pairs may include permutation polynomial encodings. A permutation polynomial is a polynomial which is invertible (a polynomial bijection).
Some embodiments may generate or use base function pairs in such a manner that they generate “instance diversity” and “dynamic diversity”. To achieve “instance diversity”, each base function pair may create a secure “communication channel”, such as between portions of a software application, between two software applications or platforms, or the like. Dynamic diversity may be created by linking operation of the software to the input data. Each time an encoding is performed, such as for communication between two encoded applications, instance and dynamic diversity may be generated between the two applications. The base functions may be highly “text dependent” so they offer good resistance to plaintext and perturbation attacks. If an attacker changes anything, even making a very small change such as the value of 1 bit, the change will result in a very large behavioural change. This feature is a significant contrast to conventional cipher code, which typically results in the same patterns and structure with each iteration of the code, regardless of the changes that an attacker makes. By making small changes and observing the impact, the attacker is able to gather information about the operation of cipher code, but he is not able to do the same with software encoded using systems and techniques disclosed herein. The diversity provided by embodiments disclosed herein also provides resistance to a “class crack”. That is, it is not possible to provide an attack methodology which can systematically and automatically crack each embodiment of the invention in all cases. Note also, that conventional white box implementations and code optimizers will not provide sufficient diversity to gain any effective protection.
The diversity and non-invertibility of the inventive base functions increase the complexity of the attack problem immensely. In contrast to conventional software code or code protection systems, when attempting to defeat the systems and techniques disclosed herein, an attacker must first figure out what function, code portion, application, or the like he is attacking, then how to invert it, and then how to exploit it.
The diversity provided by embodiments disclosed herein may provide a variable, randomly-chosen structure to protected code. An engine which generates the base function pairs and encodings may rely on a random or pseudo-random key to choose the underlying function and/or the key. However, a key according to embodiments disclosed herein may not be as small as the keys of many conventional security systems (i.e. 64 or 128 bits); rather, it may be thousands or tens of thousands of bits. For example, a prototype was developed which uses 2,000 bits.
The base functions disclosed herein may include bijections used to encode, decode, or recode data. Such bijections may include the following characteristics:
1) Encoding wide data elements (typically four or more host computer words wide), unlike typical scalar encodings (see [5, 7] listed in the Appendix), but like block ciphers.
2) Encoding data only: unlike typical scalar encodings, but like ciphers, they are not required to protect computations other than those involved in their own recoding of data elements.
3) Concealing blocks or streams of data, and/or producing fixed-length hashes of blocks or streams of data for authentication purposes, similar to block ciphers, but unlike scalar encodings.
4) Employing forms of operations purposely chosen from the operation repertoire of the software in which they will reside and with which they will be interlocked; i.e., they are designed to resemble the code in the context of which they are embedded, unlike ciphers.
5) Unlike both ciphers and scalar encodings, employing massive multicoding. A scalar encoding generally employs one or at most a few mathematical constructions. A cipher typically employs a slightly larger number, but the number is still small. In some embodiments of the invention, a variety of encodings are applied to an entire function, creating an intricately interlaced structure resulting from the interaction of many forms of protection with one another.
6) Unlike both ciphers and scalar encodings providing massively diverse algorithmic architecture. Embodiments may have no fixed number of rounds, no fixed widths for operands of various substeps, no fixed interconnection of the various substeps, and no predetermined number of iterations of any kind.
7) Unlike both ciphers and scalar encodings, providing massive dynamic diversity by means of highly data-dependent algorithms: i.e., for any particular employment of a base function bijection, the path through its substeps, its iteration counts, and the like, depend intensely on the actual data input to be encoded, decoded, or recoded.
8) Unlike both ciphers and scalar encodings, providing massive interdependence with their embedding context; i.e., their behavior may depend strongly on the software in which they are embedded, and the software in which they are embedded can be made to depend strongly on them.
Some embodiments may use a large quantity of real entropy (i.e., a large truly random input). However, if an engine which generates the base function pairs is not itself exposed to attackers, it may be safe to employ significantly smaller keys which then generate much larger pseudo-random keys by means of a pseudo-random number generator, since in that case, the attacker must contend with both the real key entropy (that for the seed to the pseudo-random number generator) and the randomness inevitably resulting from the programming of the generator.
In some embodiments, biased permutations may also be used. If internal data is used to generate base function pairs or other encoding data/functions rather than random numbers, then the resulting encoding will contain bias. If code is introduced to create unbiased permutations that coding may be readily apparent, resulting in a weakness in the system. In contrast, embodiments disclosed herein may generate biased permutations, but then use various tools to make them less biased. This approach has been shown to be much less apparent than known techniques.
Some embodiments may include techniques for binding pipe-starts and pipe-ends, so that the targeted software code is tied to applications or platforms at both ends. This may be useful, for example, in a peer-to-peer data transfer environment or a digital rights management (DRM) environment. Systems and techniques disclosed herein also may be used to tie ciphers to other software applications or platforms, which is generally difficult to do using conventional techniques.
Some embodiments may use “function-indexed interleaving”. This technique provides deep nonlinearity from linear components, and nonlinear equation solving. It can be used in many ways, such as boundary protection, dynamic constant generation (e.g. key-to-code), providing dynamic diversity (data-dependent functionality), self-combining ciphers, cipher mixing and combining ciphers and non-ciphers. For example, it may be used to mix black box ciphers with the other protection code disclosed herein, providing the long term security of a black box cipher, with the other benefits of white box security. As noted above, the encoding of the embodiments disclosed herein may be highly dependent on run-time data. With function index interleaving, two kinds of information are used: a key, K, which determines the base functions and structure, and R, which determines which obfuscations are to be applied to the “defining implementations”. Typically the client does not see R. The key, K, may be augmented from the context, though in some examples described herein, only R is augmented in this way. Optionally, semi-consistent information or data from a user or his device (such as a smart phone, tablet computer, PDA, server or desktop computer system, or the like) such as an IP address, could be used to encode and decode as a runtime key.
Recursive function-indexed interleaving also may be used. Function-indexed interleaving typically interleaves arbitrary functions. If some of these functions are themselves functions obtained by function-indexed interleaving, then that is a recursive use of function-indexed interleaving.
Some embodiments may include random cross-linking, cross-trapping, dataflow duplication, random cross-connection, and random checks, combined with code-reordering, create omni-directional cross-dependencies and variable-dependent coding.
Some embodiments may use memory-shuffling with fractured transforms (dynamic data mangling) to hide dataflow may also be employed. In dynamic data mangling, an array A of memory cells may be used which can be viewed as having virtual indices 0, 1, 2, . . . , M−1 where M is the size of the array and the modulus of a permutation polynomial p on the finite ring Z/(M) (i.e., the integers modulo M), as in a C program array. However, for any given index i, there is no fixed position in the array to which it corresponds, since it is addressed as p(i), and p employs coefficients determined from the inputs to the program. The locations A[p(0)], A[p(1)], . . . , A[p(M−1)] may be considered “pseudo-registers” R1, . . . , RM−1 extending those of the host machine. By moving data in and out of these registers, recoding the moved data at every move, and by re-using these “pseudo-registers” for many different values (e.g., by employing graph-coloring register allocation), the difficulty for an attacker to follow the data-flow of the program may be greatly increased.
Some embodiments may use “spread and blend” encoding. This is another way of describing the use of base functions plus code interleaving, which “smears out” the boundaries of the base functions to make them more difficult for an attacker to discern. General data blending may have portions of base functions that are mixed with other code, making it more difficult to identify and lift the code.
Some embodiments provide security lifecycle management. Black box security provides good long-term protection, but is not very useful in today's applications. Embodiments disclosed herein may refresh implementations faster than they can be cracked on unprotected devices. Different devices and applications have different needs. For example, a pay-per-view television broadcast such as a sporting event, may have very little value several days after the event, so it may only be necessary to provide sufficient security to protect the broadcast data for a day or so. Similarly, the market for computer games may tail off very quickly after several weeks, so it may be critical only to protect the game for the first few weeks or months. Embodiments disclosed herein may allow a user to apply the level of security that is required, trading off the security against performance. Literally, an adjustable “obfuscation dial” can be placed on the control console. Although the specific defined level of security achieved may be unknown, the intensity with which obfuscating methods are applied may be controlled. Generally, these settings may be adjusted when the application is created with its embedded base function, as part of a software development process. Security analysis may provide an estimate of how difficult the application will be to crack given a specific level of obfuscation. Based on the estimate, an engineering decision may be made of how to balance performance needs against the need for security, and “obfuscation dial” may be set accordingly. This kind of flexibility is not available with other protection systems. With AES, for example, a fixed key length and fixed code is used, which cannot be adjusted.
Some embodiments may provide a flexible security refresh rate, allowing for a trade-off of complexity for the “moving target” of refreshing code. In many cases, the need is to refresh fast enough to stay ahead of potential attackers.
Some embodiments may not have a primary aim of providing long-term data security in hacker-exposed environments. For that, the solution is not to expose the data to hackers, but only to expose means of access to the data by, e.g., providing a web presence for credential-protected (SecureID(TM), pass-phrases, etc.) clients which access the data via protected conversations which can expose, at most, a small portion of the data. In a hacker-exposed environment, it may be expected that a process of refreshing the exposed software in some fashion will be deployed. For example, in satellite TV conditional access systems, cryptographic keys embedded in the software in the set-top boxes (STBs) are refreshed on a regular basis, so that any compromise of the keys has value for only a limited period of time. Currently, such cryptographic keys may be protected over this limited exposure period by means of software obfuscation and/or white-box cryptography.
However, white-box cryptography has proven to be vulnerable to attacks which can be executed very swiftly by cryptographically-sophisticated attackers with expert knowledge of the analysis of executable programs, since the cryptographic algorithms employed are amongst the most thoroughly examined algorithms in existence, and the tools for analysing programs have become very sophisticated of late as well. Moreover, ciphers have peculiar computational properties in that they are often defined over arithmetic domains not normally used in computation: for example, AES is defined over a Galois field, RSA public-key cryptosystems are defined by modular arithmetic over extremely large moduli, 3DES over bit operations, table lookups, and bit-permutations extended with duplicated bits.
In fact, the sophisticated analysis of programs has created a method of attack which sometimes can bypass the need for cryptanalysis altogether: the code-lifting attack, whereby the attacker simply extracts the cryptographic algorithm and employs it with no further analysis (since it is, after all, an operational piece of software, however obfuscated it may be) to crack a software application's functionality.
Some embodiments may provide much stronger short-term resistance to attack. Such protection may be suitable for systems where the time over which resistance is needed is relatively short, because longer term security is addressed by means of refreshing the software which resides on the exposed platforms. This addresses a specific unfilled need which focusses at the point of tension created by highly sophisticated cryptanalytic tools and knowledge, extremely well studied ciphers, limited protections affordable via software obfuscation, highly sophisticated tools for the analysis of executable programs, and the limited exposure times for software in typical commercial content distribution environments. The goal is to prevent the kinds of attacks which experience with white-box cryptography has shown to be within the state of the art: swift cryptanalytic attacks and/or code-lifting attacks so swift that they have value even given the limited lifespans of validity between refreshes of the exposed programs (such as STB programs).
In many cases, it is only necessary to resist analysis for the duration of a refresh cycle, and to tie cipher-replacement so tightly to the application in which it resides that code-lifting attacks are also infeasible for the duration of a refresh cycle. The refresh cycle rate is determined by engineering and cost considerations: how much bandwidth can be allocated to refreshes, how smoothly we can integrate refreshes with ongoing service without loss of quality-of-service, and so on: these are all problems very well understood in the art of providing conditional access systems. These considerations indicate roughly how long our protections must stand up to analytic and lifting attacks.
Some embodiments may provide significantly larger encodings which can resist attacks for longer periods of time, by abandoning the notion of computing with encoded operands—as is done with the simpler encodings above—and replacing it with something more like a cipher. Ciphers themselves can be, and are, used for this purpose, but often they cannot easily be interlocked with ordinary software because (1) their algorithms are rigidly fixed by cipher standards, and (2) their computations are typically very different from ordinary software and therefore are neither readily concealed within it, nor readily interlocked with it. The base-functions described herein provide an alternative which permits concealment and interlocking: they make use of conventional operations, and their algorithms are enormously more flexible than is the case with ciphers. They can be combined with ciphers to combine a level of black-box security as strong as conventional cryptography with a level of white-box security significantly superior to both simple encodings as above and known white-box cryptography.
In some embodiments, a base function may be created by selecting a word size w and a vector length N, and generating an invertible state-vector function configured to operate on an N-vector of w-element words, which includes a combination of multiple invertible operations. The state-vector function may receive an input of at least 64 bits and provides an output of at least 64 bits. A first portion of steps in the state-vector function may perform linear or affine computations over Z/(2w). Portions of steps in the state-vector function may be indexed using first and second indexing techniques. At least one operation in an existing computer program may then be modified to execute the state-vector function instead of the selected operation. Each of the indexing techniques may control a different indexing operation, such as if-then-else constructs, switches, element-permutation selections, iteration counts, element rotation counts, function-indexed key indexes, or the like. Some of the steps in the state-vector function may be non-T-function operations. Generally, each step in the state-vector function may be invertible, such that the entire state-vector function is invertible by inverting each step. In some configurations the state-vector function may be keyed using, for example, a run-time key, a generation-time key, or a function-indexed key. The state-vector function may be implemented by various operation types, such as linear operations, matrix operations, random swaps, or the like. Various encoding schemes also may be applied to inputs and/or outputs of the state-vector function, and/or operations within the state-vector function. In some configurations, different encodings may be applied to as to produce fractures at various points associated with the state-vector function.
In some embodiments, base functions as disclosed herein may be executed by, for example, receiving an input having a word size w, applying an invertible state-vector function configured to operate on N-vectors of w-element words to the input, where the state-vector function includes multiple invertible operations, and a first portion of steps in the state-vector function perform linear or affine computations over Z/(2w). Additional operations may be applied to the output of the invertible state-vector function, where each is selected based upon a different indexing technique. Generally, the state-vector function may have any of the properties disclosed herein with respect to the state-vector function and base functions.
In some embodiments, a first operation may be executed by performing a second operation, for example, by receiving an input X encoded as A(X) with a first encoding A, performing a first plurality of computer-executable operations on the input using the value of B−1(X), where B−1 is the inverse of a second encoding mechanism B, the second encoding B being different from the first encoding A, providing an output based upon B−1(X). Such operation may be considered a “fracture”, and may allow for an operation to be performed without being accessible or visible to an external user, or to a potential attacker. In some configurations, the output of the first operation may not be provided external to executable code with which the first operation is integrated.
In some embodiments, for a matrix operation configured to receive an input and provide an output, prior to performing the operation, the input may be permuted according to a sorting-network topology. The matrix operation may be executed using the permuted input to generate the output, and the output permuted according to the sorting-network topology. The permuted output then may be provided as the output of the matrix operation.
In some embodiments, a first input may be received, and a function-indexed interleaved first function applied to the first input to generate a first output having a left portion and a right portion. A function-index interleaved second function may be applied to the first output to generate a second output, where the left portion of the first output is used as a right input to the second function, and the right portion of the first output is used as a left input to the second function. The second output may then be provided as an encoding of the first input.
In some embodiments, a key K may be generated, and a pair of base functions ƒK, ƒK−1 generated based upon the key K and a randomization information R. The base function ƒK may be applied to a first end of a communication pipe, and the inverse ƒK−1 to a second end of the communication pipe, after which the key K may be discarded. The communication pipe may span applications on a single platform, or on separate platforms.
In some embodiments, one or more operations to be executed by a computer system during execution of a program may be duplicated to create a first copy of the operation or operations. The program may then be modified to execute the first operation copy instead of the first operation. Each operation and the corresponding copy may be encoded using a different encoding. Pairs of operations also may be used to create a check value, such as where the difference between execution of an operation result and execution of the copy is added to the result of the operation or the result of the operation copy. This may allow for detection of a modification made by an attacker during execution of the program.
In some embodiments, during execution of a program that includes multiple operations and a copy of each operation, upon reaching an execution point at which an operation of the plurality of operations should be performed, either a copy or the original operation may be selected randomly and executed by the program. The result of the randomly-selected operations may be equivalent to a result that would have been obtained had only a single copy of the operations been performed.
In some embodiments, an input may be received from an application. An array of size M may be defined with a number of M-register locations c1, . . . , cn, with n≦M. A permutation polynomial p, an input-based 1×n vector mapping matrix A yielding z from the input, and a series of constants ci=p(z+i) also may be defined. A series of operations may then be performed, with each operation providing an intermediate result that is stored in an M-register selected randomly from the M-registers. A final result may then be provided to the application based upon the series of intermediate results from a final M-register storing the final result. Each intermediate result stored in an M-register, may have a separate encoding applied to the intermediate result prior to storing the intermediate result in the corresponding M-register. The different encodings applied to intermediate results may be randomly chosen from among multiple different encodings. Similarly, different decodings, which may or may not correspond to the encodings used to store intermediate results in the M-registers, may be applied to intermediate results stored in M-registers. New M-registers may be allocated as needed, for example, only when required according to a graph-coloring allocation algorithm.
In some embodiments, a first operation g(y) that produces at least a first value a as an output may be executed, and a first variable x encoded as aX+b, using a and a second value b. A second operation ƒ(aX+b) may be executed using aX+b as an input, and a decoding operation using a and b may be performed, after which a and b may be discarded. The value b also may be the output of a third operation h(z). Different encodings may be used for multiple input values encoded as aX+b, using different execution instances of g(y) and/or h(z). The values may be selected from any values stored in a computer-readable memory, based upon the expected time that the constant(s) are stored in the memory. Similarly, existing computer-readable program code containing instructions to execute an operation ƒ(aX+b) and g(y), and g(y) produces at least a first value c when executed; may be modified to encode x as cX+d. The operation ƒ(cX+d) may be executed for at least one x, and c and d subsequently discarded.
In some embodiments, at least one base function may be blended with executable program code for an existing application. For example, the base function may be blended with the executable program code by replacing at least one operation in the existing program code with the base function. The base function also may be blended with the existing application by applying one, some, or all of the techniques disclosed herein, including fractures, variable dependent coding, dynamic data mangling, and/or cross-linking. The base functions and/or any blending techniques used may include, or may exclusively include, operations which are similar or indistinguishable from the operations present in the portion of the existing application program code with which they are blended. Thus, it may be difficult or impossible for an attacker to distinguish the base function and/or the blending technique operations from those that would be present in the existing executable program code in the absence of the base function.
In some embodiments, a computer system and/or computer program product may be provided that includes a processor and/or a computer-readable storage medium storing instructions which cause the processor to perform one or more of the techniques disclosed herein.
Moreover, because the algorithms used with base functions disclosed herein may be relatively flexible and open-ended, they permit highly flexible schemes of software diversity, and the varied instances can differ more deeply than is possible with white-box cryptography. Thus, they are far less vulnerable to automated attacks. Whenever attacks can be forced to require human participation, it is highly advantageous, because we can new instances of protected code and data may be automatically generated at computer speeds, but they can only be compromised at human speeds.
Other systems, methods, features and advantages of the invention will be, or will become, apparent to one with skill in the art upon examination of the following figures and detailed description. It is intended that all such additional systems, methods, features and advantages be included within this description, be within the scope of the invention, and be protected by the following claims.
In the appended drawings:
Table 25 presents a table which categorizes software boundary problems;
Embodiments disclosed herein describe systems, techniques, and computer program products that may allow for securing aspects of computer systems that may be exposed to attackers. For example, software applications that have been distributed on commodity hardware for operation by end users may come under attack from entities that have access to the code during execution.
Generally, embodiments disclosed herein provide techniques to create a set of base functions, and integrate those functions with existing program code in ways that make it difficult or impossible for a potential attacker to isolate, distinguish, or closely examine the base functions and/or the existing program code. For example, processes disclosed herein may receive existing program code, and combine base functions with the existing code. The base functions and existing code also may be combined using various techniques such as fractures, dynamic data mangling, cross-linking, and/or variable dependent coding as disclosed herein, to further blend the base functions and existing code. The base functions and other techniques may use operations that are computationally similar, identical, or indistinguishable from those used by the existing program code, which can increase the difficulty for a potential attacker to distinguish the protected code from the protection techniques applied. As will be described herein, this can provide a final software product that is much more resilient to a variety of attacks than is possible using conventional protection techniques.
As shown in
Software boundary problems may be organized into five groups as shown in Table 1: skin problems, data boundaries, code boundaries, boundaries between protected data and protected code, and boundaries between protected software and secured hardware.
There are three types of “skin problems” which may be addressed by embodiments disclosed herein: data flows from unprotected to protected domains, data flows from protected to unprotected domains, and computation boundaries between unprotected and protected domains. Ultimately, data and user interaction should be performed in an unencoded form, so that the user can understand the information. In each case, attacks on unprotected data and computations can be the starting point for compromising their data and computation counterparts in the protected domain. These problems conventionally are hard to solve without introducing a trusted enabling mechanism at the boundary. However, the diversity provided by embodiments disclosed herein, and encoding at the boundary itself, provides a degree of protection that is not provided by known systems.
Data Boundaries may be categorized as one of three types: data type boundaries, data dependency boundaries and data crossing functional component boundaries. With regard to data type boundaries, current data transformation techniques are limited to individual data types, not multiple data types or mass data. The boundaries among distinct protected data items stand out, permitting identification and partitioning. With regard to data dependency boundaries, data diffusion via existing data flow protections is limited: original data flow and computational logic is exposed. Most current white box cryptography weaknesses are related to both data type and data dependency boundary problems. Finally, with regard to data crossing functional component boundaries, data communications among functional components of an application system, whether running on the same or different devices, or as client and server, are made vulnerable because the communication boundaries are clearly evident. The use of base function encodings and function-indexed interleaving by embodiments disclosed herein may address some or all of these data boundary issues because both the data and the boundaries themselves may be obscured.
Code Boundaries may be categorized into two types: functional boundaries among protected components, and boundaries between injected code and the protected version of the original application code. Functional boundaries among protected components are a weakness because boundaries among functional components are still visible after protecting those components. That is, with white box protection, the white box cryptographic components can generally be identified by their distinctive computations. In general, such protected computation segments can be easily partitioned, creating vulnerabilities to component-based attacks such as code lifting, code replacement, code cloning, replay, code sniffing, and code spoofing. Similarly, boundaries between injected protection code and the protected version of the original application code are also generally visible. Current individual protection techniques create secured code that is localized to particular computations. Code boundaries resulting from use of different protection techniques are not effectively glued and interlocked. In contrast, the use of base function encodings and function-indexed interleaving by embodiments disclosed herein may address all of these code boundary issues, because code may be obscured and interleaved with the protection code itself. Because basic computer processing and arithmetic functions are used for the protection code, there is no distinctive code which the attacker will quickly identify.
The boundary between protected data and protected code presents another weakness which can be exploited by an attacker as current white box techniques do not secure the boundary between protected data and protected code. In contrast, embodiments disclosed herein may lock together the protected data and protected code, to prevent code or data lifting attacks. Current white box cryptography implementations are vulnerable to such lifting attacks in the field.
Similarly, the boundary between protected software and secured hardware presents a vulnerability as existing white box techniques do not protect the boundary between protected software and secure hardware—data crossing such a boundary is unprotected or weakly protected. In contrast, embodiments disclosed herein may lock protected hardware and protected software to one another.
There are also logistical issues associated with security, in particular, diversity and renewability problems. Current program diversity is limited by program constructs and structures, and by limitations of the individual protection techniques applied. As a result, diversified instances do not vary deeply (e.g., program structure variation is extremely limited), and instances may be sufficiently similar to permit attacks based on comparing diversified instances. Current protection techniques are limited to static diversity and fixed security. In contrast, embodiments as disclosed herein may provide dynamic diversity which may allow for intelligent control and management of the level of security provided by diversity and renewability. As disclosed in further detail herein, resolving advanced diversity and renewability problems may be fundamental to security lifecycle management.
This may be accomplished, for example, by interleaving the code together between different code and data functions, modules and storage blocks, thus “gluing” these components together. With the code closely tied in this way, true boundary protection can be provided. As described above, diversity and renewability are provided in terms of 1) much greater flexibility being provided than past systems; 2) easy and powerful control; 3) enable dynamic diversity and security; and 4) measurable and manageable diversity. Embodiments disclosed herein also may provide a “complexity property” of one-way bijection functions, as well as a measurable, controllable and auditable mechanism to guarantee required security for the user. Bijections are described in greater detail hereinafter, but in short, they are lossless pairs of functions, ƒK, ƒK−1, which perform a transposition of a function, which is undone later in the protected code. The transposition may be done in thousands or millions of different ways, each transposition generally being done in a completely different and non-repeatable manner. Various techniques may be used to conceal existing programs, achieving massive multicoding of bijective functions, which are not humanly programmed, but are generated by random computational processes. This includes bijective functions which can be used in cipher- and hash-like ways to solve boundary problems.
Embodiments disclosed herein may provide improved security and security guarantees (i.e. validated security and validated security metrics) relative to conventional techniques. Greater diversity in time and space than is provided by white box cryptography also may be achieved. The security metrics are based on computational complexity of known attacks, the basic primitive being the generation of mutually inverse function pairs. Other primitives can be constructed as described herein, with or without symmetric or asymmetric auxiliary keys.
In contrast, embodiments disclosed herein may incorporate Cipher-like and Hash-like encodings, which gives the protective encodings the security and strength of Ciphers and Hashes. In other words, the process of applying white box encodings to Ciphers and Hashes typically uses simple encodings in an attempt to protect and obscure very distinctive code. The techniques disclosed herein, however, may use strong, diverse encodings to protect any code. With the diverse encodings and interleaving as disclosed, distinctiveness in the targeted code will be removed. Thus, as shown, the disclosed techniques may provide a much stronger security profile than conventional black box and white box protection.
The base functions disclosed herein may serve in place of either ciphers or hashes, as it is hard to determine the key or keys from consideration of the encoding and unencoding functions ƒK, ƒK−1. The advantage that the base functions provide over the use of Ciphers or Hashes, is that the computations used by the base functions are more similar to ordinary code, which makes it easier to blend the code of the base functions with the targeted code. As noted above, Ciphers and Hashes use very distinctive code and structure which is difficult to obscure or hide, resulting in vulnerability.
Mutually-inverse base function pairs as disclosed herein may employ random secret information (entropy) in two ways: as key information K which is used to determine the mutually inverse functions ƒK, ƒK−1, and as randomization information R which determines how the ƒK, ƒK−1 implementations are obscured.
For example, two mutually inverse base functions may be represented by subroutines G and H, written in C. The base functions may be constructed by an automated base function generator program or system, with G being an obfuscated implementation of the mathematical function ƒK and H being an obfuscated implementation of the mathematical function ƒK−1. Thus, G can be used to ‘encrypt’ data or code, which can then be ‘decrypted’ with H (or vice versa).
Optionally, run-time keys can be provided in additional to the build-time key K. For example, if the input of a given base function is wider than the output, the extra input vector elements can be used as a run-time key. This is much like the situation with a cipher such as AES-128. A typical run of AES-128 has two inputs: one is a 128-bit key, and one is a 128-bit text. The implementation performs encipherment or decipherment of the text under control of the key. Similarly, a base-function can be constructed to encrypt differently depending on the content of its extra inputs, so that the extra inputs in effect become a runtime key (as opposed to the software generation time key K controlling the static aspects of the base function). The building blocks of base functions disclosed herein make it relatively easy to dictate whether the runtime key is the same for the implementations of both ƒK, ƒK−1 or is different for ƒK than for ƒK−1: if the runtime key is added to the selector vector, it is the same for ƒK and ƒK−1, and if it is added elsewhere, it differs between ƒK and ƒK−1.
Key information K can be used to select far more varied encoding functions than in known white box systems, permitting much stronger spatial and temporal diversity. Diversity is also provided with other techniques used in embodiments of the invention such as Function-Indexed Interleaving which provides dynamic diversity via text-dependence. Further diversity may also be provided by variants of Control-Flow Encoding and Mass-Data Encoding described hereinafter.
Base functions as disclosed herein may incorporate or make use of state vector functions. In general, as used herein a state-vector function is organized around a vector of N elements, each element of which is a w-bit quantity. The state vector function may be executed using a series of steps, in each of which a number between zero and N of the elements of the vector are modified. In a step in which zero elements are modified, the step essentially applies the identity function on the state-vector.
In some embodiments, one or more of the state-vector functions used in constructing a base function may be invertible. A state-vector function is invertible if, for each and every step in the state-vector function, a step-inverse exists such that that applying the step-algorithm and then applying the step-inverse algorithm has no net effect. Any finite sequence of invertible steps is invertible by performing the inverse-step algorithms in the reverse order of their originals.
Illustrative examples of invertible steps on a vector of w-bit elements include adding two elements, such as adding i to j to obtain i+j, multiplying an element by an odd constant over Z/(2w), mapping a contiguous or non-contiguous sub-vector of the elements to new values by taking the product with an invertible matrix over Z/(2w). The associated inverse steps for these examples are subtracting element i from element j, multiplying the element by the multiplicative inverse of the original constant multiplier over Z/(2w), and mapping the sub-vector back to its original values by multiplying by the inverse of that matrix, respectively.
Some embodiments may use one or more state-vector functions that have one or more indexed steps. A step is indexed if, in addition to its normal inputs, it takes an additional index input such that changing the index changes the computed function. For example, the step of adding a constant vector could be indexed by the constant vector, or the step of permuting a sub-vector could be indexed by the permutation applied. In each case, the specific function executed is determined at least in part by the index provided to the function.
Indexed steps also may be invertible. Generally, an indexed step is invertible if it computes an invertible step for each index, and the index used to compute the step, or information from which that index can be derived, is available when inverting the step. For example, S17 is invertible if S17−1 is defined, and the index (17) is available at the appropriate time to ensure that it S17−1 is computed when inverting the state-vector function. As an example, a step may operate on some elements of the state. To index this step, other elements of the state may be used to compute the index. If invertible steps are then performed on the other elements, the index by may be retrieved by inverting those steps, as long as the two sets of elements do not overlap.
Function-Indexed Interleaving as disclosed herein is a specific example of the principle of the use of indexed steps within a base function. Other uses of indexed steps as disclosed herein may include: allowing the creation of keyed state-vector functions: the set of indexes used in some of the indexed steps can be used as a key. In that case, the index is not obtained from within the computation, but is provided by an additional input; i.e., the function takes the state-vector plus the key as an input. If the indexed steps are invertible, and the ordinary, non-indexed steps are invertible, then the whole state-vector function is invertible, rather like a keyed cipher.
In some embodiments, the index information may provide or may serve as a key for the generated base functions. If the state-vector function is partially evaluated with respect to the index information when the state-vector function is generated, so that the index does not appear in the execution of the generated function explicitly, it is a generation-time key. If code to handle the index information is generated during execution of the state-vector function, so that the index does appear in the execution of the generated function explicitly, it is a run-time key. If the code internally generates the index within the state-vector function, it is a function-indexed key.
In an embodiment, a base function may be constructed based upon an initial selected or identified word-size w. In some configurations, the default integer size of the host platform may be used as the word size w. For example, on modern personal computers the default integer size typically is 32 bits. As another example, the short integer length as used, for example, in C may be used, such as 16 bits. In other configurations, a 64-bit word size may be used. A vector length N is also selected for the base function, which represents the length of inputs and outputs in the w-sized words, typically encompassing four or more words internally. In some embodiments, such as where interleaving techniques as disclosed herein are used, it may be preferred for the word size w to be twice the internal word size of the N-vector. The state-vector function then may be created by concatenating a series of steps or combinations of steps, each of which performs invertible steps on N-vectors of w-element word. The inverse of the state-vector function may be generated by concatenating the inverses of the steps in the reverse order.
In some embodiments, one or more keys also may be incorporated into the state-vector function. Various types of keying may be applied to, or integrated with, the state-vector function, including run-time keying, generation-time keying, and function-indexed keying as previously described. To generate a run-time keyed state-vector function, the function may be modified to receive the key explicitly as an additional input to the function. To generate a generation-time keyed state-vector function, code in the state-vector function may be partially evaluated with respect to a provided key. For many types of operations, this alone or in conjunction with typical compiler optimizations may be sufficient to make the key unrecoverable or unapparent within the generated code. To generate a function-indexed keyed state-vector function, the state-vector function may be constructed such that appropriate keys for inverse operations are provided as needed within the state-vector function.
In some embodiments, it may be preferred to select an implementation for the state-vector function that accepts a relatively wide input and provides a relatively wide output, and which includes a complex set of invertible steps. Specifically, it may be preferred to construct an implementation that accepts at least a 64-bit wide input and output. It also may be preferred for a significant number of steps in the state-vector function, such as at least 50% or more, to be linear or affine operations over Z/(2w). It also may be preferred to select steps for the state-vector function which have wide variety
In some embodiments, it may be preferred to index a significant portion of the steps, such as at least 50% or more, using multiple forms of indexing. Suitable forms of indexing include if-then-else or switch constructs, element-permutation selection, iteration counts, element rotation counts, and the like. It also may be preferred for some or all of the indexes to be function-indexed keys as disclosed herein.
In some embodiments, it may be preferred for the initial and/or final steps of the state-vector function to be steps which mix input entropy across the entire state-vector, typically other than any separate key-input.
In some embodiments, it may be preferred to construct the state-vector function such that at least every few steps, a non-T-function step is performed. Referring to programming operations, examples of T-function steps include addition, subtraction, multiplication, bitwise AND|, bitwise XOR, bitwise NOT, and the like; examples of non-T-function steps include division, modulo assignment, bitwise right shift assignment, and the like. Other examples of non-T-function steps include function-indexed keyed element-wise rotations, sub-vector permutations, and the like. As previously disclosed, the inclusion of non-T-function steps can prevent or reduce the efficacy of certain types of attacks, such as bit-slice attacks.
As previously described, a state-vector function pair includes the state-vector function as described herein and the complete inverse of the state-vector function. In operation, construction of the state-vector function pair may, but need not be performed by, for example, combining a series of parameterized algorithms and/or inverse algorithms in the form of language source such as C++ code or the like. Similarly, substitution of generation-time keys may, but need not be performed by a combination of macro substitution in the macro preprocessor, function in-lining, and use of parameterized templates. Such combinations, substitutions, and other operations may be automated within a state-vector generating system as disclosed herein. Once the state-vector function pair has been generated, one or both may be protected using binary- and/or compiler-level tools to further modify the generated code. In some embodiments, the specific modifications made to one or both functions in the state-vector function pair may be selected based upon whether or not each member is expected to execute in an environment likely to be subject to attack.
For example, in some embodiments, the function or a part of the function that is expected to be in an exposed environment may be bound near a point at which an input vector is provided to the state-vector function, and/or near the point where an output vector is consumed by its invoking code. The code may be bound by, for example, the use of dynamic data mangling and/or fractures as disclosed herein. For example, the inputs provided may be from a mangled store, and outputs may be fetched by an invoker from the mangled store. Other techniques may be used to bind code at these points, such as data-flow duplication with cross-linking and cross-trapping as disclosed herein. Different combinations may be used, such as where dynamic data mangling, fractures, and data-flow duplication are all applied at the same point to bind the code at that point. The protections applied to code expected to be in an exposed environment may be applied within one or both of the state-vector function, with the portion of the code affected determined by the needed level of security. For example, applying multiple additional protection types at each possible point or almost each possible point may provide maximal security; applying a single protection at multiple points, or multiple protection types at only a single code point, may provide a lower level of security but improved performance during code generation and/or execution. In some embodiments, fractures may be applied at multiple points throughout the generation and binding process, because many opportunities for fracture creation may exist due to generation of many linear and affine operations among the steps of the state-vector function during its construction.
In some embodiments, it may be useful to make one member of a state-vector function pair more compact than the other. This may be done, for example, by making the other member of the pair more expensive to compute. As a specific example, when one member of a state-vector function pair is to be used on exposed and/or limited-power hardware such as a smart card or the like, it may be preferred for a hardware-resident member of the state-vector function pair to be significantly more compact than in other embodiments disclosed herein. To do so, a corresponding server-resident or other non-exposed member of the state-vector function pair may be made significantly more costly to compute. As a specific example, rather than using a relatively high number of coefficients as disclosed and as would be expected for a state-vector function generation technique as disclosed previously, a repetitious algorithm may be used. The repetitious algorithm may use coefficients supplied by a predictable stream generation process or similar source, such as a pseudo-random number generator that uses a seed which completely determines the generated sequence. A suitable example of such a generator is the a pseudo-random generator based on ARC4. In some embodiments, such as where the available RAM or similar memory is relatively limited, a variant that uses a smaller element size may be preferred. The pseudo-random number generator may be used to generate all matrix elements and displacement-vector elements. Appropriate constraints may be applied to ensure invertibility of the resulting function. To invert, the generated matrices can be reproduced by knowledge of the seed, at the cost of creating the complete stream used in the exposed pair member, reading it in reverse, multiplicatively inverting each matrix, and additively inverting each vector element in a displacement, over Z/(2w). Thus, a limited-resource device such as a smart card may be adapted to execute one of a state-vector function pair, while the system as a whole still receives at least some of the benefits of a complete state-vector function system as disclosed herein.
Securing Communication Pipes
As shown in the block diagram of
An illustrative way of effecting such a process is as follows. Firstly, a key K is generated using a random or pseudo-random process. The base-functions ƒK, ƒK−1 are then generated using the key K and randomization information R. The base functions are then applied to pipe-start and pipe-end so that at run time, the pipe-start computes ƒK, and the pipe-end computes ƒK−1. The key K can then be discarded as it is not required to execute the protected code. In an application such as this, the base-function specifications will be cipher-based specifications for ƒK, ƒK−1 (similar to FIPS-197 for AES encrypt and decrypt). Cloaked base-functions are specific implementations (pipe-start and pipe-end above) of the smooth base-functions designed to foil attempts by attackers to find K, invert a base-function (i.e., break encryption), or break any of the bindings shown above. That is, a smooth base function is one which implements ƒK or ƒK−1 straightforwardly, with no added obfuscation. A cloaked base function still computes ƒK or ƒK−1, but it does so in a far less straightforward manner. Its implementation makes use of the obfuscation entropy R to find randomly chosen, hard to follow techniques for implementing ƒK or ƒK−1. Further examples of techniques for creating and using cloaked base functions are provided in further detail herein.
Function-Indexed Interleaving
To guard against homomorphic mapping attacks, embodiments disclosed herein may use replace matrix functions with functions which are (1) wide-input; that is, the number of bits comprising a single input is large, so that the set of possible input values is extremely large, and (2) deeply nonlinear; that is, functions which cannot possibly be converted into linear functions by i/o encoding (i.e., by individually recoding individual inputs and individual outputs). Making the inputs wide makes brute force inversion by tabulating the function over all inputs consume infeasibly vast amounts of memory, and deep nonlinearity prevents homomorphic mapping attacks.
Some embodiments may use “Function-Indexed Interleaving”, which may provide diffusion and/or confusion components which are deeply nonlinear. A function from vectors to vectors is deeply nonlinear if and only if it cannot be implemented by a matrix together with arbitrary individual input- and output-encodings. If it is not deeply nonlinear, then it is “linear up to I/O encoding” (“linearity up to I/O encoding” is a weakness exploited in the BGE attack on WhiteBox AES.)
Function-Indexed Interleaving allows conformant deeply nonlinear systems of equations to be solved by linear-like means. It can be used to foster data-dependent processing, a form of dynamic diversity, in which not only the result of a computation, but the nature of the computation itself, is dependent on the data.
In the example implementation shown in
If the triangle and all boxes are linear and chosen at random, then (by observation) over 80% of the constructions are deeply nonlinear.
In an example embodiment disclosed herein, function-indexed interleaving appears four times in an ƒK, ƒK−1 specification. Each time it includes three 4×4 linear mappings for some 4×4 matrix M. Each instance of function-indexed interleaving has a single left-side function and 24=16 right-side functions.
Notably, function-indexed interleaving also may be nested, such that the left-function or right-function-family may themselves be instances of function-indexed interleaving. In such a configuration, the result is a recursive instance of function-indexed interleaving. In general, such instances typically are more difficult for an attacker to understand than non-recursive instances; that is, increasing the level of recursion in function-indexed interleaving should increase the level of obscurity.
A further example embodiment and corresponding mathematical treatment of function-indexed interleaving is provided in Section 2.9, and specifically in Section 2.9.2, of the Appendix, and
Mark I System
Three specific example embodiments are described in detail herein, referred to as the Mark I, II and III systems. An exemplary implementation of the Mark I system is presented in the process flow diagram of
An example embodiment of a Mark I system and corresponding mathematical treatment is provided in Sections 3.5 and 4 of the Appendix and in
However, it has been found that a Mark I type implementation may have two weaknesses that can be exploited in some circumstances:
T-Functions
A function ƒ:(Bw)k→(Bw)m mapping from a k-vector of w-bit words to an m-vector of w-bit words is a T-function if for every pair of vectors xε(Bw)k, yε(Bw)m:−y=ƒ(x), with x′≠x and y′=ƒ(x′), and with bits numbered from 0 to w−1 in the w-bit words, the lowest numbered bit in an element word at which y and y′ differ is not lower than the lowest numbered bit in an element word at which x and x′ differ.
Thus, a function which is a T-function will have the property that a change to an input element's 2i bit never affects an output element's 2i bit when i>j. Typically, the bit-order numbering within words is considered to be from low-order (20) to high-order (2w−1) bits, regarding words as representing binary magnitudes, so this may be restated as: an output bit can only depend on input bits of the same or lower order. So it may be possible to “slice off” or ignore higher bits and still get valid data. Some embodiments also may incorporate tens of millions of T-functions, in contrast to known implementations which only use hundreds of T-functions. As a result, embodiments disclosed herein may be more resistant to bit slicing attacks and statistical attacks.
Functions composable from Λ, V, ⊕, computed over Bw together with +, −, × over Z/(2w), so that all operations operate on w-bit words, are T-functions. Obscure constructions with the T-function property are vulnerable to bit-slice attacks, since it is possible to obtain, from any T-function, another legitimate T-function, by dropping high-order bits from all words in input and output vectors. The T-function property does not hold for right bit-shifts, bitwise rotations, division operations, or remainder/modulus operations based on a divisor/modulus which is not a power of two, nor does it hold for functions in which conditional branches make decisions in which higher-order condition bits affect the value of lower-order output bits. For conditional branches and comparison-based conditional execution, conditional execution on the basis of conditions formed using any one of the six standard comparisons =, ≠, <, >, ≦, ≧ all can easily violate the T-function condition, and indeed, in normal code using comparison-based branching logic, it is easier to violate the T-function condition than it is to conform to it.
External and Internal Vulnerabilities and Attack-Resistance
By repeatedly applying either of a pair of bijective functions ƒK, ƒK−1 where ƒK, ƒK−1 are T-functions, it may be possible to precisely characterize the computations using a bit-slice attack. In such an attack, the operation of these functions is considered ignoring all but the low-order bits, and then the low-order two bits, and so on. This provides information until the full word size (e.g., 32 bits) is reached, at which point complete information on how the function behaves may be available, which is tantamount to knowledge of the key K. This is an external vulnerability. While the attack gains knowledge of implementation details, it does so without any examination of the code implementing those details, and could be performed as an adaptive known plaintext attack on a black-box implementation.
A less severe external vulnerability may exist if the functions of the pair have the property that each acts as a specific T-function on specific domains, and the number of distinct T-functions is low. In this case, a statistical bucketing attack can characterize each T-function. Then if the domains can similarly be characterized, again, without any examination of the code, using an adaptive known plaintext attack, an attacker can fully characterize the functionality of a member of the pair, completely bypassing its protections, using only black-box methods. Plainly, it may be desirable to have an effective number of distinct T-functions to foil the above attack. In Mark III type implementations, for example, there are over 108 distinct T-functions per segment and over 1040 T-functions over all. Mark III type implementations are described in further detail herein.
In some cases, the pair of implementations may include functions which achieve full cascade, that is, every output depends on every input, and on average, changing one input bit changes half of the output bits. An example of an internal vulnerability may occur in a Mark II type implementation where, by ‘cutting’ the implementation at certain points, it may be possible to find a sub-implementation (a component) corresponding to a matrix such that the level of dependency is exactly 2×2 (in which case the component is a mixer matrix) or 4×4 (in which case it is one of the L, S, or R matrices). Once these have been isolated, properties of linear functions allow very efficient characterization of these matrices. This is an internal attack because it requires non-black-box methods: it actually requires examination of internals of the implementations, whether static (to determine the dependencies) or dynamic (to characterize the matrices by linearity-based analyses).
As a general rule, the more external attacks are prevented, and a potential attacker is forced to rely on increasingly fine-grained internal attacks, the harder the attacker's job becomes, and most especially, the harder the attacks become to automate. Automated attacks are especially dangerous because they can effectively provide class cracks which allow all instances of a given technology to be broken by tools which can be widely distributed.
Thus embodiments disclosed herein may provide, by means of of variable and increasingly intricate internal structures and increasingly variegated defenses, an environment in which any full crack of an instance requires many sub-cracks, the needed sub-cracks vary from instance to instance, the structure and number of the attacked components varies from instance to instance, and the protection mechanisms employed vary from instance to instance. In this case, automating an attack becomes a sufficiently large task to discourage attackers from attempting it. In the substantial time it would take to build such an attack tool, the deployed protections may have been updated or otherwise may have moved on to a new technology for which the attack-tool's algorithm no longer suffices.
Mark II System
A block diagram of an example Mark II type implementation according to an embodiment is presented in
In an implementation according to a Mark II type embodiment, explicit use of recoding is part of the functionality chosen by K. Right-side recodes and permutations are chosen text-dependently from pairs for a total of 16 configurations per core and 65,536 configurations over all. However, a T-function count of 65,536 over all may be much too low for many cases; even a blind bit-slice attack, which ignores the internal structure and uses statistical bucketing, might suffice to crack the Mark II implementation given sufficient attack time.
The balance of a Mark II type implementation is shown in
The Mark II proposal is similar to Mark I in that it has a fixed internal structure, with only coefficient variations among the base function implementation pairs. Further description regarding the example embodiment of a Mark II implementation and a corresponding mathematical treatment is provided in Section 5.1 of the Appendix.
Mark III System
In contrast to the Mark I and Mark II implementations described above, a Mark III base function design according to an embodiment disclosed herein may include the following properties:
A number of the different defenses that may be used in a Mark III type system are shown graphically in
Further details regarding a Mark III type implementation are provided in Section 6 of the Appendix. A related process for creating an invertible matrix over Z/(2w) is provided in Section 3.3 of the Appendix. As shown and described, initial and/or final mixing stelps also may be used, examples of which are provided in Section 2.8 of the Appendix.
By replacing conditional swaps with 2×2 bijective matrices mixing each input into each output, we can take precisely the same network topology and produce a mixing network which mixes every input of a base function with every other initially, and we can employ another such network finally to mix every output of the base function with every other. As noted above the mixing is not entirely even, and its bias can be reduced with conditional swaps replaced by mixing steps. A segment's input and output vectors also may be subdivided, for example as described in further detail in Sections 6.2.3-6.2.7 of the Appendix, and as illustrated in
Data-Flow Duplication
Some embodiments may include data flow duplication techniques. For example, as described below, for every instruction which is not a JUMP . . . , ENTER, or EXIT, the instruction may copied so that an original instruction is immediately followed by its copy, and new registers may be chosen for all of the copied instructions such that, if x and y are instructions, with y being the copy of x,
1) if x inputs the output of an ENTER instruction, then the corresponding y input uses the same output;
2) if x inputs the output of an original instruction u with copy v, then the corresponding input of y inputs from the v output corresponding to the u output from which x inputs; and
3) if x outputs to an EXIT instruction, then the corresponding output of y outputs to a a special unused sink node indicating that its output is discarded.
Thus, all of the computations except for the branches have an original and a copy occurrence.
To accomplish this transformation, we proceed as follows.
We add a new instruction JUMPA (‘jump arbitrarily’), which is an unconditional branch with two destinations in control-flow graph (cfg) form, just like a conditional branch, but with no input: instead, JUMPA chooses between its two destinations at random. JUMPA is not actually part of the VM instruction set, and no JUMPA will occur in the final obfuscated implementation of ƒK or ƒK−1.
We use JUMPA in the following transformation procedure:
1) If the implementation is not in SMA (static multi-assignment) form already, convert it to SMA form;
2) For each of BB Xi of the BB's in the implementation X1, . . . , Xk, replace it with three BBs Ci, Xi, X′i by creating a new BB X′i which is identical to Xi, and adding a new BBCi which contains only a single JUMPA instruction targeting both Xi and X′i, making Xi and X′i the two targets of Ci's JUMPA, and making every non-JUMPA branch-target pointing to Xi point to Ci instead.
3) Convert the implementation to SSA form (static single assignment), isolating the local data-flow in each Xi and X′i, although corresponding instructions in Xi and X′i still compute identical values.
4) Merge all of the code in each X′i back into its Xi, alternating instructions from Xi and X′i in the merge so that corresponding pairs of instructions are successive: first the Xi instruction, and then the corresponding X′i instruction.
5) Make each branch-target which is a Ci point to the corresponding Xi instead, and remove all of the Ci and X′i BBs. At this point, the data-flow has been duplicated, the original shape of the CFG has been restored, and the implementation is free of JUMPA instructions. Remember which instructions correspond in each Xi for future use.
Further details regarding control flow duplication are provided in Section 5.2.6 of the Appendix, and described with respect to
Fractures and Fracture Functions
Generally when an encoded output is produced, it is consumed with exactly the same encoding assumed, so that an encoded operation z=ƒ(x, y) becomes z′=ƒ′(x′, y′) where (x′, y′, z′)=(ex(x), ey(y), ez(z)), for encodings ex, ey, ez, and where f ′=ez∘f ∘[ex−1, ey−1].
In some embodiments, it may be advantageous to output a value with one encoding, and subsequently input assuming some other encoding. If x is output as as e1(x), and later consumed assuming encoding e2, in effect we have applied e2−1∘e1 to the unencoded value. Such an intentional mismatch between the encoding in which a value is produced and the encoding assumed when it is consumed is referred to herein as a “fracture.” If the encodings are linear, so is the fracture function e2−1∘e1, and if they are permutation polynomials, so is the fracture function e2−1∘e1.
In some embodiments, fractures may be useful in obfuscation because the computation which they perform effectively does not appear in the encoded code—the amount and form of code to perform a normal networked encoding and one which adds an operation by means of a fracture is identical, and there appears to be no obvious way to disambiguate these cases, since encodings themselves tend to be somewhat ambiguous.
Note that the defining property of a fracture is the fracture function, for example v−1∘u. Generally, there are many different choices of consuming encoding v and producing encoding u which produce exactly the same fracture function. It is quite possible, for example, to have u1, . . . , uk, v1, . . . , vk such that vi−1∘ui is the same fracture function for i=1, . . . , k. Thus, specifying the fracture function does not necessarily specify the producing and consuming encodings which imply it.
Data Scrambling via Mass Data Encoding
Mass Data Encoding (MDE) is described in U.S. Pat. No. 7,350,085, the contents of which are incorporated herein by reference. In short, MDE scrambles memory locations in a hash-like fashion, dynamically recoding memory cells on each store and dynamically recoding and relocating memory cells by background processing. By mismatching fetch and store recodings, a fetch or store can perform an add or multiply while continuing to look like a simple fetch or store. This makes it hard for an attacker to disambiguate between mere obfuscation and useful work.
MDE is compiled, not just interpreted, so supporting data structures are partially implicit and hence, well-obscured. Actual addresses are always scrambled and rescrambled by background activity. As shown in
The initial state of the memory is not produced by hacker-visible activity, and hence conceals how its contents were derived. That is, the initial state is especially obscure.
Control Confusion via Control Flow
Control Flow Encoding (CFE) is described in U.S. Pat. No. 6,779,114, the contents of which are incorporated herein by reference. CFE combines code-fragments into multi-function lumps with functionality controlled by register-switching: many-to-many mapping of functionality to code locations; execution highly unrepeatable if external entropy available: the same original code turns into many alternative executions in CFE code. By modifying the register-switching and dispatch code, key information can control what is executed and therefore control the computation performed by embodiments of the invention.
Code represented by the control-flow graph of
CFE is compiled, not just interpreted, so supporting data structures are partially implicit, and hence, well-obscured. Lumps combine multiple pieces; that is, they have multiple possible functionalities. When a lump is executed, which piece(s) is/are active is determined by which operate via registers pointing to real data, not dummy data. The same piece may occur in multiple lumps, with different data-encodings: mapping from functionalities to code-locations is many-to-many.
The dispatcher can be arranged to select pieces which embody a background process, making it hard to distinguish background and foreground activity. Available entropy is used to determine which alternative way of executing a sequence of pieces is employed, providing dynamic execution diversity (nonrepeating execution). As well, key information can be used to influence dispatch and hence vary the represented algorithm.
Dynamic Data Mangling
As shown in
To do so, first a modulus M, a permutation polynomial p over the mod-M ring, an input-based 1×n vector mapping matrix A yielding z from the inputs, and a series of constant ci=p(z+i) for 1≦i≦M, may be selected, where the ci values are distinct since p is a mod-M perm-polynomial. Locations c1, . . . , cn (with n≦M) are treated in an array X of size M as ‘M-registers’.
During computation, data may be moved randomly into and out of M-registers, and from M-register to M-register, changing encoding at each move. Some embodiments also may randomly cause either the encodings to form an unbroken sequence, or may inject fractures as disclosed herein where encodings do not match.
Given a fracture with data in encoding e1, the input is assumed to be in encoding e2, thus computing the fracture function e3=e2−1∘e1. If e1, e2 are linear, so is e3. If e1, e2 are permutation polynomials, so is e3. The code has identical form whether a fracture is present or not; i.e., it is ambiguous whether or not a fracture is present. Thus, as previously described, fractures may provide a means of injecting hidden computations such that the code looks much the same before and after it is added.
Additional details and mathematical treatment of the use of dynamic data mangling is provided in Section 7.8.14 of the Appendix.
Cross-Linking and Cross-Trapping
The generous application of cross-linking and cross-trapping can provide aggressive chaotic response to tampering and perturbation attacks, with much stronger transcoding and massive static analysis resistance. In an embodiment, cross-linking and cross-trapping may be effected as follows, as illustrated in
An added benefit is that the static dependency graph becomes much denser than that for the original program, making static analysis attacks difficult. Thus, effective tampering requires that the (differently encoded) duplicates be correctly identified and the correct duplicates be changed in effectively the same way under different encodings. This is much harder to accomplish than ordinary tampering without cross-linking and cross-trapping.
An example implementation of data-flow duplication is provided in Section 5.2.8-5.2.10 of the Appendix, and illustrated in
Context-Dependent Coding
In some embodiments, the context in which base function pairs are implemented may be an integral part of the operation of the base-function. Context includes information from the application, hardware, and/or communication. Context of one base-function component can also include information from other components, which are part of the application in which it resides.
Referring to
The implementation may also take inputs from which further constant signature information can be derived and on which the implementation can be made to depend.
Biased Permutations via Sorting Networks
Permutations may provide a basis for storing enormous numbers of alternatives in limited space. For example, row/column permutations may be used to turn a non-repeating 4×4 matrix into 576 non-repeating 4×4 matrices. In some embodiments, the order of computations may be permuted, deep dependence of computations on run-time data may be generated, and the like.
Referring to
Such sorting networks permute in a biased fashion, that is, some permutations are more probable than others, since the number of swap configurations is 2number of stages. However, the permutation count is equal to the number of elements to permute, which does not evenly divide the number of swap-configurations. In spite of the biased output, the advantage is simplicity and high dependency count with non-T functionality.
Unbiased Permutations via Simple Selection
In some embodiments, unbiased permutations can also be generated by selecting a 1st element at random by taking the r1 mod n element among the elements (zero origin), selecting 2nd element at random by taking the r2 mod (n−1) element at random from the remaining elements, and the like. With this process each ri is a full range text-based perm-poly value. This may provide almost perfectly bias-free and non-T-function. However, operations may be harder to hide in or interleave with ordinary code than for sorting-network-based permutation.
Hobbling Bit-Slice Analysis
As explained above, bit-slice attacks are a common attack tool: repeatedly executing a function and ignoring all but the lowest-order bit, and then the lowest-order two bits, the three lowest-order bits, etc. This allows the attacker to gain information until the full word size (say 32 bits) is reached, at which point complete information has been obtained on how the function behaves.
A function constructed using T-function and non-T-function components has subdomains over which it is a T-function embedded in an entire domain in which the function is not. In some embodiment it may be advantageous to make the number of such subdomains very large (for example, in a Mark III type system as described herein, there may be over 1040 such subdomains) to make bucketing attacks on the subdomains highly resource-intensive. In some embodiments, liberal use also may be made of non-T-function computations at other points, such as at decision points, in permutations, in recodings, and the like.
An Example General Data Blending Mechanism
Security-Refresh Rate
For effective application security lifecycle management, applications typically must be capable of resisting attacks on an ongoing basis. As part of this resistance, such applications may be configured to self-upgrade in response to security-refresh messages containing security renewal information. Such upgrades may involve patch files, table replacements, new cryptographic keys, and other security-related information.
A viable level of security is one in which application security is refreshed frequently enough so that the time taken to compromise an instance's security is longer than the time to the security-refresh which invalidates the compromise; i.e., instances are refreshed faster than they can typically be broken. This is certainly achievable at very high security-refresh rates. However, such frequent refresh actions consume bandwidth, and as we raise the refresh rate, the proportion of bandwidth allocated to security-refresh messages increases, and available non-security payload bandwidth decreases.
Plainly, then, engineering the appropriate security-refresh rate is required for each kind of application, since the tolerable overheads vary greatly depending on context. For example, if we expect only gray-box attacks (neighbor side-channel attacks) in a cloud application, we would use a lower refresh rate than if we expected white-box attacks (insider attacks by malicious cloud-provider staff).
Authentication of Equality with Chaotic Failure
Suppose we have an application in which authentication is password-like: authentication succeeds where G, the supplied value, matches a reference value Γ; i.e., when G=Γ. Further suppose that we care about what happens when G=Γ, but if not, we only insist that whatever the authentication authorized is no longer feasible. That is, we succeed when G=Γ, but if G≠Γ, further computation may simply fail.
The authenticating equality is not affected by applying any non-lossy function to both sides: for any bijection φ, we can equivalently test whether φ(φ)=φ(Γ). The authenticating equality may remain valid with high probability even if φ is lossy, if φ is carefully chosen so that the probability that φ(G)=φ(Γ) when G≠Γ is sufficiently low (as it is in Unix password authentication, for example). Based on technology previously described herein, we can easily perform such a test. We previously described a method for foiling tampering by duplicating data-flow, randomly cross connecting the data-flow between duplicate instances, and performing encoded checking to ensure that the equalities have not been compromised. We can adapt this approach to test whether G=Γ, or in encoded form, whether φ(G)=φ(Γ).
We note that a data-flow yielding φ(G) already duplicates a dataflow yielding φ(Γ)along the success path where G=Γ. We therefore omit, for this comparison, the data-flow duplication step. Then we simply cross-connect as described above and insert checks. By using these computations as coefficients for future encoded computations, we ensure that, if φ(G)=φ(Γ), all will proceed normally, but if φ(G)≠φ(Γ), while further computation will proceed, the results will be chaotic and its functionality will fail. Moreover, since φ is a function, if φ(G)≠φ(Γ), we can be sure that G≠Γ.
Variable-Dependent Coding
In some embodiments that incorporate operations which make use of one or more variables which need not have a specific value during their use in the operation, variable-dependent coding may be used to further obscure the operation of related code. One way of doing so is to use values that are used or generated by other operations in nearby or related sections of code. Thus, such values may be used repeatedly for different purposes within a region of code, which may make it more difficult for an attacker to discern any individual use, or to extract information about the specific operations being performed in relation to those values. For example, if a value x is encoded as aX+b, there may be a great deal of leeway in the specific values used for the constants a and b. In this example, if there are values available within the executing code that remain constant over the life of x, they may be used as one or more of the constants a and/or b.
Further, for a single defined operation, different values may be used during each execution of the operation, such that the specific values used may change each time the operation is executed. This may act as an additional barrier to a potential attacker, who may not be able to track values from one execution to another as might be expected for other types of clear, encrypted, or obfuscated code. Continuing the example above, a first operation ƒ(Y) may return values a and b and a second operation g(Z) may return values c and d, each of which is stored in memory for a period of time. The variable x may be encoded during the time that a and b are stored in memory as aX+b, and as cX+d during the time that c and d are stored in memory. Thus, the appropriate constants will be available via the memory to allow for decoding or otherwise manipulating x in the appropriate encoding. The values may be overwritten or discarded after that time, since the encoding constants need only be available during the time that x is used by operations within the executing program.
Similarly, variable values generated during execution of code may be used for other purposes in addition to or as an alternative to the finite encoding example provided. For example, variable values may be used to select a random item from a list or index, as a seed for a pseudo-random number generator, as an additive, multiplicative, or other scaling factor, or the like. More generally, variable values generated by one portion of executed code may be used in any place where a constant value is needed at another portion of executed code, for a duration not more than the generated variable values are expected to be available.
Example Advantages
Embodiments of the invention described herein may be used to provide the following, where a “sufficient period of time” may be selected based on, or otherwise determined by, the needs of security lifecycle management:
Generally, embodiments disclosed herein relate to base-function encoding, using various techniques and systems as disclosed. Specific embodiments also may be referred to herein, such as in the Appendix, as “ClearBox” implementations.
The various techniques as disclosed herein may use operations that are similar in nature to those used in an application that is being protected by the disclosed techniques, as previously described. That is, the protection techniques such as base functions, fractures, dynamic data mangling, cross-linking, and variable dependent coding may use operations that are similar to those used by the original application code, such that it may be difficult or impossible for a potential attacker to distinguish between the original application code and the protective measures disclosed herein. As a specific example, base functions may be constructed using operations that are the same as, or computationally similar to, the operations performed by the original application code with which the base functions are integrated, in contrast to the distinctive functions typically employed by, for example, known encryption techniques. Such operations and techniques that are difficult or impossible to distinguish may be described herein as “computationally similar.”
A method is generally conceived to be a self-consistent sequence of steps leading to a desired result. These steps require physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. It is convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, parameters, items, elements, objects, symbols, characters, terms, numbers, or the like. It should be noted, however, that all of these terms and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. The description of the present invention has been presented for purposes of illustration but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments were chosen to explain the principles of the invention and its practical applications and to enable others of ordinary skill in the art to understand the invention in order to implement various embodiments with various modifications as might be suited to other contemplated uses.
Embodiments disclosed herein may be implemented in and used with a variety of computer systems and architectures.
As will be readily understood by one of skill in the art, the bus 3201 allows data communication between the central processor 3210 other components. Applications resident with the computer 3200 generally may be stored on and accessed via a computer readable medium, such as the storage 3240 or other local or remote storage device. Generally, each module shown may be integral with the computer or may be separate and accessed through other interfaces. For example, the storage 3240 may be local storage such as a hard drive, or remote storage such as a network-attached storage device.
Many other devices or components may be connected in a similar manner. Conversely, all of the components shown need not be present to practice embodiments disclosed herein. The components can be interconnected in different ways from that shown. The operation of a computer such as that shown is readily known in the art and is not discussed in detail in this application. Code to implement embodiments of the present disclosure may be stored in a computer-readable storage medium such as one or more of the memory 3220, the storage 3240, or combinations thereof.
More generally, various embodiments disclosed herein may include or be embodied in the form of computer-implemented processes and apparatuses for practicing those processes. Embodiments also may be embodied in the form of a computer program product having computer program code containing instructions embodied in non-transitory and/or tangible media, such as floppy diskettes, CD-ROMs, hard drives, USB (universal serial bus) drives, or any other machine readable storage medium. When such computer program code is loaded into and executed by a computer, the computer may become an apparatus for practicing embodiments disclosed herein. Embodiments also may be embodied in the form of computer program code, for example, whether stored in a storage medium, loaded into and/or executed by a computer, or transmitted over some transmission medium, such as over electrical wiring or cabling, through fiber optics, or via electromagnetic radiation, wherein when the computer program code is loaded into and executed by a computer, the computer becomes an apparatus for practicing embodiments disclosed herein. When implemented on a general-purpose processor, the computer program code may configure the processor to create specific logic circuits. In some configurations, a set of computer-readable instructions stored on a computer-readable storage medium may be implemented by a general-purpose processor, which may transform the general-purpose processor or a device containing the general-purpose processor into a special-purpose device configured to implement or carry out the instructions. Embodiments may be implemented using hardware that may include a processor, such as a general purpose microprocessor and/or an Application Specific Integrated Circuit (ASIC) that embodies all or part of the techniques according to embodiments of the disclosed subject matter in hardware and/or firmware.
In some embodiments, the various features and functions disclosed herein may be implemented by one or more modules within a computer system, and/or within software executed by the computer system. For example, a computer system according to some embodiments disclosed herein may include one or more modules configured to receive existing computer executable code, to modify the code as disclosed herein, and to output the modified code. Each module may include one or more sub-modules, such as where a module configured to modify existing computer executable code includes one or more modules to generate base functions, blend the base functions with the code, and output the blended code. Similarly, other modules may be used to implement other functions disclosed herein. Each module may be configured to perform a single function, or a module may perform multiple functions. Similarly, each function may be implemented by one or more modules operating individually or in coordination.
One or more currently preferred embodiments have been described by way of example. It will be apparent to persons skilled in the art that a number of variations and modifications can be made without departing from the scope of the invention as defined in the claims.
This document addresses the problem of creating pairs of programmatic implementations, F, G, for pairs of bijective functions ƒ, ƒ−1, respectively, such that
We note that information K sufficient to readily determine ƒ, ƒ−1 can be regarded as a key for a symmetric cipher, with F and G being encryption and decryption according to key K.
We have not specified what we mean by ‘hard’. At a minimum, we want it to be significantly less effortful to choose K and generate such F, G than it is to solve any of problems (1)-(4) above.
x or
m1, . . . , mk
We write “:-” to denote “such that” and we write “iff” to denote “iƒand only iƒ”. Table 1 summarizes many of the notations, and Table 2 summarizes many of the abbreviations, employed herein.
2.1. Sets, Tuples, Relations, and Functions. For a set S, we write |S| to denote the cardinality of S (i.e., the number of members in set S). We also use |n| to denote the absolute value of a number n.
We write {m1, m2, . . . , mk} to denote the set whose members are m1, m2, . . . , mk. (Hence if m1, m2, . . . , mk are all distinct, |{m1, m2, . . . , mk}|=k).We also write {x|C} to denote the set of all entities of the form x such that the condition C holds, where C is normally a condition depending on x.
2.1.1. Cartesian Products, Tuples, and Vectors. Where A and B are sets, A×B is the Cartesian product of A and B; i.e., the set of all pairs (a, b) where aεA (i.e., a is a member of A) and bεB (i.e., b is a member of B). Thus we have (a, b)εA×B. In general, for sets S1, S2, . . . , Sk, a member of S1×S2× . . . ×Sk is a k-tuple of the form (s1, s2, . . . , sk) where siεSi for i=1, 2, . . . , k. If t=(s1, . . . , sk) is a tuple, we write |t| to denote the length of t (in this case, |t|=k; i.e., the tuple has k element positions). For any x, we consider x to be the same as (x)—a tuple of length one whose sole element is x. If all of the elements of a tuple belong to the same set, we call it a vector over that set.
If u and v are two tuples, then u∥v is their concatenation: the tuple of length |u|+|v| obtained by creating a tuple containing the elements of u in order and then the elements of v in order: e.g., (a, b, c, d)∥(x, y, z)=(a, b, c, d, x, y, z).
We consider parentheses to be significant in Cartesian products: for sets A, B, C, members of (A×B)×C look like ((a, b), c) whereas members of A×(B×C) look like (a, (b, c)), where aεA, bεB, and cεC. Similarly, members of A×(B×B)×C look like (a, (b1, b2), c) where aεA, b1, b2εB, and cεC.
2.1.2. Relations, Multi-functions (MFs), and Functions. A k-ary relation on a Cartesian product S1× . . . ×Sk of k sets (where we must have k≧2) is any set R⊂S1× . . . ×Sk. Usually, we will be interested in binary relations; i.e., relations R⊂A×B for two sets A, B (not necessarily distinct). For such a binary relation, we write a R b to indicate that (a, b)εR. For example, where R is the set of real numbers, the binary relation <⊂R×R on pairs of real numbers is the set of all pairs of real numbers (x, y) such that x is smaller than y, and when we write x<y it means that (x, y)ε<.
The notation R:: AB indicates that R⊂A×B; i.e., that R is a binary relation on A×B. This notation is similar to that used for functions below. Its intent is to indicate that the binary relation is interpreted as a multi-function (
For a binary relation R:: AB, we define
R−1={(b,a)|(a,b)εR}.
R−1 is the inverse of R.
For binary relations R:: AB and S:: BC, we define S∘R:: AC by
S∘R={(a,c)|∃bεB:—a R b and b S c}.
S∘R is the composition of S with R. Composition of binary relations is associative; i.e., for binary relations, Q, R, S, (S∘R)∘Q=S∘(R∘Q). Hence for binary relations R1, R2, . . . , Rk, we may freely write Rk∘ . . . ∘R2∘R1 without parentheses because the expression has the same meaning no matter where we put them. Note that
(Rk∘ . . . ∘R2∘R1){X}=Rk{ . . . {R2{R1{X}}} . . . }
in which we first take the image of X under R1, and then that image's image under R2 and so on up to the penultimate image's image under Rk, which is the reason that the Ri's in the composition on the left are written in the reverse order of the imaging operations, just like the Ri's in the imaging expression on the right.
Where Ri:: AiBi for i=1, . . . , k, R=[R1, . . . , Rk] is that binary relation:—
R:: A1× . . . ×AkB1× . . . ×Bk
and
R(x1, . . . , xk)→(y1, . . . , yk) iff Ri(xi)→yi for i=1, . . . , k.
[R1, . . . , Rk] is the aggregation of R1, . . . , Rk.
Where Ri:: A1× . . . ×AmBi for i=1, . . . , n, R=R1, . . . , Rn is that binary relation:—
R:: A1× . . . ×AmB1× . . . ×Bn
and
R(x1, . . . , xm)→(y1, . . . , yn) iff Ri(x1, . . . , xm)→yi for i=1, . . . , n.
R1, . . . , Rk is the conglomeration of R1, . . . , Rk.
We write ƒ: AB to indicate that ƒ is a function from A to B; i.e., that ƒ:: AB:—for any aεA and bεB, if ƒ(a)→b, then ƒ(a)=b. For any set S, idS is the function for which idS(x)=x for every xεS.
2.1.3. Directed Graphs, Control-Flow Graphs, and Dominators. A directed graph (
A path in a
In a directed graph (
For every node xεN, |{y|(x, y)εA}|, the number of arcs in A which start at x and end at some other node, is the out-degree of node x, and for every node yεN, |{x|(x, y)εA}|, the number of arcs in A which start at some node and end at y, is the in-degree of node y. The degree of a node nεN is the sum of n's in- and out-degrees.
A source node in a
A
Let G=(N, A) be a
With G=(N, A) and s as above, a nonempty node set X⊂N dominates a nonempty node set Y⊂N iff every path starting with n0 and ending with an element of Y contains an element of X. (Note that the case of a single node dominating another single node is the special case of this definition where |X|=|Y|=1.)
2.2. Algebraic Structures. Z denotes the set of all integers and N denotes the set of all integers greater than zero (the natural numbers). Z/(m) denotes the ring of the integers modulo m, for some integer m>0. Whenever m is a prime number, Z/(m)=
2.2.1. Identities. Identities (i.e., equations) play a crucial role in obfuscation: if for two expressions X, Y, we know that X=Y, then we can substitute the value of Y for the value of X, and we can substitute the computation of Y for the computation of X, and vice versa.
That such substitutions based on algebraic identities is crucial to obfuscation is easily seen by the fact that their use is found to varying extents in every one of [5, 7, 8, 10, 11, 12, 21, 22, 23, 24, 28, 29, 30].
Sometimes we wish to identify (equate) Boolean expressions, which may themselves involve equations. For example, in typical computer arithmetic,
x=0 iff (−(xV(−x))−1)≦0
(using signed comparison). Thus “iff” equates conditions, and so expressions containing “iff” are also identities—specifically, condition identities or Boolean identities.
2.2.2. Matrices. We denote an r×c (r rows, c columns) matrix M by
where its transpose is denoted by MT where
so that, for example,
2.2.3. Relationship of Z/(2n) to Computer Arithmetic. On Bn, the set of all length-n bit-vectors, define addition (+) and multiplication (·) as usual for computers with 2's complement fixed point arithmetic (see [25]). Then (Bn, +, ·) is the finite two's complement ring of order 2n. The modular integer ring Z/(2n) is isomorphic to (Bn, +, ·), which is the basis of typical computer fixed-point computations (addition, subtraction, multiplication, division, and remainder) on computers with an n-bit word length.
(For convenience, we may write x·y (x multiplied by y) by xy; i.e., we may represent multiplication by juxtaposition, a common convention in algebra.)
In view of this isomorphism, we use these two rings interchangeably, even though we can view (Bn, +, ·) as containing signed numbers in the range −2n−1 to 2n−1−1 inclusive. The reason that we can get away with ignoring the issue of whether the elements of (Bn, +, ·) occupy the signed range above or the range of magnitudes from 0 to 2n−1 inclusive, is that the effect of the arithmetic operations “+” and “·” on bit-vectors in Bn is identical whether we interpret the numbers as two's complement signed numbers or binary magnitude unsigned numbers.
The issue of whether we interpret the numbers as signed arises only for the inequality operators <, >, ≦, ≧, which means that we should decide in advance how particular numbers are to be treated: inconsistent interpretations will produce anomalous results, just as incorrect use of signed and unsigned comparison instructions by a C or C++ compiler will produce anomalous code.
2.2.4. Bitwise Computer Instructions and (Bn, V, Λ, ). On Bn, the set of all length-n bit-vectors, a computer with n-bit words typically provides bitwise and (Λ), inclusive or (V) and not (). Then (Bn, V, Λ, ) is a Boolean algebra. In (B, V, Λ, ), in which the vector-length is one, 0 is false and 1 is true.
For any two vectors u, vεBn, we define the bitwise exclusive or (⊕) of u and v, by u⊕v=(uΛ(v))V((u)Λv). For convenience, we typically represent x by
Since vector multiplication—bitwise and (Λ)—in a Boolean algebra is associative, (Bn, ⊕, Λ) is a ring (called a Boolean ring).
2.2.5. T-Functions and Non-T-Functions. A function ƒ: (Bw)k(Bw)m mapping from a k-vector of w-bit words to an m-vector of w-bit words is a T-function if for every pair of vectors xε(Bw)k, yε(Bwm)m:—y=ƒ(x), with x′≠x and y′=ƒ(x′), and with bits numbered from 0 to w−1 in the w-bit words, the lowest numbered bit in an element word at which y and y′ differ is not lower than the lowest numbered bit in an element word at which x and x′ differ. Typically we consider this numbering within words to be from low-order (20) to high-order (2w−1) bits, regarding words as representing binary magnitudes, so we can re-state this as: an output bit can only depend on input bits of the same or lower order.
Functions composable from Λ, V, ⊕, computed over Bw together with +, −, × over Z/(2w), so that all operations operate on w-bit words, are T-functions. Obscure constructions with the T-function property are vulnerable to bit-slice attacks, since we can obtain from any T-function another legitimate T-function by dropping high-order bits from all words in input and output vectors.
The T-function property does not hold for right bit-shifts, bitwise rotations, division operations, or remainder/modulus operations based on a divisor/modulus which is not a power of two, nor does it hold for functions in which conditional branches make decisions in which higher-order condition bits affect the value of lower-order output bits.
For conditional branches and comparison-based conditional execution, note that conditional execution on the basis of conditions formed using any one of the six standard comparisons =, ≠, <, >, ≦, ≧ all can easily violate the T-function condition, and indeed, in normal code using comparison based branching logic, it is easier to violate the T-function condition than it is to conform to it.
2.2.6. Polynomials. A polynomial is an expression of the form ƒ(x)=Σi=0daixi=add+ . . . +a2x2+a1x+a0 (where x0=1 for any x). If ad≠0, then d is the degree of the polynomial. Polynomials can be added, subtracted, multiplied, and divided, and the result of such operations are themselves polynomials. If d=0, the polynomial is constant; i.e., it consists simply of the scalar constant a0. If d>0, the polynomial is non-constant. We can have polynomials over finite and infinite rings and fields.
A non-constant polynomial is irreducible if it cannot be written as the product of two or more non-constant polynomials. Irreducible polynomials play a role for polynomials similar to that played by primes for the integers.
The variable x has no special significance: as regards a particular polynomial, it is just a place-holder. Of course, we may substitute a value for x to evaluate the polynomial—that is, variable x is only significant when we substitute something for it.
We may identify a polynomial with its coëfficient (d+1)-vector (ad, . . . , a1, a0).
Polynomials over
2.3. Encodings. We formally introduce encodings here.
Let F:: DR be total. Choose a bijection d: DD′ and a bijection r: RR′. We call F′=r∘F∘d−1 an encoded version of F. d is an input encoding or a domain encoding and r is an output encoding or a range encoding. A bijection such as d or r is simply called an encoding. In the particular case where F is a function, the diagram shown in
Let Bi:: Sim
(We might view the following as a special case of the above where the mi's and ni's all have the value 1.) Let Bi:: SiS′i for i=1, 2, . . . , k. Then the relation aggregation [B1, B2, . . . , Bk] is that relation B:—∀xiεSi, x′iεS′i, with i ranging over {1, 2, . . . , k}, (xi, x′i)εBi, i=1, 2, . . . , k iff (x1, . . . , xk, x′1, . . . , x′k)εB.11The [ƒ1, . . . , ƒk] notation was introduced for function aggregation by John Backus in his
Plainly B−1=[B1−1, . . . , Bk−1]. If B1, . . . , Bn are bijections, and therefore are encodings, then B is also a bijection and an encoding. B is then called an aggregated encoding, and Bi is the ith component of B.
Let Bi:: SS′i for i=1, 2, . . . , k. Then the relation conglomeration
Bi; B2; . . . ; Bk
is that relation B:—∀x′iεS′i, ∀xεS,
(x, x′1, . . . , x′k)εB iff ((x, . . . , x), (x′1, . . . , x′k))εB1, . . . , Bk.
2.3.1. Network Encoded Computations. Generally, output of a transformation will become the input to another subsequent transformation, which means the output encoding of the first must match the input encoding of the second as follows.
A networked encoding for computing Y∘X (i.e. transformation X followed by transformation Y) is an encoding of the form Y′∘X′=(H∘Y∘G−1)∘(G∘X∘F−1)=H∘(Y∘X)∘F−1.
In the general case, we have encoded networks, which are data-flow networks in which the node functions are encoded functions.
Encoding may be derived from algebraic structures (see § 2.2)
For example, finite ring encoding (
We note from
Suppose we want to encode additions, subtractions, and multiplications on a binary computer with word-width w so that the unencoded computations are performed over Z/(2w). We could use affine encodings over Z/(2w). With unencoded variables x, y, z and corresponding encoded variables x′, y′, z′ where
x′=ex(x)=sxx+bx y′=ey(y)=syy+by z′=ez(z)=szz+bz,
We want to determine how to compute
z′=x′+′y′ z′=x′−′y′ z′=x′×′y′;
i.e., we need representations for +′, −′, ×′. (Over a network of such operations, we would have many different, encodings +′, −′, ×′, with the requirement being that the result of an operation employs the same encoding as the corresponding input encoding of the consuming operation.)
Where juxtaposition represents × over Z/(2w), −x in 2's complement is −x in Z/(2w), and xy in 2's complement is xy in Z/(2w). Thus if ev is the encoding of v and ev−1 its inverse, v′=ev(v)=svv+bv and ev−1(v′)=(v′−bv)sv−1=sv−1v′+(−bvsv−1) (another affine encoding over Z/(2w)). Then
z′=x′+′y′=ez(ex−1(x′)+ey−1(y′))=(sx−1sz)x′+(sy−1sz)y′+(bz−sx−1szbx−sy−1szby)
which has the general form z′=c1x′+c2y′+c3 with constants c1, c2, c3: the original data and encoding coëfficients have vanished. If y is a positive or negative constant k, we may choose ey=id (i.e., sy=1 and by=0), and the above reduces to
z′=x′+′k=ez(ex−1(x′)+k)=(sx−1sz)x′+(bz−sx−1szbx+szk)
which has the general form z′=c1x′+c2 for constants c1, c2. Alternatively, we can compute z′=x′+′k as z′=x′ where we define sz=sx and bz=bx−sxk so that we can compute z′=x′+′k with no computation at all. To make z′=−′x′ without computation, we simply define sz=−sx and bz=−bx and set z′=x′. Similarly, for subtraction
z′=x′−′y′=ez(ex−1(x′)−ey−1(y′))=(sx−1sz)x′+(−sy−1sz)y′+(bz−sx−1szbx+sy−1szby)
which again has the general form z′=c1x′+c2y′+c3 with constants c1, c2, c3: the original data and encoding coëfficients have vanished. If y′ is a constant c, we proceed as above for addition, setting k=−c. To subtract z′=k−′x′, we can compute it without computation by negating x′ without computation, and then adding k as described above. For multiplication,
z′=x′×′y′=ez(ex−1(x′)×ey−1(y′))=(sx−1sy−1sz)x′y′+(−sx−1sy−1szby)x′+(−sx−1sy−1szbx)y′+(bz+sx−1sy−1szbxby)
which has the general form z′=c1x′y′+c2x′+c3y′+c4 for constants c1, c2, c3, c4. Finally, if x is a constant k, we may choose ex=id (i.e., we may choose sx=1 and bx=0) in which case the above multiplication formula reduces to
z′=k×′y′=ez(k×ey−1(y′))=(sy−1szk)y′+(bz−sy−1szkby)
which has the general form z′=c1y′+c2 for constants c1, c2. Alternatively, if k is invertible (i.e., odd) in Z/(2w), we can compute z′=k×′y′ as z′=y′ by defining sz=k−1sy and bz=by, which has the standard affine form for
Polynomials of higher order may also be used: in general [27], for 1<wεN, over Z/(2w),
P(x)=a0⋄1a1x⋄2a2x2⋄3 . . . ⋄dadxd
is a permutation polynomial (i.e., bijective or lossless polynomial) iff
Permutation polynomials exist over many rings and fields. Klimov [17] extended this characterization to what he called generalized permutation polynomials, which are like those described above except that any given ⋄i may be + or − (modulo 2w) or bitwise exclusive-or (⊕) on Bw and the ⋄ operations can be applied in any fixed order.
While we can write polynomials of arbitrary degree, every polynomial over Z/(2w) is equivalent to a polynomial of very limited degree. In fact, it has been known that, for wεNm every permutation polynomial P over Z/(2w) has an equivalent permutation polynomial Q over Z/(2w) of degree ≦w+1.
A difficulty with permutation polynomials, whether generalized or not, is that they only become truly useful when their inverses are known and computationally convenient. It is known that most permutation polynomials have inverses of high degree (close to 2w for permutation polynomials over Z/(2w)). However, using Rivest's (non-generalized) characterization above, if ai2=0 for i=2, . . . , d, then the degree of the inverse is the same as the degree of the polynomial to be inverted. Formulas for inverses for permutation polynomials as follows (see section C for a more rigorous treatment):
2.3.2. Quadratic Polynomials and Inverses. If P(x)=ax2+bx+c where a2=0 and b is odd, then P is invertible, and
P−1(x)=dx2+ex+ƒ,
where the constant coëfficients are defined by
2.3.3. Cubic Polynomials and Inverses. If P(x)=ax3+bx2+cx+d where a2=b2=0 and c is odd, then P is invertible, and
P−1(x)=ex3+ƒx2+gx+h,
where the constant coëfficients are defined by
2.3.4. Quartic Polynomials and Inverses. If P(x)=ax4+bx3+cx2+dx+e where a2=b2=c2=0 and d is odd, then P is invertible, and
P−1(x)=ƒx4+gx3+hx2+ix+j,
where the constant coëfficients are defined by
2.3.5. Notes on Permutation Polynomials Over Z/(pw). Let p be a prime and wε. The properties permutation polynomials over Z/(pw) are explored in a 1984 paper by Mullen and Stevens [19], which teaches us the following.
2.3.6. Notes on Permutation Polynomials Over Z/(2w). For a computer with w-bit words,
Adjusting the results from [19] above, the number of functionally distinct
τ(2w)=2w(
where S2(w)=Σi=0
Note that 2(n) is that integer κ:—2n|(κ+1)! but 2nκ!, and we have 2(n)≡−1≡1 (mod 2).
2.3.7. General Notes on Encodings. P′ denotes an encoded implementation derived from function P. To emphasize that P maps m-vectors to n-vectors, we write mnP. P is then called an n×m function or an n×m transformation. For a matrix M, mnM indicates that M has m columns and n rows. (These notations naturally correspond, taking application of M to a vector as function application.)
m
nE (mnemonic: entropy-transfer function) is any function from m-vectors over B to n-vectors over B which loses no bits of information for m≦n and at most m−bits for m>n. A function nnƒ which is not an instance of nE is lossy. Multiple occurrences of mnE in a given formula or equation denote the same function.
ne (mnemonic: entropy vector) is an arbitrary vector selected from Bn. Multiple occurrences of ne in a given formula or equation denote the same vector.
An affine function or affine transformation (
A function ƒ: FkFm from k-vectors to m-vectors over F, +, ·ε
(Note that if ∃g′:—ƒ=[r′1, . . . , r′m]∘g′∘[d1−1, . . . , dk−1] where g′ is affine, then certainly ∃ linear g, r1, . . . , rm:—ƒ=[r1, . . . , rm]∘g∘[d1−1, . . . , dk−1], since we can choose r1, . . . , rm to perform the element-wise addition of the vector displacement of g′.)
If g: AkAm is not deeply nonlinear for a prime power |A|>1, we say that g is linear up to I/O encoding.
We have proven the following regarding linearity and identity up to I/O encoding.
2.3.8. *Fractures and Fracture Functions. As noted in § 2.3.1, generally when an encoded output is produced, it is consumed with exactly the same encoding assumed, so that an encoded operation z=ƒ(x,y) becomes z′=ƒ′(x′, y′) where (x′, y′, z′)=(ex(x), ey(y), ez(z)), ex, ey, ez are the encodings, and ƒ′=ez∘ƒ∘[ex−1, ey−1].
It is sometimes advantageous to output a value with one encoding, and subsequently input assuming some other encoding. If we output x as e1(x), and later consume it assuming encoding e2, in effect we have applied e2−1∘e1 to the unencoded value. We call such an intentional mismatch between the encoding in which a value is produced and the encoding assumed when it is consumed a fracture. If the encodings are linear, so is the fracture function e2−1∘e1, and if they are permutation polynomials, so is the fracture function e2−1∘e1.
Fractures are potentially useful in obfuscation because the computation which they perform effectively does not appear in the code—the amount and form of code to perform a normal networked encoding and one which adds an operation by means of a fracture is identical, and there appears to be no obvious way to disambiguate these cases, since encodings themselves tend to be somewhat ambiguous.
Note that the defining property of a fracture is the fracture function v−1∘u, say. Generally, there are many different choices of consuming encoding v and producing encoding u which produce exactly the same fracture function: it is quite possible, for example, to have u1, . . . , uk, v1, . . . , vk such that vi−1∘ui is the same fracture function for i=1, . . . , k. Thus specifying the fracture function does not nail down the producing and consuming encodings which imply it.
2.4. Partial Evaluation (PE). A partial evaluation (
To provide a specific example, let us consider the case of compilation.
Without
Now suppose we have a very general compiler q, which inputs a source program s, together with a pair of semantic descriptions: a source language semantic description d and a description of the semantics of executable code on the desired target platform t. It compiles the source program according to the source language semantic description into executable code for the desired target platform. We then have q: S×(D×T)E where S is the set of source code files, D is the set of source semantic descriptions, T is the set of platform executable code semantic descriptions, and E is the set of object code files for any platform. Then a specific compiler is a
Optimizing compilers perform
2.5. Output Extension (OE). Suppose we have a function ƒ: UV. Function g: UV×W is an output extension (
We may also use the term output extension (
Where function ƒ is implemented as a routine or other program fragment, it is generally straightforward to determine a routine or program fragment implementing a function g which is an
2.6. Reverse Partial Evaluation (RPE). To create general, low-overhead, effective interlocks for binding protections to
Plainly, for almost any
We call the process of finding such a tuple (ƒ, c, Y) (or the tuple which we find by this process) a reverse partial evaluation (
Notice that
Finding an efficient program which is the
2.7. Control Flow Graphs (CFGs) in Code Compilation. In compilers, we typically represent the possible flow of control through a program by a control flow graph (
For each node nεN in a
For an entire program having a
Sometimes, instead of a
2.8. *Permuting by Pair-Swapping. Here we consider how to produce permutations of n elements using only random 2×2 switch elements which compute either y1, y2←x1, x2 (no swap) or y2, y1←x1, x2 (swap), each with probability ½.
2.8.1. *Permuting by Blind Pair-Swapping. A sorting network may be represented as shown in
An efficient way of constructing such a sorting network for n nodes is given by Batcher's Odd-Even Mergesort [2], which is a data-independent sort: exactly the same compare-and-swap-if-greater operations are performed irrespective of the data to be sorted. The algorithm performs O(n(log n)2) comparisons in sorting a set of n elements. Details of the algorithm can be found at these
If such a network will sort arbitrary data into order, it follows that, if the compare-and-swap-if-greater operations are replaced with operations which swap with probability ½, the same network configuration will permute a sequence of n distinct elements into a random order, probably a biased one. This is the basis of the mechanism we will use to implement permutations, using pseudo-random true/false variates created using computations.
Note that the number of permutations of n elements is n!, whereas the number of swap-configurations, using one bit in position 2i to indicate whether the ith swap was done or not done, is 2b(n) where b(n) is the number of stages in a Batcher network sorting n elements.
For example, for n=3, n!=6, b(n)=3, and 2b(n)=8, so there must be permutations which can be selected more than one way, but some of them cannot. Similarly, for n=5, n!=120, b(n)=9, and 2b(n)=512, so there must be permutations which can be selected more than one way, but the number of swap configurations which select a given permutation cannot always be the same because 120512.
Reducing bias requires that we ensure that the number of ways of reaching any permutation is roughly the same for each permutation. Since 2b(n) is a power of two for any n, this cannot be done simply by adding extra stages. It is necessary in some cases to use other methods for reducing bias.
2.8.2. *Permuting by Controlled Pair-Swapping. The method described in § 2.8.1 suffers from significant bias (the bias can easily exceed two to one). The problem was that the number of random swap/no-swap decisions is always a power of 2, whereas the number of permutations is always a factorial, and for element counts above 2, the number of permutations never evenly divides the number of swap/no-swap lineups which form a number between 0 and 2k−1 inclusive which can be viewed as a string of k bits: one bit per swap/no-swap decision.
There are several different mechanisms which we can deploy to obtain results from the same kinds of decision elements (comparing two pseudo-random numbers). We begin with a straight selection problem: to generate a permutation, we choose one of n elements for a given position, and then choose one of n−1 remaining elements for another, and so on, until we are forced to choose the remaining element for the remaining position.
The first method of removing bias might be called attenuation. Suppose, for example, that we need to choose one of 12 elements. We could create a binary tree of decisions with 16 leaf nodes, and map the leaf nodes onto the 12 elements, with 8 being reachable via one leaf and 4 being reachable by two leaf nodes each. (We simply wrap the 16 leaf nodes around the 12 choices until all leaf nodes have been used; i.e., we create a sequence of 16 elements by repeating the element numbers from 1 to 12 until we have an element number for each of the 16 leaf nodes: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4.) At this point, we have a maximum 2:1 bias in our selection. If we use a tree with 32 leaf nodes, we will have 4 elements reachable from two leaf nodes and 8 reachable from 3, and our maximum bias is reduced to 3:2. If we use a tree with 64 leaf nodes, we will have 8 elements reachable from 5 leaf nodes and 4 reachable from 6, and our maximum bias is reduced to 5:4. Attenuation produces fast but bulky code.
The second method of removing bias might be called reselection. Suppose, as above, that we need to choose one of 12 elements. We could create a binary tree of decisions with 16 leaf nodes, and map 12 leaf nodes to the 12 choices. The other four choices map to looping back and performing the whole selection over again. With probability ¾, we succeed on the first try. With probability 15/16, we succeed in the first two tries. With probability 63/64, we succeed in the first three. Reselection has the advantage that it can almost completely eliminate bias. It has the disadvantage that, while spatially compact, it involves redoing some steps. Also, since we would want to limit the number of iterations, it involves counting the repetitions and defaulting to a (slightly) biased choice on those rare cases where the count is exceeded. Reselection is more compact, slower, and eliminates more of the bias than attenuation.
The third method of removing bias might be called reconfiguration. Suppose, as above, that we need to choose one of 12 elements. We note that using 16 leaf nodes, we have a bias of 2:1 with 8 nodes reachable 1 way and 4 reachable 2 ways. Suppose we set up three ways to identify the mapping of leaf nodes to elements. For each of the 12 elements, it appears in the “1 way” set in two configurations and in the “2 ways” set in one configuration. We then (using reselection) choose one of the three configurations, and then select using the tree of 16 resulting in an almost perfectly unbiased selection, and we only had to apply reselection on 3 elements, not 12. At the cost of a little extra data, this method provides the best combination of compactness and speed when the number of configurations needed to eliminate bias is small. (The maximum possible number of configurations is bounded above by the number of elements from which to choose, but at that number of configurations, using reconfiguration is pointless because choosing the configuration is simply another of instance of the problem whose bias we are trying to reduce.)
As it turns out, probably the optimal method of removing bias, for good performance, reduced bias, and simplicity, is a variant of attenuation. We repeatedly permute the elements using the original biased permutation method but with independent choices, in effect composing multiple biased permutations. Experimentation with a J program indicates that simply permuting twice is reduces bias to a low level (ratio close to 1.0): there is little point in iterating more times.
2.9. Deep Nonlinearity: Function-Indexed Interleaving. The
2.9.1. Shallow Nonlinearity and Homomorphic Mapping Attacks. Much use is made in implementations according to [21,22] of wide-input linear transformations (§ 4.0 in [21]) and the matrix blocking method described in § 4.1 on pp. 9-10 (paragraphs [0195]-[0209] in [21]). It is true that the methods of [21] produce non-linear encoded implementations of such linear transformation matrices. However, the implementations are shallowly nonlinear. That is, such a matrix is converted into a network of substitution boxes (lookup tables) which necessarily have a limited number of elements due to space limitations. The nonlinear encodings (arbitrary 1-to-1 functions, themselves representable as substitution boxes; i.e., as lookup tables) on values used to index such boxes and on element values retrieved from such boxes are likewise restricted to limited ranges due to space limitations.
Thus any data transformation computed by an input-output-encoded implementation of such a blocked matrix representation, which is implemented as a network of substitution boxes, or a similar devices for representing essentially arbitrary random functions, is linear up to I/O encoding; that is, any such transformation can be converted to a linear function by individually recoding each input vector element and individually recoding each output vector element.
The attack method in [4] is a particular instance of a class of attacks based on homomorphic mapping. The attack takes advantage of the known properties of linear functions, in this case over
2.9.2. Foiling Homomorphic Mapping: Deeply Nonlinear Functions.
The solution to homomorphic mapping attacks is to replace such matrix functions with functions which are (1) wide-input; that is, the number of bits comprising a single input is large, so that the set of possible input values is extremely large, and (2) deeply nonlinear; that is, functions which cannot possibly be converted into linear functions by I/O encoding (i.e., by individually recoding individual inputs and individual outputs).
Making the inputs wide makes brute force inversion by tabulating the function over all inputs consume infeasibly vast amounts of memory, and deep nonlinearity prevents homomorphic mapping attacks such as that in [4].
For example, we could replace the MixColumns and InvMixColumns transformations in
Suppose, for example, that we want to construct such a deeply non-linear vector-to-vector function over
Suppose we need to implement a deeply nonlinear function ƒ: GpGq, with p≧3 and q≧2; i.e., one mapping p-vectors to q-vectors over our chosen representation G of
If we wanted a linear function, we could construct one using a q×p matrix over G, and if we wanted one which was nonlinear, but linear up to I/O encoding, we could use a blocked encoded implementation of such a matrix according to [21, 22]. These methods do not suffice to obtain deep nonlinearity, however.
We note that elements of G, Gu, Gv are all bit-strings (of lengths n, u, v, respectively). E.g., if n=8 and u=v=4, then elements of G are 8-hit bytes and elements of Gu and Gv are 4-bit nybbles (half-bytes).
The following construction is called function-indexed interleaving. We introduce operations extract[r, s](•) and interleave(•, •) which are readily implementable on virtually any modern computer, as would be evident to those versed in code generation by compiler. For a bit-string
S=(b0, b1, . . . , bt),
we define
extract[r, s](S)=(br, br+1, . . . , bs);
i.e., extract[r, s] returns bits r to s, inclusive. For a vector of bit-strings
V=(S1, S2, . . . , Sz),
we define
extract[r, s](V)=(extract[r, s](S1), extract[r, s](S2), . . . , extract[r, s](Sz)).
i.e., extract[r, s] returns a new vector containing bits r to s, inclusive, of each of the old vector elements. For two vectors of bit-strings of the same length, say V=(S1, . . . , Sz) and W=(T1, . . . , Tz), we define
interleave(V, W)=(S1∥T1, S2∥T2, . . . , Sz∥Tz);
i.e., each element of interleave(V, W) is the concatenation of the corresponding element of V with the corresponding element of W.
To obtain our deeply nonlinear function ƒ: GpGq above, we proceed as follows per the flow chart of
2.9.3. Experimental Verification. 1 000 pseudo-random trials of the preferred embodiment of the method for constructing deeply nonlinear functions ƒ were tried with pseudo-randomly generated
A similar experiment was performed in which, instead of using the selector function s=s2∘s1 according to the preferred embodiment, function s2 was implemented as a table of 16 1-bit elements with each element chosen pseudo-randomly from the set {0, 1}. Of 1 000 such functions, 784 were deeply nonlinear; i.e., in 784 of the constructions, step (88) indicated that the construction method's first try had produced a deeply nonlinear function.
Finally, a similar experiment was performed in which s was created as a table mapping from Gu3 to pseudo-randomly selected elements of {0, 1}. In 1 000 pseudo-random trials, this produced 997 deeply nonlinear functions. Thus this method produces the highest proportion of deeply nonlinear functions. However, it requires a sizable table (512 bytes for this small experiment, and 2 048 bytes for a similar function ƒ: G4G4 with the same I/O dimensions as the MixColumns matrix of
We see, then, that the construction method give in above for creating deeply nonlinear functions over finite fields and rings, and in particular, its preferred embodiment, are quite efficient. Moreover, creating inverses of the generated deeply nonlinear functions is straightforward, as we will see below.
2.9.4. Properties of the Above Construction. A function ƒ: GpGq constructed as described above has the following properties:
The Hamming distance between two k-vectors, say u=(u1, . . . , uk) and v=(v1, . . . , vk), is the number of element positions at which u and v differ; i.e., it is
Δ(u v)=|{iε|i≦k and ui≠vi}|.
A maximum distance separable (
Such
2.9.5. Inverting the Constructed Function. When we employ a 1-to-1 (usually deeply nonlinear) function ƒ: GpGq for some finite field or finite ring G, we often need an inverse, or at least a relative inverse, of ƒ as well. (In terms of [21, 22], the corresponding situation is that we have a 1-to-1 linear function ƒ: GpGq, which will be shallowly nonlinear after I/O encoding, whose inverse or relative inverse we require. However, we can strengthen [21, 22] significantly by using deeply nonlinear functions and (relative) inverses instead.)
We now give a method by means of which such an inverse (if p=q) or relative inverse (if p<q) is obtained for a 1-to-1 function ƒ (deeply nonlinear or otherwise) created according to our method.
For any bijective function ƒ: SnSn, there is a unique function ƒ−1: SnSn:—ƒ∘ƒ−1=ƒ−1∘ƒ=idS
We now disclose a method for constructing such a relative inverse for the functions ƒ which we construct, whenever L and all of R0, . . . , Rk−1 are 1-to-1 (in which case q≧p). If p=q, then L and all of R0, . . . , Rk−1 are bijective, and such a relative inverse of ƒ is also the (ordinary) inverse of ƒ.
This method can be employed when function s (se step 84 of
We define linear functions L−1 and R0−1, . . . , Rk−1−1 to be the relative inverses of L and R0, . . . , Rk−1, respectively. (Since these functions are computed by a matrices, their relative inverses can be obtained easily and efficiently by solving simultaneous linear equations by Gaussian elimination or the like—i.e., by methods well known in the art of linear algebra over finite fields and finite rings.)
We have s=s2∘s1 from the construction of ƒ. We define s′1=s1∘L−1, where L−1 is the relative inverse of L. (Thus s′1 is computed by a 1×q matrix over Gu easily discovered by methods well known in the art of linear algebra over finite fields and finite rings.) We define s′=s2∘s′1. We now have an onto function s′: Guq{0, . . . , k−1}.
The desired relative inverse—or ordinary inverse if p=q—is the function ƒ−1: GqGp defined as follows.
For any WεGq, let
Wu=extract[0,u−1](W),
Wv=extract[u,n−1](W), and
ƒ−1(W)=interleave(L−1(Wu), Rj−1(Wv)) where j=s′(Wu).
When p=q, this is just the ordinary inverse of ƒ. When p<q, the function behaves like an inverse only for vectors in ƒ{Gp}⊂Gq.
If we have an unrestricted form for s, i.e., if it is not constructed as in the preferred embodiment above, we can still invert or relatively invert a bijective or 1-to-1 ƒ. For example, if s is simply a table over elements of Gup, then if we define a new table s′=s∘L−1, then the formula above for ƒ−1, but using this different s′, remains correct. This new table s′ can be obtained by traversing all elements e of Gup, determining L(e), and filling in element L(e) element of s′ with the contents of element e of s.
2.10. Static Single Assignment (SSA) Form. Suppose we write a program in a language such as C. Data will comprise scalar variables, arrays, and structures.
The routines (functions in C terminology) typically act as
A routine is in static single assignment (
We note that it is not possible, in general, to convert an arbitrary C code routine to
To handle this problem, a special form of assignment is added: a φ-assignment. E.g., in the case of the then-path and else-path assignments to x, we could rename the assigned variables x1 and x2, respectively, and then, immediately after the merging of those paths at the bottom of the if-construct, insert the φ-assignment
x3=φ(x1, x2);
With the extension of φ-assignments, it is now possible to convert an arbitrary C routine into
2.10.1. Conversion from SMA Form to SSA Form. Conversion to
2.10.2. Conversion from SSA Form to SMA Form. The reverse conversion from
In this section, we propose a method for generating pairs of white-box trapdoor one-way functions, and especially for generating white-box trapdoor one-way bijections in mutually inverse pairs, such that an attacker, provided with the implementation of one member of such a pair, cannot readily find an implementation for its inverse (the other member of the pair), nor can the attacker readily find point inversions for the provided implementation.
3.1. White-Box Trapdoor One-Way Functions: Definitions. We define what a trapdoor one-way function is in general, then deal with the white-box case, and finish with separation of the entropy in implementations into key and randomization entropy.
3.1.1. Trapdoor One-Way Functions. We start with the following definitions taken from [31].
Total ƒ: XY is a one-way function iff ƒ(x) is ‘easily’ computed ∀xεX, but it is ‘computationally infeasible’ to compute x:—ƒ(x)=y for ‘almost all’ yεƒ{X}.
ƒ above is a trapdoor one-way function iff ƒ is a one-way function and ∃s:—it is, given s, computationally feasible for any yεƒ{X} to find x:—ƒ(x)=y. (If ƒ is a bijection, ƒ−1 is such an s.)
3.1.2. White-Box Trapdoor One-Way Functions. To the above standard definitions from [31], we add the following non-standard definitions for the white-box attack context.
ƒ above is a white-box one-way function iff ƒ is designed to be implementable so as to have the one-way function property under white-box attack. Similarly, ƒ is a white-box trapdoor one-way function iff ƒ is designed to be implementable so as to have the trapdoor one-way function property under white-box attack.
Bijection ƒ: XY is a one-way bijection iff ƒ(x) is is ‘easily’ computed ∀xεX, but it is ‘computationally infeasible’ to find x:—x=ƒ−1(y) for ‘almost all’ yεY.
Bijection ƒ above is a trapdoor one-way bijection iff ƒ: XY is a one-way bijection and ∃s:—it is, given s, computationally feasible for any yεY to find x:—x=ƒ−1(y). (For example, a symmetric cipher ƒ which has been partially evaluated with respect to a key s, is a trapdoor one-way bijection: the secret information is the key s.)
Bijection ƒ above is a white-box one-way bijection iff ƒ is designed to be implementable so as to have the one-way bijection property under white-box attack. Similarly, ƒ is a white-box trapdoor one-way bijection iff ƒ is designed to be implementable so as to have the trapdoor one-way bijection property under white-box attack. (For example, an effective white-box fixed-key implementation of a symmetric cipher ƒ is a white-box one-way trapdoor bijection: the secret information s is the key.)
N.B.: A white-box trapdoor one-way bijection implementation is an implementation of a bijection ƒ such that, given that implementation of ƒ, without secret information, it is hard to find a computationally feasible implementation of ƒ−1. (The specific secret information could itself be a computationally feasible implementation of ƒ−1.)
3.1.3. Key-Entropy and Randomization-Entropy. We find two functions ƒK, ƒK−1 such that, given a particular construction algorithm, a definition of ƒK and ƒK−1 can be found given only K. K is the key-entropy.
We then find two implementations pR
pR
3.2. Security: History, Theory, and Proposed Approach. Our initial attempts to build white-box trapdoor one-way function implementations in mutually inverse pairs were based on the expectation of the intractability of disambiguation of high-order polynomial encodings (see § 2.3) of linear functions and deeply nonlinear function-indexed interleavings (see § 2.9.2) of linear functions, plus a few other operations to eliminate the T-function property of such implementations over computer arithmetic (i.e., over Z/(2w) with typical w=32).
It has been demonstrated conclusively that this expectation is false: any such attempt to produce an intractable disambiguation problem by means of encoding alone fails because encodings simple enough to use are also simple enough to analyse efficiently.
This led us to seek programmatic defenses, in which encodings indeed play a part, but in which they work in concert with dynamic programmatic mechanisms (control-flow, routine calls, broader data organization, etc.). Many problems related to programs are difficult. We have proven, for example, that redundancy and reachability problems for control-flow flattening in the presence of encoding are worst-case
More generally, we have Rice's Theorem, which states that, for any non-trivial property of partial functions, there is no general and effective method to decide whether a given algorithm computes a function with that property. (‘Trivial’ means that the property either holds either for all partial functions or for no partial functions.) The theorem is named after Henry Gordon Rice, and is also known as the “Rice-Myhill-Shapiro Theorem” after Rice, John Myhill, and Norman Shapiro.
An alternative statement of Rice's Theorem is the following. Let S be a set of languages2 that is non-trivial, meaning that: 2A language is a set of strings over an alphabet. An alphabet is a finite, non-empty set.
Rice's theorem applies only to linguistic properties, not operational ones. E.g. it is decidable whether a
Patents in Irdeto's patent portfolio include software obfuscation and tamper-resistance implemented by means of data-flow encoding [5, 7, 8] (the encoding of scalars and vectors and operations upon them), control-flow encoding [6] (modification of control-flow in a program to make it input-dependent with a many-to-many mapping from functions computed and chunks of code to compute them), and mass-data encoding [20] (software-based virtual memory or memories in which logical addresses are physically scattered and are also dynamically recoded and physically moved around over time by a background process).
Of the above methods for obfuscating software and rendering it tamper-resistant, data-flow encoding is primarily a static process (although variable-dependent coding, in which the coëfficients for the encoding of certain variables and vectors are provided by other variables and vectors, renders it potentially somewhat dynamic), whereas control-flow encoding and mass-data encoding are primarily dynamic: data structures are planned statically, but the actual operation of these software protections is largely a result of the dynamic operations performed on these data-structures at run-time.
The control-flow encoding was primarily aimed at (1) reducing repeatability to foil dynamic attacks, and (2) protecting disambiguation of control-flow by burying the normal control-flow of a program in considerable extra control-flow. The mass-data encoding was originally aimed at finding an encoding which would work correctly in the presence of a high degree of dynamic aliasing: e.g., in C programs making aggressive use of pointers.
A difficulty with the above forms of dynamic encoding is that the support data structures (dispatch and register-mapping tables for control-flow encoding, virtual-memory en/de-code tables and address-mapping tables for mass-data encoding) themselves leak information.
We propose to use protections similar to a combination of control-flow encoding and mass-data encoding, but with a sharp reduction in specialized data-structures, by moving most of the specialized processing which they support from run-time to compile-time. Let us call this new form of protection, with much of the dynamic variability of control-flow encoding and mass-data encoding, but with specialized data-structures moved from run-time to compile time, dynamic data mangling.
A benefit of eliminating most of the specialized data-structures at run-time is that the operations which support dynamic data mangling become harder to distinguish from the code to which it is applied.
3.3. Choosing Invertible Matrices over Z/(2w). To create an invertible matrix M over Z/(2w) and its inverse M−1, we proceed as follows.
Choose upper-triangular invertible matrices with nonzero elements on and above the diagonal, where an n×n upper-triangular invertible matrix U=[ui,j]n×n is chosen so that
Independently choose two such random upper triangular matrices X, Y. Then M←XYT and M−1←(YT)−1X−1.
This approach ensures that the computation of inverses is very easy since all inversions are computed on upper triangular matrices, which are already in row-echelon form where all leading row elements are units of Z/(2w).
3.4. Virtual Machine and Instruction Set. The proposed form of implementations is programmatic and operational. We therefore define it from the ground up in terms of a virtual machine (
3.4.1. Root Instructions. Root instructions comprise seven fields: a 29-bit opcode, three 1-bit literal flags L1, L2, L3, and three 32-bit operands operand 1, operand 2, operand 3, each of which is literal if the corresponding literal flag is set and a register number otherwise (see The root instruction set is shown in Table 3.
3.4.2. Implied Instructions and the Basic Instruction Set. Implied instructions, each based on special use of a basic instruction, are shown in Table 4.
The set comprising the root and implied instructions comprises the
3.4.3. Correspondence with C Language Operators. The basic instructions closely correspond to operators in the language C.
The Boolean comparisons
Note that
The above behavior on 32-bit ints and unsigned ints is not part of the
Thus there is a close correspondence between the above
3.4.4. Macro Instructions. Macro instructions represent idioms used in the implementation of base function pairs. Each macro instruction can very easily be expanded into a body of code which contains only basic instructions (see § 3.4.2), possibly with the use of some extra temporary registers. Reasonable expansions are obvious and therefore omitted.
The general form for a macro instruction is roughly
mnemonic[parameters] d1, . . . , dn←s1, . . . , sm
denoting a mapping taking an input vector comprising register values (s1, . . . , sm) and producing an output vector comprising register values (d1, . . . , dn).
The (one or more) parameters may be values, or one or more source registers (typically only one: s0), or sequences of one or more instructions, in which case this inner sequence is modified by the outer macro instruction of which the sequence is a parameter.
The macro instructions comprise the following:
Store si in M[d+i−1] for i=1, . . . , n; then set r←r+n. Typically, r would specify the stack pointer register.
Set r←r−n; then load di from M[d+i−1] for i=1, . . . , n. Typically, r would specify the stack pointer register.
where mnM is an m×n matrix over Z/(232), which, where s=(s1, . . . , sm) and d=(d1, . . . , dn), computes d=Ms, with d, s treated as column vectors during the computation:
where, using register or literal i0 and letting
k←(−1)i
with Λ computed bitwise over B32, which computes, over Z/(232),
di←2ksi+└2k−32si┘
for i=1, . . . , n when k≧0, and computes
di←232+ksi+└2ksi┘
for i=1, . . . , n when k<0;
where, using register or literal i0 and letting
with Λ computed bitwise over B32, which, letting
over 0, computes, over Z/(232n),
D←2kS+└2k−32nS┘
for i=1, . . . , n when k≧0, and computes
D←232n+kS+└2kS┘
for i=1, . . . , n when k<0;
where i1, . . . , ik are instructions, which computes the instructions sequentially, where s1, . . . , sm are the registers from which the sequence inputs and d1, . . . , dm are the registers to which it outputs;
where 2≦ci≦232−1 for i=1, . . . , k and 1<Πi=1kci≦232 −1, assigns
for i=1, . . . , k, where we assume Πj=10e(j)=1 where e is an arbitrary function; i.e., the product of no elements at all is always 1;
where i1, . . . , ik are instructions, which computes the single instruction i└2
3.5. Modelling Program Structure. We use a model from the so-called red dragon book [1].
For every basic
Accordingly, during construction, we view our function routine implementations as control-flow graphs (
We restrict the control-flow graph to have a single sink node, and only this sink node's
Within a node of the
We include here our original proposal of a method for building white-box trapdoor one-way functions in mutually inverse pairs.
The proposal makes use of the following.
The construction is shown in
Now suppose that we can mix inputs in pairs. There are now five slots to guess, and the above attack complexity, again granting the attacker the maximal expected ‘birthday paradox’ advantage, is an attack complexity of 25w/2, which for w=32 is 280 tries and for w=64 is 2160 tries. Plainly, then, it is highly advantageous if we can inextricably mix inputs (and, for symmetry, outputs)—hence we have 2×2 mixings on entry to ƒ.
The Mark II proposal is similar to Mark I (see § 4) in that it had a fixed internal structure, with only coefficient variations among base function implementation pairs.
5.1. Initial Structure: Choosing ƒK and ƒK−1. The initial program does not employ internal arrays. Except for the initial accessing of the input and the final delivery of the output (i.e., except for the implementation of the
All computations operate on B32 and produce results from B32, but for
We consume K (key) entropy in the construction of ƒK, and the specification of ƒK then admits of only one specification of ƒK−1 with exactly the same structure (but with different coëfficients, of course).
The basic structure of either ƒK or ƒK−1 is shown in
5.1.1. Data-Flow. The data-flow along the arrows in
5.1.2. Independent, Random Choice of Similar Components. For the ƒK specification, where two components in
5.1.3. n×n Versus n:n. Some component labels in
The n×n indicates that the component has n inputs and n outputs, and executing the component can move entropy from an input to a non-corresponding output (as in mapping a vector through a matrix).
The n:n indicates that the component has n inputs and n outputs, and executing the component can only move entropy front an input to a corresponding output; i.e., in effect, such a component consists of n side-by-side scalar operations, so that a 4:4 recode takes four scalar values, and recodes each one separately with no interaction with any of the others.
5.1.4. Selection Components. The selection components in
Those labelled select 1 of 2 4×4 permut'ns have the form
where p1, p2 are randomly chosen 4×4 permutations, with s0 coming from a 4×4 S via a 4:4 recode.
Those labelled select 1 of 2 4:4 recodes have the form
with s0 coming from a 4×4 S via a 4:4 recode, where each ri is a
with all ei encodings in the
5.1.5. Four Occurences of Function-Indexed Interleaving. Function-indexed interleaving, described in § 2.9.2, appears four times in an ƒK or ƒK−1 specification. Each time it comprises three 4×4 linear mappings (
Each instance of function-indexed interleaving has a single left-side function and 24=16 right-side functions.
5.1.6. Other Components. The remaining components are not within instances of function-indexed interleaving, comprising three occurences of an 8:8 recode, each of the form
and two occurences of an 8×8
with (for ƒK) a single, randomly chosen permutation, and eight occurences of a 2×2 mixer, each of the form
where M is a 2×2 matrix chosen, for ƒK, by the method given in § 3.3.
5.2. Obfuscating ƒK or ƒK−1 Implementations. The following methods are employed to obscure a program implementing ƒK or ƒK−1, where implementations have the common structure detailed in § 5.1 and diagrammed in
The transformations in the following performed one after are the other except where otherwise noted in the body of the sections.
5.2.1. Copy Elision. Naïve code for ƒK or ƒK−1 implementations contains many
This is especially effective in the case of
The rule is that any
More specifically, assuming that we can readily associated a value producer with its value consumers in
A
Copy elision can be performed at various points in the following process, and is certainly done as a final step to remove redundant
5.2.2. Branch-to-Branch Elision. A related form of elision can be performed on branches. If a basic block (
Branch-to-branch elision can be performed at various points in the following process, and is certainly done as a final step to eliminate branch-to-unconditional-branch sequences.
5.2.3. Unused Code Elimination. When code is in
This can be done at various times during obfuscation, and is certainly done as a final step to eliminate unused code.
5.2.4. *Hash Insertion and Generation of Distinct Dynamic Values. Choose a 1×8 hash matrix of randomly chosen distinct odd elements over Z/(232) and generate code which maps the original inputs through this matrix yielding a single output. Place the code for the hash-matrix computation (initially a
Next, choose a permutation polynomial (
5.2.5. Macro-Instruction Expansion. All macro-instructions are expanded to sequences of basic instructions. The expansions are trivial and therefore omitted here.
After expansion. only basic instructions remain.
5.2.6. *Control-Flow Duplication. One matrix is added in § 5.2.4, mapping all eight inputs to one output, and there are 20 matrices shown in
The hash matrix-computation is initially the first matrix-mapping computation. We take the code for matrices in a horizontal row, such as the 2×2 mixer row near the beginning and end of the
In terms of the representation noted in § 3.5, depending on which of the 20 matrices we are dealing with, the code for computing the effect of the matrix on the 2- or 4-vector to which it is applied appears in the representation as a straight-line sequence of instructions which
To accomplish the above transformation, we proceed as follows per
5.2.7. Come-From Insertion. If the implementation is not currently in
Then, for each Boolean comparison
At the true destination of the
Remember that the outputs of the instructions computing rc and rd should be identical, for future use.
5.2.8. *Data-Flow Duplication. In a manner described below, for every instruction which is not a
To accomplish this transformation, we proceed as follows, as shown in
We add a new instruction
We use
5.2.9. *Random Cross-Connection. If the implementation is not currently in
Due to transformations applied in § 5.2.6, § 5.2.8, and § 5.2.7, many instructions belong to pairs which are statically known to produce identical outputs. Such cases were noted in these sections, with the added remark that the information on such identical outputs should be retained for future use. We now make use of this saved information. The number of copies is always two: two for data-flow duplication, two for exported control-flow duplication (since both control- and data-flow duplication have been applied to them, but only one instance of a control-flow duplicated computation occurs in an execution of the implementation), and two for ‘come-from’ insertion.
There are two ways in which a pair of instructions in
Let u1, u2 be a pair instructions which are known on the basis of such saved information to have identical outputs, each ui taking k inputs, where k is either one or two if the instruction is a basic instruction (e.g.,
With probability ½, we flip use of the u1, u2 outputs as follows: for every instruction consuming the u1 output (if any), we modify it to take the u2 output instead, and vice versa.
We repeat this for every possible such pair u1, u2 until no such pairs remain to be considered for flipping.
The effect of this transformation is as follows. As a result of data-flow duplication, except for the very beginning and end of the implementation, data-flow is split into two distinct subgraphs which never overlap. After random cross-connection, these two data-flow graphs have been thoroughly merged into a single data-flow graph.
5.2.10. *Check Insertion. If the implementation is not currently in
As in random cross-connection in § 5.2.9, we proceed through the pairs u1, u2, say, of instructions known to have identical outputs as a result of value duplication due to the processing in § 5.2.6, § 5.2.8, and § 5.2.7.
As in § 5.2.9, such instructions may either be basic instructions or φ-assignments, and we use exactly the same criterion for identifying such pairs as in § 5.2.9.
Successively choose such pairs of instructions with known identical outputs due to duplication resulting from steps § 5.2.6, § 5.2.8, and § 5.2.7, until each pair has been chosen.
For each such instruction pair ua, ub, say, select, uniformly at random from all choices of uc not previously used as a uc in such processing, or if no such choice exists, from all choices of uc including those previously used as a uc in such processing, a single instruction uc such that uc is dominated by both of ua, ub. (If no such uc exists at all, do not further process the ua, ub pair: simply proceed to the next pair, or if none remains, terminate the processing according to this section.)
Let oa, ob, oc be the outputs of ua, ub, uc, respectively. Immediately following uc, place code to compute od←oc+oa−ob, and cause all inputters of oc to input od instead. (Since oa=ob, we should have od=oc, so this should have no net effect unless an attacker tampers with the code.)
Continue such processing until all such pairs ua, ub have been selected.
(The rc, rd checks in connection with § 5.2.7 help prevent branch jamming; the others help to foil purturbation attacks by causing downstream computations to malfunction if one member of a pair is modified without modifying the other.)
5.2.11. Transcoding. If the implementation is not currently in
Take each binary operation computing
z←f(x,y)
where ƒ is one of +, −, or *, and replace it with a computation which is the algebraic simplification of
e3(z)←ƒ(e1−1(x), e2−1(y))
or equivalently, replace the operation ƒ with an algebraic simplification of
e3 ∘ƒ∘[e1−1, e2−1]
such that for each arc connecting a producer to a consumer, the encoding (the ei function) of the produced value matches the encoding assumed by the consumer (where the inverse of the encoding is applied). That is, perform network encoding (see § 2.3.1).
When the output z above is used as the input of a comparison
Where an input is a constant c, replace it with some constant ec(c), and treat it as if it came from a producer which produced it with encoding ec.
Sometimes it is not possible to make all the producer and consumer encodings match everywhere they should. Where this occurs, produce with an output encoding ea and an input encoding eb and insert eb∘ea−1 on the arc to resolve the conflict.
Each ei is a bijective quadratic permutation polynomial (
5.2.12. Register Minimization. If the implementation is not in
We now derive a conflict graph for the lifespans in registers. A lifespan begins when a value is produced (i.e., is output to the register by an instruction) and ends at the point where no further uses of the value are made (i.e., after the last time the value output by an instruction is used as an input with no intermediate changes to the register in between placing the value in the register and using it): that is, after the last consumer connected by a data-flow arc to the consumer has completed execution. Two lifespans conflict (i.e., overlap) if they begin at different producers and there is a point in execution at which both are both have been started and neither of them has ended.
We can view this as a graph where the lifespans are the nodes and an arc connects two nodes if and only if the lifespans conflict. The significance of the graph is that, if two lifespans conflict, their produced values must be stored in different registers, whereas if they do not, their produced values may be stored in the same register.
The
Starting with the nodes of minimal degree in the graph, we remove nodes one at a time with their incident arcs, until all nodes have been removed. We then reinsert them in reverse order, with any arcs which were removed with them, choosing registers for them as we reinsert them. This is a variant on Chaitin's algorithm, and tends to produce efficient graph colorings (i.e., register allocations) in the sense that the number of distinct colors (registers) tends towards the minimal number.
Retain lifespan information and the conflict graph for further use in § 5.2.13.
5.2.13. *Memory Shuffling. If the implementation is not in
Include in the implementation a memory array A containing 2ρ binary words, where ρ=┌log2 ┐ (see § 5.2.4).
Identify in the code all instances of a contiguous pair of instructions (
Associate with P1, . . . , PN values K1, . . . , KN, initially all equal to 1.
Traverse K1, . . . , KN. At each Ki, probability ½ changing each traversee's value to 2. Traverse the Ki's of value 2, with probability ½ changing each traversee's value to 3. Traverse the Ki's of value 3, with probability ½ changing each traversee's value to 4.
At this point, for each pair Pi, there is a value Ki with a value belonging to the set {1, 2, 3, 4}.
Define R1, . . . , RN as follows. Let Ri be the number of points in the live range of the pair's output (the y computed by the affine mapping above) at which a non-branch basic instruction can be inserted which would lie in the live range if it were inserted. Ri is a measure of the size of the live range.
Define W1, . . . , WN as follows. Let Wi be the cardinality of the largest set of instructions overlapping the live range (i.e., either in the live range, or starting the live range by outputting its value, or terminating a path in the live range by consuming its value) such that no member of the set dominates any of the others. This estimates the ‘width’ or path-multiplicity of the live range.
For each such live range of a y winch is the output of a pair Pi, with a probability which is the smaller of 1 and KiWi/Ri, select each point at which an instruction can be inserted into the range as noted above, so that, in the fairly common case where Wi=1, there is an expected number Ki of such selected points in the live range for the y output of Pi. Let the set of selected points for a given live range be Si so that the expected value of |Si|=Ki where Wi=1. (Of course, the actual value of |Si| may differ.)
Define F1, . . . , FN as follows. In the live range of the y-output of pair Pi, plainly each instruction, say w, inputting this y-output is dominated by the pair-member producing the y-output: call it m. If for each such w, there is an sεS so that m dominates s which in turn dominates w, Fi=1. Otherwise, Fi=0.
We now restrict our attention to those pairs Pi for which Fi=1. For each such pair Pi, we allocate a new set of |Si|+1 indexes in A, j, . . . , j+|S
Remove the pair Pi—a (
We proceed as above for every pair Pi for which Fi=1. We then convert the implementation to
5.2.14. Random Instructions Reördering. If the implementation is not in
Ensuring that redundant
5.2.15. Final Cleanups and Code Emission. Perform copy elision (see § 5.2.1), branch-to-branch elision (see § 5.2.2), and unused code elimination (see § 5.2.3).
Perform register minimization (see § 5.2.12) to minimize the number of registers (temporary variables), but making no attempt to change the number of locations used in the shuffling array A (see § 5.2.13). When minimization completes, the code is in
Emit the code.
The Mark III proposal differs from that for Mark I (see § 4) and Mark II (see § 5) in that it has a variable internal structure in which both coëfficients and structure vary among Base function implementation pairs.
As previously, the primary vehicle is a mutually inverse pair of cipher- or hash-like function implementations formed in mutually inverse pairs according to an algorithm, belonging to a very large family of such pairs, with the precise pair determined both by the algorithm and a (typically large) key K. In addition to the key information K, the algorithm which forms the pairs consumes randomization information R, which is used to specify those obfuscational aspects of the implementation which do not affect the external behavior of the pair, but only the internal processing by which this external behavior is achieved.
6.1. Design Principles. We expect Mark III to be used in environments in which the implementation is exposed to white- and/or grey-box attacks, and in which the operation of the applications making use of Mark III involve communication across a network.
6.1.1. Security-Refresh Rate. For effective applications security lifecycle management, applications must resist attacks on an ongoing basis. As part of this resistance, we expect such applications to self-upgrade in response to security-refresh messages containing security renewal information. Such upgrades may involve patch files, table replacements, new cryptographic keys, and other security-related information.
A viable level of security is one in application security is refreshed frequently enough so that the time taken to compromise an instance's security is longer than the time to the security-refresh which invalidates the compromise; i.e., instances are refreshed faster than they can typically be broken.
This is certainly achievable at very high security-refresh rates. However, such frequent refresh actions consume bandwidth, and as we raise the refresh rate, the proportion of bandwidth allocated to security-refresh messages increases, and available non-security payload bandwidth decreases.
Plainly, then, engineering the appropriate security-refresh rate is required for each kind of application, since the tolerable overheads vary greatly depending on context. For example, if we expect only gray-box attacks (neighbor side-channel attacks) in a cloud application, we would use a lower refresh rate than if we expected white-box attacks (insider attacks by malicious cloud-provider staff).
6.1.2. External and Internal Vulnerabilities and Attack-Resistance. Suppose that our pair of implementations implement functions ƒK, ƒK−1 where ƒK, ƒK−1 are T-functions. Then by repeatedly applying either of these functions, we can precisely characterize its computations using a bit-slice attack in which we first consider the operation of these functions ignoring all but the low-order bits, and then the low-order two bits, and so on, gaining information until the full word size (say 32 bits) is reached, at which point we have complete information on how the function behaves, which is tantamount to knowledge of the key K.
This is an external vulnerability. While the attack gains knowledge of implementation details, it does so without any examination of the code implementing those details, and could be performed as an a adaptive known plaintext attack on a black-box implementation.
A less severe external vulnerability exists if the functions of the pair have the property that each acts as a specific T-function on specific domains, and the number of distinct T-functions is low. In this case, a statistical bucketing attack can characterize each T-function. Then if the domains can similarly be characterized, again, without any examination of the code, using an adaptive known plaintext attack, an attacker can fully characterize the functionality of a member of the pair, completely bypassing its protections, using only black-box methods.
Plainly, we must ensure that the effective number of distinct T-functions is sufficient to foil the above attack. (In Mark III implementations, there are over 108 distinct T-functions per segment and over 1040 T-functions over all.)
Now, suppose that the pair of implementations comprises functions which achieve full cascade (every output depends on every input, and on average, changing one input bit changes half of the output bits). An example of an internal vulnerability occurs in the Mark II implementation where, by ‘cutting’ the implementation at certain points, we can find a sub-implementation (a component) corresponding to a matrix such that the level of dependency is exactly 2×2 (in which case the component is a matrix) or 4×4 (in which case it is one of the L, S, or R matrices. Once these have been isolated, properties of linear functions allow very efficient characterization of these matrices.
This is an internal attack because it requires non-black-box methods: it actually requires examination of internals of the implementations, whether static (to determine the dependencies) or dynamic (to characterize the matrices by linearity-based analyses).
As a general rule, the more we can completely foil external attacks, and force the attacker into increasingly fine-grained internal attacks, the harder the attacker's job becomes, and most especially, the harder the attacks become to automate.
Automated attacks are especially dangerous because they can effectively provide class cracks which allow all instances of a given techology to be broken by tools which can be widely distributed.
Thus, we seek, by using variable and increasingly intricate internal structures and increasingly variegated defenses, to create an environment in which
6.2. Initial Structure: Choosing ƒK and ƒK−1. Mark III functions have an input and output width of 12 32-bit words for a total width of 384 bits. The implementation consists primarily of a series of segments, in which each segment is an instance of function-indexed interleaving (
We will mainly deal with ƒK. The segment inverses are fairly obvious given our well-known
Each such segment has a left-function, a selector computation which uses the same inputs as the left-function, and a right-function. The right-function is a nested instance of
6.2.1. Selecting Matrices Over Z/(232). We select matrices in two different ways:
6.2.2. *Initial and Final Mixing Steps. In § 2.8, we give techniques for permuting a sequence of elements or other forms of choices using decisions having a sorting-network topology. By replacing conditional swaps with 2×2 bijective matrices mixing each input into each output, we can take precisely the same network topology and produce a mixing network which mixes every input of the
6.2.3. *Subdividing a Segment's Input and Output Vectors. The following choices are an example only: many other choices are possible with different widths and wider choices of division-sizes.
If input subvectors for a segment are statically divided in a particular way, say 3-5-4 for left, middle, and right, respectively, then so are its outputs.
The permitted subvector lengths for the above are three, four, five, and six 32-bit words. Since each input and output vector has length twelve 32-bit words (384 bits), it follows that the ten permitted configurations, in lexicographic order from left to right and then down, are
3-3-6 3-4-5 3-5-4 3-6-3 4-3-5
4-4-4 4-5-3 5-3-4 5-4-3 6-3-3
If we number the above ten configurations in order from 0 to 9, then the number of the configuration chosen for each segment we generate is chosen statically by rand(10)l; i.e., we choose from the ten possibilities above uniformly at random at construction time.
6.2.4. *Selecting the Ordering for a Segment's Inputs and Outputs.
The first segment inputs the initial inputs to ƒK or ƒK−1, and hence is input-unconstrained. Similarly the last segment outputs to ƒK or ƒK−1, and hence is output-unconstrained. Thus the inputs of the first segment, or outputs of the last, are attached to the initial inputs or final outputs, respectively, uniformly at random.
In all other cases, we select the ordering of inputs and outputs of segments as follows.
We note that, for any segment, the outputs of its left output-subvector depends only on the inputs of its left input-subvector, the outputs of its middle output-subvector depends only on the inputs of its left and middle input-subvectors, and the outputs of its right output-subvector depend on the inputs of the left, middle, and right subvectors.
We therefore statically link the inputs of a segment Y to the outputs of its preceding segment X uniformly at random under the following constraints.
6.2.5. *A Concatenation of Segments. ƒK (and hence ƒK−1) is a sequence of segments. Each segment's basic configuration r-s-t is chosen statically according to § 6.2.3, and each is statically linked from the original inputs or from its predecessor according to § 6.2.4. The number of successive segments making up an ƒK (and hence ƒK−1) implementation is uniformly randomly chosen from the set {5, 6, 7}.
6.2.6. *Immutable Encodings. At certain points in the code, we use immutable encodings. The significance of an immutable encoding, whether it is the identity encoding, a linear encoding, or a permutation polynomial encoding, is that it cannot be changed when obfuscation is applied to the ƒK or ƒK−1 implementation: its presence is part of the semantics and therefore cannot be modified.
If immutable encodings are mentioned without specification of the encoding, a permutation polynomial is assumed.
6.2.7. *Creating a Segment. Given a configuration r-s-t (for example), we create an ƒK segment as follows, per
6.3. Obfuscating ƒK or ƒK−1 Implementations. The following methods are employed to obscure a program implementing ƒK or ƒK−1, where implementations have the structure given in § 6. above.
The transformations in the following sections are performed one after the other except where otherwise noted in the body of the sections.
6.3.1. Cleanups. The cleanups listed in § 5.2.1, § 5.2.2, and § 5.2.3 are performed as needed, as in the Mark II implementation.
6.3.2. *Hash Insertion and Generation of Distinct Dynamic Values. The transform of § 5.2.4 is performed, but using a 1×12 matrix taking all of the inputs. Otherwise, this is very similar to the corresponding Mark II step.
6.3.3. Macro Instruction Expansion. This is done as in the Mark II implementation.
6.3.4. Come-From Insertion. This is done as in the Mark II implementation. Note that, in Mark III, all of the control-flow exists to create the nested per-segment loops.
6.3.5. Random Instruction Reordering. We note that, in function-indexed interleaving (
If the implementation is not in
We now topologically sort each segment by itself, thereby mixing the r, s, and t instruction sequences randomly.
We similarly topologically sort the initial mixing by itself, and the final mixing by itself.
We concatenate the sorted orderings: initial mixing, segment 1, segment 2, . . . , segment k, final mixing. Create a new relation R representing the ‘precedes’ relationship in this concatenated ordering. Create a new relation R′ by removing one in every two arcs (x, y)εR uniformly at random, and, uniting R′ with the execution constraints to form the over all ‘precedes’ relation, topologically sort the entire sequence again.
Instruction reördering is now complete.
6.3.6. *Data-Flow Duplication. This is performed as in the Mark II implementation (see § 5.2.8).
6.3.7. *Random Cross-Connection. This is done as in the Mark II implementation (see § 5.2.9).
6.3.8. *Check Insertion. This is done as in the Mark II implementation (see § 5.2.10 on p. 44), with the following change: among the candidate placements for a check, with probability ½, a candidate within the current segment is chosen (where such a candidate exists), and with probability ½, a candidate in a later segment is chosen (where such a candidate exists). As a result of this change, and of the modified reördering scheme in § 6.3.5, with high probability all of r, s, t segments are cross-connected and made dependent on one another by the inserted checks.
6.3.9. Transcoding. This is done as in the Mark II implementation (see § 5.2.11).
6.3.10. Register Minimization. This is performed as in the Mark II implementation (see § 5.2.12).
6.3.11. *Memory Shuffling. This is performed as in the Mark II implementation (see § 5.2.13). Note that, since we have loops but no if-then-else, the Wi's are generally minimal, which eliminates some anomalies which could arise in the Mark II implementation.
6.3.12. Final Cleanups and Code Emission. These are performed as in the Mark II implementation (see § 5.2.15).
The value of a member of a pair of mutually inverse base functions is greatly increased if it can be anchored to the application which employs it and the platform on which that application resides, and if its data and code can be blended with the data and code of the application of which it forms a part, in the sense that the boundary between different kinds of data or code becomes blurred.
The effect of such anchoring and blending is to
In addition to the above forms of blending, we seek to anchor code and data to their context by means of interlocking techniques including
7.1. Data-Dependent Coefficients. Examining the formulas for permutation-polynomial inverses (see § 2.3.2, § 2.3.3, and § 2.3.4), we note that multiplicative ring inverses over the word ring's (typically 232 or 264 on current computers) are used extensively. (They are the denominators in the fractions in the formulas: e.g., a/c4 means ac−4 which means a(c−1 )4 where c−1 is the multiplicative ring inverse of c.)
For a machine with a w-bit word, c and c−1 are two numbers such that c·c−1=1, where · is the multiplication operation operation within the ring, i.e., it is multiplication of two w-bit binary words with overflow ignored as in C and C++.
While we can easily find such inverses computationally by employing the Extended Euclidean Algorithm [15, 26], this is undesirable because the algorithm is easily recognizable. Thus we need another means of converting some of the entropy provided by input data into a choice of random coëfficients for permutation polynomials.
We recommend an approach along these lines: in advance, randomly choose numbers
a0, a1, a2, . . . , aw−1
in which each ai is an odd number in the range 3 to 2w−1 inclusive, all ai's are pairwise distinct, and there is no pair ap, aq in the list such that ap·aq=1. We will also employ their multiplicative inverses
a0−1, a1−1, a2−1, . . . , aw−1−1
found in advance using the Extended Euclidean Algorithm noted above.
Then for any random nonzero word value v chosen from the early computations within a
If w=32, this gives us a very large number of potential coëfficients and inverse coëfficients. In fact, the number is so large that we may choose to use only part of v—i.e., replace w by some smaller number and have a smaller number of ai's and their inverses—which is probably still adequate: 18 bits instead of 32 still would permit a selection of over 200,000 coëfficient+inverse coëfficient pairs.
Note that we have only provided a means for generating odd coëfficients. Other kinds of coëfficient are easier to generate, since either we only require their additive inverses (even elements don't have multiplicative inverses). In order to generate a coëfficient which is even, we simply double a generated value v. In order to create on whose square is 0, we simply logically left shift v by ┌w/2┐ positions (i.e., we multiply it by 2┌w/2┐ with overflow ignored).
7.2. Fine Control for Encoding Intensity. In the current Transcoder, there are settings called data-flow level and control-flow level which nominally run from 0 to 100 indicating how strongly encoded the data- or control-flow should be.
Traditionally, the mechanisms used to effect this ostensibly fine-grained control are of two varieties:
We keep a running tally of total sites to be covered, sites covered so far, and how many received the probability-controlled transform (the included sites) and how many did not (the excluded sites). When the ratio of included sites is below the desired ration, we increase the probability of performing the transform above its nominal value, and when it is above the desired ration, we decrease the probability of performing the transform below its nominal value. A proper setting for the degree of increase and decrease can be gauged by experimentation. This can effectively cause the actual ratio for an affected region of code to be protected to closely track the desired ratio, instead of wandering away from that ratio due to chance effects.
This will have its best effect when the total number of potential sites is large. Little fine-grained control can be exercised if only a few sites exist, short of massive code duplication to increase the effective number of sites.
This readily extends to cases with more than two choices. Consider for example the use of permutation polynomial encodings over Z/(232) (or over Z/(264) for recent, more powerful platforms). If we vary among no encoding or encodings of degrees 1 through 6, then there are seven possible choices to be covered, amongst which we apportion the probabilities according to the desired ratios. The same principle applies: if we are getting too little of something, we push its probability up; if we are getting too much, we lower its probability down.
7.3. Input and Output Boundaries. At an input boundary, unencoded data must be encoded and brought from its unprotected domain into the protected domain. An an output boundary, protected data must be decoded and brought from the protecded domain into its unprotected domain.
This is an appropriate place to deploy fine control of encoding intensity (see § 7.2) for data-flow. Measuring data-flow distance in number of graph arcs in the data-flow graph, where an arc connects a value-producing operation to the operation which consumes it, we proceed as follows.
Additional protections which apply to input/output boundaries are data-dependent coëfficients to increase the dependency of the computations at the entry of the base function on the code which provides the inputs and to increase the dependency of the computations receiving the base function outputs on the code within the implementation which provides those outputs, and shared blackboards (if data can enter and leave by via a shared blackboard—an instance of dynamic data mangling—then it is much harder for an attacker to follow the data-flow for that data).
7.4. Entry and Exit Boundaries. Typically, the point at which an implementation receives its inputs immediately follows the point at which control enters the implementation, and the point at which an implementation provides its outputs immediately precedes the point at which control leaves the implementation.
As a result, all of the protections in § 7.3 typically also protect the entry and exit boundaries. However, the implementation will typically have stronger control-flow protections than regular transcoded code.
Therefore we need to perform fine-grained stepwise increment on entry and stepwise diminishment on exit of the control-flow level. Our metric for distance here is the estimated number of F
This would be an excellent place to deploy control-flow corruption and repair to tie together the code nearing the entry and the protective entry code, and the protective exit code and the code moving away from the exit, to increase the level of protection in the vicinity of the protective entry and exit.
7.5. Separating and Mixing Boundaries. The general situation in which we encounter separating and mixing boundaries is one in which structured data is output in lightly encoded or unencoded form from an implementation, or lightly encoded or unencoded structured data enters an implementation, or a pair of implementations of the invention are used to sandwich a decision-making computation which we wish to hide.
The effect of separating and/or mixing is that we have potentially exposed data after the separation or prior to the mixing, creating an attack point. Thus, in addition to the relevant protections for these situations already covered in § 7.3 and § 7.4, we need stronger protections for any computations which we need to sandwich between base functions used as separating or mixing functions.
If the decision is based on checking a password, or some similar equality comparison, we strongly recommend the method of § A as the best choice for its protection. However, we are rarely so fortunate.
The more common case is that we need to perform some arithmetic, some comparisons, some bitwise Boolean operations, and so on. For these, we recommend the following protections (see § 7):
7.6. General Protections. Certain protections can be applied at every boundary, and between boundaries, in order to further protect code in contexts where base-functions are deployed, namely control- and data-flow corruption and repair, parallel functions, and subset lumps and pieces. Where feasible, these added protections will increase the analytical difficulties faced by the attacker: in particular, they will render static analysis infeasible and dynamic analysis costly.
7.7. Exemplary Protection Scenario. Data is provided in a form encoded via a base function, so that information is smeared across its entire state-vector. The data thus encoded comprises
The attacker's goal is to obtain the 128-bit key irrespective of the content of the fields and the information on the current platform. The defender's goal is to ensure that the key is correctly delivered on a ‘yes’ decision unless the defender's implementation is tampered with, but is not obtainable by the attacker in situations where the decision would be ‘no’ in the absence of tampering.
This captures the primary blending needs of the protective system: there are input, output, entry, exit, separation, and mixing boundaries to protect.
7.8. Implementing the Protections with Blending. Here we describe the implementation of the protections from data-flow-dependent coëfficients through subset lumps-and-pieces listed starting in § 7 for the protection scenario described in § 7.7 as proposed in § 7.2 through § 7.6.
7.8.1. Starting Configuration. Our starting configuration comprises the Transcoder intermediate representation of the protective system core, a 128-bit×256-bit function, into which the containing application inputs a 256-bit value containing in encoded form a 128-bit encoded key and a 128-bit data structure and from which the application receives a 128-bit differently encoded key ready for use.
The core comprises
The combination of the core and the application is called the program.
7.8.2. *Subdividing Segment Input and Output Vectors. The following material is exemplary: far wider choices exist. Here we choose doubly recursive function-indexed interleaving, yielding three-part division of segments. It could also be singly recursive (two-part division), triply recursive (four-part division), or order n recursive ((n+1)-part division).
In § 6.2.3 a division was given for I/O vectors in the 12-words-wide (384-bit I/O) Mark III implementation. According to the above, we have an 8-words-wide entry base-function and a 4-words-wide exit base-function. We subdivide entry segments as follows:
2-2-4 2-3-3 3-2-4 3-3-2 4-2-2
If we number the above four configurations in order from 0 to 3, then the number of the configuration chosen for each segment we generate is chosen statically by rand(4); i.e., we choose from the four possibilities above uniformly at random at construction time.
For the exit base-function, the segments are subdivided as follows:
1-1-2 1-2-1 2-1-1
If we number the above three configurations in order from 0 to 2, then the number of the configuration chosen for each segment we generate is chosen statically by rand(3); i.e., we choose from the three possibilities above uniformly at random at construction time.
7.8.3. *Distance Metrics. We make use of measures of distance from an operation to a core input and from a core output to an operation. There are four metrics: two for data-flow distance and two for control-flow distance.
*Data-Flow Distances. We collect input-distances down to −200 and output-distance up to +200. Beyond that point, we can ignore greater distances, and apply heuristic methods to avoid computing them.
The distance of every computational instruction in the core from the core is zero. (A computational instruction is one which either inputs one or more values or outputs one or more values.)
The distance of every other computational instruction (
We assume that, for the most part, both are not true; i.e., that either the core is not in the body of a loop in which the core is repeatedly employed, or it is in a loop, but that the loop is sufficiently extensive that we can ignore any information fed into the core which is affected by outputs from previous core executions. However, instructions may reside in routines which may be called both before and after the execution of the core, in which case the data-flow distance is a pair comprising input-distance and its output distance.
Input-distance is determined as follows.
This metric completely ignores control-flow. A return-with-value instruction is treaded as a load for this purpose. A routine-entry instruction inputting values to variables within a routine is considered to be a store-instruction for this purpose.
*Control-Flow Distance. We collect entry-distances down to −200 and exit-distances up to 200. Beyond that point, we can ignore greater distances, and apply heuristic methods to void computing them.
We view instructions as connected by directed arcs in the control-flow graph of the program, conditional branches having two outgoing arcs (leading to the successor if the tested condition is true or false) and indexed branches (case- or switch-statement branches) having multiple successors chosen by a controlling index which is tested against the case-labels of the control-structure. For a routine return-instruction, its successors are determined by the sites from which the routine is called; i.e., they are all of the instructions which may be executed immediately after return from the routine, and the return instruction is considered to be an indexed branch to those post-return instructions.
Any instruction within the core has a control-flow distance of zero from the core. As above, we assume a non-looping scenario in which any looping involving the core is sufficiently large-scale and infrequent to permit us to ignore it. However, in the case of control-flow distance, instructions may reside in routines which may be called both before and after the execution of the core, in which case the control-flow distance is a pair comprising its entry-distance and its exit-distance.
Entry-distance is determined as follows.
7.8.4. Cleanups. The cleanups listed in § 5.2.1, § 5.2.2, and § 5.2.3 are performed as needed, as in the Mark II implementation, not only for the entry and exit base-function implementations, but for the decision-block and the application as well.
7.8.5. *Hash Insertion and Generation of Distinct Dynamic Values.
Instead of performing the transform of § 5.2.4 once per base-function (i.e., performing it for the entry function, and performing it separately for the exit function), we perform this transform within the application using a 1×16 matrix whose inputs are selected from data available in the application some time before the entry base-function is computed. We use it to create an array for dynyamic data mangling which will serve the application, both the entry and exit base-functions, and the decision-block, so that they all use one shared blackboard.
7.8.6. Macro Instruction Expansion. This is done as in the Mark II and Mark III implementations.
7.8.7. Come-From Insertion. This is done as in the Mark III implementation, but extends to every branch with an entry-distance or exit-distance from the core which has an absolute value of 100 or less; i.e., it extends well beyond the limits of the implementations in the core.
7.8.8. *Control-Flow Corruption and Repair. As part of processing the code, the code is flattened: the branch labels are made destination points in a switch-statement-like construct, and destinations are reached by branching to this switch, passing it an index which corresponds to the switch case-label which leads to the desired destination.
This must be done for all code which is in the core or which is in a basic block with any instructions having a an entry-distance or exit-distance from the core with an absolute value of 100 or less.
We consider the destinations' corresponding indices to be stored in variables v1, . . . vn, corresponding to nodes in the control-flow graph which represent basic blocks B1, . . . , Bn (entered via a label and exited via a final branch, return, or call).
Prior to flattening, we randomly label each basic block in the corruption region with a total bijective function Li: {1, . . . , n}{1, . . . , n}, for i=1, . . . , n, tinder the following constraints.
After flattening, every basic block Bm is entered with the variables v1, . . . , vn in a state such that for its predecessor's Li's, Li(j)=vj for j−1, . . . , n. (This does not mean that the variables' states are correct, but only that they agree with the predecessors' Li's.) It then proceeds to swap variables so that for each variable, Lm(j)=vj—this almost certainly is a different state of v1, . . . , vn than the one with which it was entered, although in view of the constraints, the number of changes has a reasonable bound.
Thus, by the time the end of a basic block is reached, the variables correspond to destinations in such a way that current destinations are correct, but most others are usually incorrect.
7.8.9. Random Instruction Reördering. We note that, in function-indexed interleaving (
If the program is not in
We now topologically sort each segment in each of the entry and exit base-functions by itself, thereby mixing the r, s, and t instruction sequences randomly. We similarly topologically sort the initial mixing by itself, and the final mixing by itself in each base-function. We likewise topologically sort every basic block (every straight-line stretch of code without any branches or routine calls or returns) in the application and the decision-block.
For each of: the entry and exit base-functions, we concatenate the sorted orderings: initial mixing, segment 1, segment 2, . . . , segment k, final mixing. Create a new relation R representing the ‘precedes’ relationship in this concatenated ordering. Create a new relation R′ by removing one in every two arcs (x, y)εR uniformly at random, and, uniting R′ with the execution constraints to form the over all ‘precedes’ relation, topologically sort the entire sequence again.
Instruction reördering for the program is now complete.
7.8.10. *Data-Flow Duplication with Cross-Checking/Trapping. The method for these transformations is as in Mark II (see § 5.2.8, § 5.2.9, and § 5.2.10), with the modifications in Mark III (see § 6.3.8), but it is also done for additional pieces of code.
Specifically, in addition to its normal use within the entry and exit base-functions, we also perform these transformations for the data-flow within the decision-block including the transfer of information from the outputs of the entry base-function to inputs of the decision-block and take transfer of information from the outputs of the decision-block to the inputs of the exit base-function.
There are further changes to these steps for our blending scenario (see § 7.7), covered in the next section.
7.8.11. *Decision Hiding. In the decision-block, the fields of the 128-bit structure are examined, computations are performed upon them, and a pass-fail decision is reached and delivered as a value. We duplicate some of these computations so that the decision value, consisting of one of a pair of arbitrary constants cpass and cfail, is generated at least eight times. Transcoding will make these values look distinct.
Since they are duplicates, cross-linking and cross-checking apply to them. In particular, we can assume that they will yield cpass, and on that basis, perform operations on data-flow words in the key as it is input to the exit base-function which cancel on a pass but do not cancel on a fail. The cancelling values can make use of further values from the structure (if c1-c2 cancels, then so does (c1-c2)c3). The combination of this with cross-linking and cross-checking as in § 7.8.10 will cause the key to vary chaotically in a data-dependent fashion, but will, with high probability, cause a nonsense value of the same size as the key to be delivered to the application code following the exit base-function whenever the decision-block's tests on the structure lead to a ‘fail’ decision. (This method is related to the password-checking technique in § A)
7.8.12. Transcoding. This is done as in the Mark II implementation (see § 5.2.11), but with the following changes.
We divide the protection level as follows:
In addition, transcoding makes use of data-dependent coëfficients as follows.
7.8.13. Register Minimization. This is performed as in the Mark II implementation (see § 5.2.12), but for the whole program.
7.8.14. *Dynamic Data Mangling (Memory Shuffling). This is performed as in the Mark II implementation (see § 5.2.13), but affects code beyond the core. In particular, the shared blackboard provided by the shuffled memory is used to provide the inputs from the application to the entry base-function and the outputs from the entry base-function to the decision-block and the inputs from the decision-block to the exit base-function, and the outputs from the exit base-function to the application.
7.8.15. Final Cleanups and Code Emission. These are performed as in the Mark II implementation (see § 5.2.15), but for the entire program.
Suppose we have an application in which authentication is password-like: authentication succeeds where G, the supplied value, matches a reference value Γ; i.e., when G=Γ.
Further suppose that we care about what happens when G=Γ, but if not, we only insist that whatever the authentication authorized is no longer feasible. That is, we succeed when G=Γ, but if G≠Γ, further computation may simply fail.
The authenticating equality is not affected by applying any non-lossy function to both sides: for any bijection φ, we can equivalently test whether φ(G)=φ(Γ). The authenticating equality may remain valid with high probability even if φ is lossy, if φ is carefully chosen so that the probability that φ(G)=φ(Γ) when G≠Γ is sufficiently low (as it is in Unix password authentication, for example).
Based on technology previously described herein, we can easily perform such a test. We previously described a method for foiling tampering by duplicating data-flow (see § 5.2.8), randomly cross connecting the data-flow between duplicate instances (see § 5.2.9), and performing encoded checking to ensure that the equalities have not been compromised (see § 5.2.10).
We can adapt this approach to test whether G=Γ—in encoded form, whether φ(G)=φ(Γ). We note that a data-flow yielding φ(G) already duplicates a data-flow yielding φ(Γ) along the success path where G=Γ. We therefore omit, for this comparison, the data-flow duplication step. Then we simply cross-connect as in § 5.2.9 and insert checks as in § 5.2.10. By using these computations as coëfficients for future encoded computations, we ensure that, if φ(G)=φ(Γ), all will proceed normally, but if φ(G)≠φ(Γ), while further computation will proceed, the results will be chaotic and its functionality will fail. Moreover, since φ is a function, if φ(G)≠φ(Γ), we can be sure that G≠Γ.
*Version: Jan. 30, 2012.
In the theory and practice of software obfuscation and protection, transformation over Z/(2n) and more generally over Bn play an important role. ClearBox research is not an exception. In this note we present algorithms to compute the permutation inverse ƒ−1(x) of a given permutation polynomial ƒ(x) and multiplicative inverse ƒ(x)−1 of a given invertible polynomial ƒ(x) over Z/(2n). Results of special polynomial functions for efficient implementations to cooperate with general obfuscation principles are discussed and presented.
We also investigate algorithms to generate matrices over Bn with polynomials as their determinants and describe algorithms to use permutation polynomials and matrix functions over Bn to transform arithmetic operations and data arrays. These transformations can be composed with existing
1 Introduction and Notations
Let N be the set of natural numbers and Z the integer ring. Let B={0, 1}.
The mathematical base of the arithmetic logic unit of a microprocessor is abstracted in the following algebra system.
Definition 1. With nεN, we define the algebraic system (Bn, Λ, V, ⊕, , ≦, ≧, >, <, ≦s, ≧s, >s, <s, ≠, =, >>s, >>, <<, +, −, *), a Boolean-arithmetic algebra (
BA[n] includes the Boolean algebra (Bn, Λ, V, ), the integer modular ring Z/(2n), and Galois field
Note that a very basic requirement of protection design is to make its implementation easily mix with application code. Therefore, building transformations on BA[n] becomes an efficient approach. We also argue that it is sufficient because there are enough number of computational hard problems directly related to BA[n].
C2 Polynomials Over Z/(2n)
Let ƒ(x) be a function over Z/(2n), where nεN. If ƒ(x) is representable as Σi=0maixi, where aiεZ/(2n), i=0, . . . , m−1 and mεN, then ƒ(x) is a polynomial function, or a polynomial. Z/(2n)[x] is the set of all polynomials over the ring Z/(2n).
Let PP(2n)[x] be the set of all permutation polynomials in Z/(2n)[x].
Let x(k) be the falling factorial power x(x−1)(x−2) . . . (x−k+1), where kεN. Any polynomial ƒ(x) can be represented as Σk=0maix(k), where x(0) is 1.
For iεN, let v(i)=Σr=1∞└i/2r┘. Each polynomial over Z/(2n) can be uniquely expressed in the form ƒ(x)=Σj=0waj·x(j), where ajεZ/(2n−v(j)) and w is the unique integer for which 2n|(w+1)! but 2nw!. Because of this uniqueness, w is called the degree of ƒ(x), denoted by deg(ƒ(x)), or ∂(ƒ(x)).
Note that v(i) equals to the 2-adic order of i!, which is i−s where s is the sum of all digits of i in binary number representation, or the Hamming weight of i. This is quite useful in several algorithms in this note.
For polynomials over Z/(2n), the upper bound of their degrees is number w such that v(w+1)=n but v(w)<n. Assume n is a power of 2, and n=2t. Because v(n+1)=v(2t+1)=2t+1−2=2t−1<n, and v(n+2)=v(2t+2)=2t+2−2=2t=n, we have w=2t+1=n+1. For example, polynomials over Z/(232), the highest possible degree is 33.
Because of the fact that the highest degree of polynomials in Z/(2n)[x] is about ln(n), this greatly reduces the computation cost comparing to polynomials over finite field
There are quite amount of permutation polynomials over the ring. The cardinality of Z/(2n)[x] is 2n(n+2)−Σ
C3 Permutation Polynomials
For a given polynomial, ƒ(x)=Σk=0n+1akxkεZ/(2n)[x], it is a permutation if and only if a1 is odd and both Σs=1a2s+1 and Σs=1a2s are even. An interesting observation is that in falling factorial representation ƒ(x)=Σk=0n+1bkx(k), the conditions become b1 odd and both b2 and b3 even.
In this section, we provide an efficient algorithm to compute the permutation inverse f−1(x), which is also referred as composition inverse.
C3.1 Compute Preimages (Roots) of a Permutation Polynomial
For a given permutation polynomial, we have an algorithm to compute its preimages.
Proposition 1. Let y=ƒ(x)=Σi=0n+1aixi be a permutation polynomial over Z/(2n). For any given value βεZ/(2n), we can find αεZ/(2n) such that ƒ(α)=β by the following steps:
The computation is correct because for a permutation polynomial ƒ(x), the ith bit of (ƒ(x)−x) is fully determined by bit values of x i=0, 1, . . . , i−1 and coefficients of ƒ(x).
C3.2 The Inverse of a Permutation Polynomial
In this section we present the following algorithm to compute the composition inverse of any given permutation polynomials in Z/(2n)[x].
Proposition 2. Let ƒ(x)=Σi=0n+1aix(i) be a permutation polynomial over Z/(2n), and let ƒ−1(x)=Σi=0n+1bix(i) be its permutation inverse. The following steps provide a method to compute coefficients of ƒ−1(x).
The correctness of the algorithm is based on the following arguments. Since ƒ−1(x)=Σi=0n+1bix(i) is determined by (n+2) pairs of values (i, ƒ−1(i))=(i, xi), the coefficients of ƒ−1(x) can be computed by solving a system of equations.
The complexity of the algorithm is O(n2).
C4 Multiplicative Inverse Function of a Polynomial
For a given polynomial function ƒ(x) over Z/(2n), we want to determine if ƒ(x) has a multiplicative inverse function g(x) such that ƒ(x)*g(x)=1, for all xεZ/(2n), and denoted by ƒ(x)−1 if it exists. We also want to compute ƒ(x)−1.
Let MIP(2n)[x] be the set of all multiplicative invertible polynomials in Z/(2n)[x].
C4.1 Criterion of ƒ(x)εMIP(2n)[x]
Proposition 3. Let ƒ(x) be a polynomial function over Z/(2n).
Proof. Obviously, over Z/(2n), ƒ(x) has a multiplicative inverse function if and only if ƒ(x)&1=1 for all xεZ/(2n). In its falling factorial power expression, only coefficients of x(1) and constant play a role in the least significant bit because 2 divides x(k) for all k≧2. If x=0, c0 must be odd, and if x=1, c1 must be even. On the other hand, with these conditions ƒ(x)&1=1 is true for all xεZ/(2n).
The efficient algorithm is stated in the following proposition.
Proposition 4. Let ƒ(x) be a multiplicative invertible polynomial in Z/(2n)[x]. Its multiplicative inverse ƒ(x)−1 can be generated by the following steps:
The correctness of the algorithm is based on the following observation: for any invertible element αεZ/(2n), the Newton iteration used in the process doubles the number of bits in term of accuracy of computing α−1. The number 8 is used because the first 3 bits of ƒ(x) and ƒ(x)−1 are identical for all x due to the fact the first 3 bits of a and a−1 are identical for all odd number aεZ/(2n). Since polynomials are closed under the composition operation, we have the inverse in polynomial format.
Note that the algorithm with different initial values produces different intermediate computations, and therefore diversified code.
The performance of the algorithm is efficient since it takes only ln(n) iterations. This symbolic computation produces a formula of the polynomial inverse which can be used to compute the coefficient instances of the inverse.
C4.2 An Algorithm to Compute ƒ(x)−1
Another method to compute the inverse of a given multiplicatively invertible polynomial ƒ(x) is due to the fact that any polynomial ƒ(x) over Z/(2n) can be determined by the set of values {ƒ(0), ƒ(1), . . . , ƒ(n+1)}. The following is a simple algorithm.
The algorithm holds because of the simple fact that ƒ(i)*g(i)≡1mod(2n), i=0, 1, . . . , n+1. The step of trimming the coefficients is necessary in order to produce zero coefficients to have the shortest representation which is needed for efficient computations.
C4.3 Multiplicatively Invertible Polynomials with Nilpotent Coefficients
All multiplicatively invertible polynomials over Z/(2n) form a group, the unit group of Z/(2n)[x]. Its subgroups can be investigated for efficient computations in terms of reduced number of non-zero coefficients. For example, is the inverse of a nilpotent coefficient polynomial still a nilpotent one? If so, this can be an efficient subset. The following result is what we expected.
Lemma 1. Let ƒ(x)=a0+a1x+ . . . amxmεZ/(2n)[x] with nilpotent coefficients: ai2≡0mod(2n), i=1, 2, . . . , m. Then
Here is a short proof. If we let t(x)=ƒ(x)−a0, then t(x)2≡0. Therefore ƒ(x)2=c0+c1t(x). Similarly ƒ(x)3=d0+d1t(x). The first result follows from an induction on sεN. The second result can be proved by the Newton iteration process, xn+1=xn(2−ƒ(x)*xn) with x0=1 and the first result. As a matter of fact, x1=x0(2−ƒ(x)*x0)=2−ƒ(x), and x2=x1(2−ƒ(x)*x1). By induction xk is a polynomial of ƒ(x) and has a degree not greater than that of ƒ(x). The third result is easy to check thanks again to the nilpotent property of coefficients, and the proff is complete.
A Smalltalk implementation of the algorithm in previous subsection provides us the following examples of inverses of nilpotent coefficient polynomials over Z/(232)[x]:
In this section we study polynomials ƒ(x) with small representations. This is useful because a general polynomial over Z/(2n) has degree (n+1) and if a high degree permutation is used as transformation transformed code would become inefficient. Moreover code obfuscation can also benefit from small representations based on the rational that small language components make the management of code diversity and uniformity easier. Note that in the context of data transformation, small representations are required for both ƒ(x) and its inverse ƒ−1(x) (ƒ(x)−1 in case of MIP(2n)), which turns out to be a challenging issue.
For a given permutation polynomial ƒ(x) the number of its no-zero terms in conventional polynomial representation is defined as its weight wei(ƒ(x)) (in falling factorial representation, we can have similar definition of weight, but it will be treated different since there is no repreated squaring algorithm works here). Obvious wei(ƒ(x))≦deg(ƒ(x)). To have both ƒ(x) and ƒ−1(x) in small representations, put restrictions on degree is an obvious option, as in which provides a class of permutation polynomials ƒ(x) such that deg(ƒ(x))=deg(ƒ−1(x)). On the other hand, finding ƒ(x) with small wei(ƒ(x)) and wei(ƒ−1(x)) is an option to find useful small representations, because of the existence of efficient exponentiation computations such as repeated squaring method.
Polynomial function decomposition provides us another means to find ƒ(x) with small representations. If ƒ(x)=g(h(x)), deg(g(x)) and deg(h(x)) are integer factors of deg(ƒ(x)). We have similar case for multivariate polynomials, which can be morpher code of an arithmetic operation.
Polynomial factorization is our third approach to have small representations. Note that there are about 1/m irreducible polynomials of degress m in
Representing polynomials using mixed addition terms, composition components, multiplication factors provides another excellent example that the same set of techniques serve both efficient computation and software obfuscation purposes (an existing example is addition chain for
In the following subsections we describe algorithms of these three approaches as well as their mixture.
C5.1 Low Degree or Low Weight ƒ(x)
We have obtained a sufficient condition on coefficients of a permutation polynomial ƒ(x) such that both ƒ(x) and ƒ−1(x) has the same degree, which can be small.
Here is the result about the degree of h(ƒ(x)+g(t)), where ƒ(x), g(y), h(z)εPm(Z/(2n))
Let m be a positive integer and let Pm(Z/(2n)) be a set of polynomials over Z/(2n):
The degree is m and there are 2m−1 coefficients.
We investigated the case of less restricted conditions, and possible necessary and sufficient conditions for deg(ƒ(x))=deg(ƒ−1(x)), but it turned out that the theoretical condition based on a system of coefficient equations is complicated but it does shine some light on the computation of such polynomials (details omitted here). At this point we use computation to do search and would resume theoretical studies if the computation results could provide further information.
The basic computation algorithm is to apply algorithm in section 3.2 for the computation of inverse and tune the coefficients to find small representation.
Over Galois field, low weight polynomials, such as low weight irreducible polynomials are studied through computation. In this Galois ring Z/(2n) case, we shall use algorithm in section 3.2 again, to compute and find low weight ones. Again coefficient tuning process happens at runtime.
C5.2 Decomposition
Polynomial time decomposition methods over field (not necessarily finite) can ar known, but over Galois rings, no convincing general algorithm founded/discovered yet, to my knowledge so far. On the other hand, methods and ideas over fields provide valuable information for works on rings.
A special class of polynomials called Chebyshev polynomials (of the first kind) Tn(x) deserve our attention. Recall that Tn(x) can be defined by the following recurrence relation: T0(x)=1, T1(x)=x, Tn+1(x)=2xTn(x)−Tn−1(x). A property of Chebyshev polynomials is about the composition: Tnm(x)=Tn(Tm(x)). An interesting observation is that all odd indexed polynomial T2k+1(x), k=1, 2, . . . , are permutation polynomials over Z/(2n). Therefore big odd indexed Chebyshev polynomials can be decomposed into low degree Chebyshev permutation polynomials.
Note that if ƒ(x)=g(h(x)), and g(x) and h(x)εZ/(2n)[x], these components g(x) and h(x) are still permutations. Decomposition of multiplicatively invertible will be interesting, because components are not necessarily multiplicatively invertible.
C5.3 Factorization of ƒ(x) and ƒ(x,y)
Factorization of a given polynomial ƒ(x)εZ/(2n)[x] starts at Z/(2)[x]=
Most permutation polynomials are not basic primitive polynomials and have non-trivial factors. For example, permutation polynomial
ƒ(x)=x+8*x2+16*x3=x(4*x+1)2.
For any ƒ(x)εZ/(2n)[x], square-free factorization algorithm and Berlekamp's Q-matrix algorithm [] are used to factor ƒ(x)εZ/(2)[x]. Note that we may just have a partial factorization, finding two coprime factors, to go to the next step to factor ƒ(x)εZ/(2i)[x], i≧2.
The following form of Hensel's Lemma is the one having the essence of the technique.
Let R be a ring and ideal I⊂R. For any ƒεR, and any factorization ƒ≡gh(modI) of ƒ in R/I such that gcd(g, h)≡1(modI), then there exist g* and h* such that ƒ≡g*h*modI2, g*≡gmodI, h*≡hmodI, and moreover, gcd(g*, h*)≡1modI2.
Also note that h* and g* can be constructed directly from the Bzout's identity of gcd(g, h)≡1(modI).
Iterate this procress we can have desired results.
Note that factors of a permutation polynomial are not necessarily permutations. This provides another flavor in terms of diversity amoung different species. However, factors of a multiplicatively invertible polynomial are still multiplicatively invertible.
C5.4 Mixing Addition Terms, Multiplication Factors, and Composition Components
We know that all permutation polynomials over Z/(2n) form a group PP(2n)[x] based on function composition operation ∘. The unit group ∪(Z/(2n)[x], ·) of polynomial ring Z/(2n)[x] based on ring multiplication is the set of all multiplicatively invertible polynomials MIP(2n)[x] (see section 4).
Here is a simple but interesting observation:
Proposition 5. Let ƒ(x)=xh(x)εPP(2n)[x], a permutation polynomial with zero constant term. Then h(x)εMIP(2n)[x]. That is, h(x) is multiplicatively invertible.
Note that the coefficients of x(1), x(2), and x(3) of ƒ(x) must be odd, even and even, respectively. In that format these conditions enable h(x)'s constant term to be odd, and coefficient if x(1) even. The correctness of the observation follows Proposition 3.
Another observation is the intersection PP(2n)[x]∩MIP(2n)[x], which is empty (containing only odd constant functions if we allow PP(2n)[x] has constant functions). This implies that the two function sets are orthogonal in some sense.
Back to the set of Chebyshev polynomials (of the first kind) Tn(x). Previously we mentioned odd indexed ones are permutations. It is easy to see that even indexed T2k(x) (also even indexed Chebyshev polynomials of the second kind) are multiplicative invertible polynomials. Therefore big even indexed ones can be decomposed into small ones based on Tnm(x)=Tn(Tm(x)), and alternatively, it can be factored into small factors for reducible ones.
More studies can be done in this area, including algorithms to select suitable transformations for the purpose of generating highly obfuscated code.
C6 Generalized Polynomials =a0a1x. . . adxd
For a generalized polynomial to be a permutation, Klimov gave an interesting if and only if condition based on its coefficient set {a0, . . . , ad}. That is the same condition for the polynomial function ƒ(x)=Σi=0daixi, obtained by replacing all ⊕ operations with +, referred as the reduced polynomial of .
Because the associative law is invalid in , it actually represents a set of functions, generated from all possible orders of operations as well as combinations of operators + and ⊕.
An interesting new result was published in the end of 2011 on conditions of single cycle property: assuming the operation order is from left to right, that is, has functions of the format ( . . . ((a0(a1x))(a2x2) . . . (adxd)).
Proposition 6. With the order restriction and an assumption that there are no consecutive + operators, =a0a1x . . . adxd is a single cycle permutation if and only if it is a single cycle permutation over the ring Z/(25+2
This is an interesting result although Z/(25+2
C7 Matrix Transformations
Matrix functions over Z/(2n) with predetermined detrminant functions are constructed in this section for the transformations of arithmetic operations and vectors. The following is a set of matrices we try to work on:
Ω={Ms×s(ai,j(x, y, z, . . . ))|sεN, ai,j(x, y, z, . . . )εBn[x, y, z, . . .], |M|=g(x), ∀g(x)εMIP(2n)}
where Bn[x, y, z, . . . ] are multivariate functions over BA[n].
Recalled that MIP(2n) is the set of all multiplicative invertible polynomials over Z/(2n).
A few lines of explanations. This is a set of matrices whose determinants are multiplicative invertible polynomials. With a predetermined determinant a matrix in Ω can be constructed based on elementary row and column operations over the ring Z/(2n). Note that other operations in BA[n] are also involved but we “favor” multiplication and addition. The following standard algorithm which is remarkably similar to matrices over fields offers more details.
Proposition 7. Let m, nεN. Let Λn be a set of functions from BA[n][x, y, z, . . . ] referred as context function set. Let Λn∞ be the set of generated functions from Λn. The following process generates an invertible matrix M=(mi,j(x, y, z, . . . ))m×m over BA[n] (more precisely entries mi,j(x, y, z, . . . )ε(Λn∪MIP(2n))∞) whose determinant is a polynomial ƒ(x)εMIP(2n):
In the algorithm the context function set Λn is an interesting concept. This set of functions from BA[n][x, y, z, . . . ] defines the required ‘similarity’ for the matrix transformations to seamlessly blend into the application code environment. Λ can be predefined based on existing application code format and projected code format. A typical example of Λ is a set of expressions in the code context.
This concept can also helps us introduce dependencies between code variables in both application and transformations. See example in Section D.
Remark 2. An alternative algorithm to construct the matrix is by upper (or lower) triangular matrices with polynomials in MIP(2n) to form the diagonal entries and elements from Λn∞ to form the upper (or lower) enties. The product of these matrices is still in MIP(2n).
Remark 3. About the uniformity of inverses of matrices in Ω. There are two types of applications: with or without the matrix inverse code in application code. To transform vectors (data arrays) it is may not been necessary because the inverse computation can be happened in server side which does not need code obfuscation. But to transform operands in operations using matrix inverse becomes necessary to keep original functionality.
Matrices in Ω serves the later case well becase entries of the inverse matrix are composed of elements Λn and polynomials (the inverse of determinants).
Remark 4. The algorithm can be fine tuned based on precise criteria of defined code uniformity level and criteria of performance of transformed code.
C8 Block-invertible Function Matrices
In this section we construct a special set of square block matrices with block invertible properties to be applied to the coding context that both internal and external transformations keep multiplicative invertibilities.
Note that this is also an extension of the constant case construction that applied in White-Box
C8.1 The Existence of Block-invertible Function Matrices
In this section, we refer an even polynomial in (Z/(2n))[x] as a polynomial whose coefficient of x and constant term are both even numbers (relationship with the nilpotent radical of the polynomial ring Z/(2n))[x]). Let subset ψ⊂(Z/(2n))[x] be the union of multiplicative invertible polynomials and even polynomials. Then
is subring (ψ, +, *). Let Ξ=<2(Z/(2n))x, (Z/(2n))xi|i=2, 3, . . . , n+1>, the ideal generated in the ring ψ.
It is easy to verify that ψ/Ξ is isomorphic to Z: the set of multiplicatively invertible polynomials becomes odd numbers and even polynomials are turned into even numbers. We will see that this isomorphism transforms the construction method over filed Z/(2) to the ring ψ.
Note that ψ contains the subring generated by unit group U((Z/(2n))[x], *) and nilpotent radical ideal N((Z/(2n))[x], *). The matrix ring M(ψ)s×s is what we work on in this section. First we have the following result:
Lemma 2. For a given non-zero square matrix AεM(ψ)s×s, there exist two invertible matrices P, QεM(ψ)s×s such that M=P*D*Q, where D is a diagonal matrix with r ones and s−r zeros, where rεN.
Lemma 3. For any, s, rεN with s≧r, there exit two invertiable matrices T, AεM(ψ)s×s such that T=D+A, where D is a diagonal matrix with r ones and s−r zeros, where rεN.
The correctness of these two lemmas follows the isomorphism above. For this subset of polynomials in ψ, the basic idea of the construction algorithm works fine here in the function matrices cases (even over the BA algebra, essentially over the modular ring Z/(2n)).
C10 Transformations of Program Components in General
We describe an approach to transform program components (see next section for arithmetic operations and data arrays and permutation polynomials, invertible polynomials and matrices as primary transformations). Note that the approach described in this section is essentially the complexity extension of the data transformation concept of Cloakware data transformation technology.
C10.1 Transformation Process and Configurations
Definition of a configuration. In this note, a configuration is defined as a state of a set of variables (no operations) involved in the transformation process. In most cases, the variable set includes
The transformation process comprises series of
The management of configurations, which is the major part of the transformation process, can be represented by a Finite State Machine. Note that the transformation (encryption) of a program is much compicated than binary strings for cryptography purpose.
Example: existing data transformations
C10.2 Complexity Analysis of Transformed Program Components and Program
Based on the Woodenman construction requirements, we have the following program component transformations.
C11.1 Transformation of Addition
Let z=x+y be the addition to be transformed. The basic process is
The interfaces between those steps are an array of variables with specified/different configurations.
C11.2 Transformation of Multiplication
Similar steps above just replacing addition by multiplication.
C11.3 Transformation of Vectors/Arrays
Similar to steps of addition without the addition coding.
C11.4 Transformation of Addition, Multiplication and Vector
Uniform the three transformations by selections of matrix transformations.
C13 Attacks
For permutation polynomials—simplified representation
Proposition 8. Possible attacks: if all permutation polynomials can be represented by low degree permutation polynomials then there are (simplification) attacks HINT: count number of low degree permutations over Finite field to show these is no such attack
Proposition 9. Possible attacks: Using value set ƒ(i)|iε0, 1, . . . , n+1 to represent polynomials and compositions to compute the probability . . .
C14 Remarks
Java code implementation of the algorithms is tested.
C15 The Concept of Dynamic Permutation Transformations
In the existing data transformation techniques in Irdeto/Cloakware patents permutations are used to transform operands of an operation. For example, operands u, v, and w of an addition operation w=u+v can be transformed by a linear function y=a*x+b, where a and b are constants (a must be odd to be a permutation). In the computation of transformed code, variables are related to u and v only because transformed operations have fixed constants as coefficients of the newly transformed operations, such as those for add operation. Therefore we will refer these transformations as static permutation transformations. Note that data transformations used in standard public key cryptosystem such as RSA can also be regarded as static permutation transformations, because the private and public key pair becomes fixed constants at the time an entity uses them to encrypt or decrypt data.
In contrast, dynamic permutation transformations are permutations that have new variables which can be introduced into the computation context of transformations. For example, a liner function y=a*x+b can be used to transform an operand x. But in this dynamic case, coefficients a and b are variables (with one bit restriction on variable a). In this way, the transformed add operation will have three sets of new variables (total 6 in this case).
Static permutation transformations are designed to transform operands of each individual operation. These micro transformations always have small code size. Although dynamic permutation transformations can be used as micro transformations, its main goal is to introduce connections between variables for code integrity. Therefore the code size can be and should be bigger than most micro transformations. Note that these large size transformations are still within the boundary of polynomial time computational complexity in terms of original size.
Dynamic and static permutation transformations can work together to achieve a level of code obfuscation and code protections with reasonable code size expansions.
C16 Dynamic Permutation Transformations
A permutation polynomials ƒ(x)=y0+y1*x+ . . . +yn*xn over Z/(2n) can be used as dynamic permutation transformations, where y0, y1, . . . , yn are variables with conditions that y1 is odd, y2+y4+ . . . and y3+y5+ . . . are odd numbers. As in the static data transformation case, permutation inverses have to be computed.
Besides the general permutation polynomials over Z/(2n), special dynamic permutation polynomials, such as those with nilpotent coefficients can reduce the size of transformed code. Formulas of computing their inverses can be found, where all coefficients are variables in this dynamic case. The special properties of coefficient variables, such as the nilpotent properties can also be used for interlocking.
Note that nothing prevents the coefficients variables in dynamic permutation transformations have some constant coefficients as long as the permutation conditions are satisfied. They will facilitate the composition with existing static permutation transformations.
C17 Properties of Dynamic Permutation Transformations and Interlocking
In dynamic permutation transformation, there are two kinds of coefficient variables: conditional ones, such as a in y=a*x+b, and unconditional ones such as b in example above. For code obfuscation purpose, unconditional coefficient variables can be any variables from original computation context, or variables in any transformation formula, etc. The conditions ones are more interesting: the conditions can be composed with interlocking properties for the purpose of code protection. The code can be protected so because the conditions of coefficient variables are exactly the conditions for the transformation to be a permutation. Therefore breaking the conditions implies a non-permutation transformation for an operand of an operation, resulting in a faulty computation which is the way we want it happen when tampering occurs.
Because dynamic permutation conditions are represented by a property of a set of variables it becomes hard to distinguish these properties from original code properties. It is also hard to figure out coefficient variable set from all variables in the transformed code.
Besides properties of coefficient variables, conditions of the correctness of formula can also be composed with integrity verification properties: it will break the f(g(x))=x identity if the condition is broken!
Permutation polynomials are also fully determined by its roots. In addition to the normal coefficient representation, root representation format can also be used. Special root structures and value properties can also reduce the code size for more efficient computations. Note that in this dynamic context, roots are variables, not fixed values. Conditions for the correctness of root computation process can also be composed with verification properties.
Other dynamic properties in the process of computing the inverse can also be used to compose with integrity properties. For instance, the algorithm based on Newton iteration algorithm to compute modular inverse over the ring Z/(2n) works correctly only for odd variables, a nice property.
C17.1 Identities and Dynamic Equations
An equation that involves multiple variables inherently has a dynamic property: the identity itself. Mixed Boolean arithmetic identities are examples of these equations: breaking of MBA identities implies the occurrence of tampering.
Multiplicatively invertible dynamic polynomials ƒ(x) over ring Z/(2n) also provide a set of equations ƒ(x)*ƒ(x)−1=1. Similar to dynamic permutation polynomials, conditions on the coefficient variables also provide a property to compose with integrity verification properties. Polynomials with special coefficient variables provide implementations of flexible code size.
Dynamic permutation transformations composed with MBA identities. This can be done either by transforming variables in the equations or transformation of the equations themselves.
C17.2 Permutation T-functions
In general any permutation T-functions from Boolean arithmetic algebraic system can also be used as dynamic permutation transformations. The computation of their inverses can be achieved through bit by bit computations. One example is the generalized permutation polynomials. The computations of their inverses are still efficient computer programs.
NOTE: Not all program components are necessary to obfuscate; Not transformation of data variables but integrity code; just composed with variables and operations.
C18 Block Data Protection
Block data variables, such a members in a data structure or fields in a class an be (1) transformed using dynamic permutation polynomials: coefficients can be individual data variables, (2) composed with individual static permutation transformations of each data variables.
Here is a very simple example about transformation of 2-dimensional vectors (X, Y)ε(B32)2. The code context, we assume, is
Λ32={(x⊕y), y2, z, (x&y)}.
The first step is to pick up two permutation polynomials 39*x+42, 67*+981 to transform X and Y:
X1=39*X+42,
and
Y1=67*Y+981.
The next step is to pick up a matrix whose determinant is a multiplicatively invertible polynomial (1335+2860*x+1657*x*(x−1))(6539+8268*x):
A column operation
on A gives us
A=A×C=Matrix[[1335+2860*x+1657*x*(x−1)+(67*(x⊕y)+8*y2)*(716+z+93*(x&y)), (67*(x⊕y)+8*y2)], [(6539+8268*x)*(716*z+93*(x&y)), (6539+8268*x)]].
Then a row operation
on A produces
A=R×A=Matrix[[1335+2860*x+1657*x*(x−1)+(67*(x⊕y)+8*y2)*(716*z+93*(x&y)), 67*(x⊕y)+8*y2], [34*(x&y)*(1335+2860*x+1657*x*(x−1)+(67*(x⊕y)+8*y2)*(716*z+93*(x&y)))+(6539+8268*x)*(716*z+93*(x&y)), 34*(x&y)*(67*(x⊕y)+8*y2)+6539+8268*x]].
Applying this invertible matrix A to transform (X1, Y1), we have the transformed vector (X2, Y2) with
X2=52065*X+56070+46917*x*X+50526*x+64623*x2*X+69594*x2+1870908*(x⊕y)*z*X+2014824*(x⊕y)*z+243009*(x⊕y)*(x&y)*X+261702*(x⊕y)*(x&y)+223392*y2*z*X+240576*y2*z+29016*y2*(x&y)*X+31248*y2*(x&y)+4489*(x⊕y)*Y+65727*(x⊕y)+536*y2*Y+7848*y2,
and
Y2=8110908*x+7595328*(x&y)*y2*z*X+63610872*(x&y)*(x⊕y)*z*X+2231718*(x⊕y)*(x&y)+266832*y2*(x&y)+182595036*z*X+553956*x*Y+1062432*y2*(x&y)2+248635296*x*z+25487163*(x&y)*X+34012692*(x&y)*x+2366196*(x&y)*x2+8897868*(x⊕y)*(x&y)2+8179584*(x&y)*y2*z+68504016*(x&y)*(x⊕y)*z+18224*y2*(x&y)*Y+152626*(x⊕y)*(x&y)*Y+230875632*x*z*X+986544*y2*(x&y)2*X+8262306*(x⊕y)*(x&y)2*X+2197182*(x&y)*x2*X+31583214*(x&y)*x*X=6414759+27447714*(x&y)+196640808*z+438113*Y.
Then we can replace x, y and z by any expressions of any variables, including X and Y, or constants in the code context to inject new dependencies into these transformed code. Further code optimization could become necessary depent on expressions chosen.
E Polynomial Representation of Carry Bit Values
Given a binary representation a=Σi=0∞ai2i and b=Σi=0∞bi2i of two numbers a and b as well as the sum c=a+b=Σi=0∞ci2i to represent the carry bits by bit values aj, bj, 0≦j≦t is an interesting problem. Recently the following formula was developed:
c0=a0⊕b0.
for t≧1,
ct=(at⊕bt)⊕(⊕i=0t−1(ai·bi·(Πj=i+1t−1(aj⊕bj)))).
Obviously, the second term above is a polynomial representation of a carry bit value. Similar formula for multiplication can be derived.
The present application is the United States national stage of International Application No. PCT/CA2013/000304, filed Mar. 28, 2013, and which claims benefit of U.S. Provisional Application Nos. 61/617,991 filed Mar. 30, 2012 and 61/618,010 filed Mar. 30, 2012, the entire contents of which are incorporated herein by reference.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CA2013/000304 | 3/28/2013 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2013/142980 | 10/3/2013 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6088452 | Johnson et al. | Jul 2000 | A |
6192475 | Wallace | Feb 2001 | B1 |
6594761 | Chow et al. | Jul 2003 | B1 |
6668325 | Collberg et al. | Dec 2003 | B1 |
6779114 | Chow et al. | Aug 2004 | B1 |
6842682 | Chow et al. | Jan 2005 | B2 |
6842862 | Chow et al. | Jan 2005 | B2 |
7350085 | Johnson et al. | Mar 2008 | B2 |
7366914 | Graunke | Apr 2008 | B2 |
7634091 | Zhou et al. | Dec 2009 | B2 |
20020025037 | Sano | Feb 2002 | A1 |
20030142819 | Bellocchio | Jul 2003 | A1 |
20030163718 | Johnson et al. | Aug 2003 | A1 |
20040139340 | Johnson et al. | Jul 2004 | A1 |
20040215962 | Douceur | Oct 2004 | A1 |
20040236955 | Chow et al. | Nov 2004 | A1 |
20050166191 | Kandanchatha et al. | Jul 2005 | A1 |
20050183072 | Horning et al. | Aug 2005 | A1 |
20060136867 | Schneider et al. | Jun 2006 | A1 |
20090287706 | Bourges-Waldegg | Nov 2009 | A1 |
20110296192 | Hayashi et al. | Dec 2011 | A1 |
Number | Date | Country |
---|---|---|
101088095 | Dec 2007 | CN |
101627394 | Jan 2010 | CN |
2009572 | Dec 2008 | EP |
02095546 | Nov 2002 | WO |
2008101341 | Aug 2008 | WO |
Entry |
---|
Extended European Search Report cited in corresponding European Application No. 13768730.7 dated Oct. 27, 2015. |
International Search Report and Written Opinion cited in corresponding International Application No. PCT/CA2013/000304 dated Jul. 22, 2013. |
Extended European Search Report cited in corresponding European Application No. 13768955.0 dated Oct. 9, 2015. |
Extended European Search Report cited in corresponding European Application No. 13767519.5 dated Oct. 22, 2015. |
Extended European Search Report cited in corresponding European Application No. 13767371.1 dated Feb. 5, 2016. |
“Advanced Encryption Standard (AES)”, Federal Information Processing Standard Publication 197, Nov. 26, 2001. |
Prof Michael Backes: “Lecture Notes for CS-578 Cryptography (SS2007)”, Nov. 25, 2011. |
Alfred V. Aho, Ravi Sethi, Jefery D. Illman, Compliers: Principles, Techniques, and Tools. 1986, Addison-Wesley ISBN 0-201-100088-6. |
K.E. Batcher, Sorting Networks and their Applications. Proc. AMPS Spring Joint Comput. Conf., vol. 32, pp. 307 314. 1968. |
“Batcher Odd-even mergesort”, accessed on Mar. 3, 2015, en.wikipedia.org/wiki/Batcher—odd-even—mergesort. |
“Odd-even mergesort” accessed on Mar. 3, 2015, www.iti.fh-flensburg.de/lang/algorithmen/sortieren/networks/oemen.htm. |
Keith Cooper, Timothy J. Harvey, and Ken Kennedy, A Simple, Fast Dominance Algorithm. Software Practice and Experience. 2001. No. 4, pp. 1-10. |
Extended Euclidean Algorithm, Algorithm 2.107 on p. 67 in A.J. Menezcs, P.C. van Oorschot, S.A. Vanstone, Handbook of Applied Cryptography, CRC Press. 2001 (5th printing with corrections). Down-loadable from http://www.cacr.math.uwaterloo.ca/hac/. |
National Institute of Standards and Technology (NIST) , Advanced Encryption Standard (AES). FIPS Publication 197, Nov. 26, 2001. http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf. |
Alexander Klimov, Applications of T-Functions in Cryptography, PhD thesis under Adi Shamir, Weizmann Institute of Science, Oct. 2004. Theorem 5.3 p. 41. |
Des, §7.4, pp. 250-259, in A.J. Menezes, P.C. van Oorschot, S.A. Vanstone, Handbook of Applied Cryptography. CRC Press, 2001 (5th printing with corrections). Downloadable from http://www.cacr.math.uwaterloo.ca/hac/. |
Ronald L. Rivest, Permutation Polynomials Modulo 2ω. Finite Fields and their Applications, vol. 7, 2001 , pp. 287-292. |
Ronald L. Rivest. Permutation Polynomials Modulo 2ω. Laboratory for Computer Science. MIT, Oct. 25, 1999. |
A.J. Menezes, P.C. van Oorschot, S.A. Vanstone, Handbook of Applied Cryptography, §1.3. pp. 6 Hi. CRC Press, 2001 (5th printing with corrections). Downloadable from http://www.cacr.math.uwaterloo.ca/hac/. |
Zhaopeng Dai et al, “The Single Cycle T-functions”, National Basic Research Program of China, 2000. |
Dexter Kozen, Susan Landau, Polynomial decomposition algorithms. J. Symb. Comp. 7(5)(1989), 445-456. |
Medhu Sudan. Algebra and computation. MIT lecture notes. On line: http://people.csail.mit.edu/madhu/FT98/course.html. |
James Xiao, Y. Zhou, Generating large non-singular matrices over an arbitrary field with block of full rank, 2002. |
Kejian Xu, Zhaopeng Dai and Zongduo Dai The formulas of coefficients of sum and product of p-adic integers with applications to Witt vectors. Acta Arithmetica. 150 (2011). 361-384. |
O. Billet. H. Gilbert, G. Ech-Chatbi, Cryptanalysis of a White Box AES Implementation, Proceedings of SAC 2004 Conference on Selected Areas in Cryptography, Aug. 2004, revised papers. Springer (LNCS 3357). |
Stanley Chow, Yuan X. Gu, Harold Johnson, and Vladimir A. Zakharov, An Approach to the Obfuscation of Control-Flow of Sequential Computer Programs, Proceedings of ISC 2001 Information Security, 4th International Conference (LNCS 2200), Springer, Oct. 2001 , pp. 144-155. |
S. Chow, P. Eisen, H. Johnson, P.C. van Oorschot. White-Box Cryptography and an AES Implementation Proceedings of SAC 2002 Conference on Selected Areas in Cryptography, Mar. 2002 (LNCS 2595), Springer, 2003. |
S. Chow, P. Eisen, H. Johnson, P.C. van Oorschot, A White-Box DES Implementation for DRM Applications, Proceedings of DRM 2002 2nd ACM Workshop on Digital Rights Management. Nov. 18, 2002 (LNCS 2696). Springer, 2003. |
G. Mullen and H. Stevens. Polynomial functions (mod m). Acta Mathematica Hungarica 44(3-4) , 1984. pp. 237 -241. |
T. Sander, C.F. Tschudin, Protecting Mobile Agents Against Malicious Hosts. pp. 44-60, Vigna, Mobile Agent Security (LNCS 1419), Springer. 1998. |
Y. Zhou. A. Main. Y. Gu and H. Johnson, Information Hiding in Software with Mixed Boolean-Arithmetic Transforms, Information Security Applications, 8th International Workshop. WISA 2007. LNCS 4867.2008. |
Ron Cytron, Jean Ferrante. Barry K. Rosen, and Mark N. Wegman, Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. ACM Transactions on Programming Languages and Systems 13(4), Oct. 1991. pp. 451-490. |
T. Sander, C.F. Tschudin. Towards Mobile Cryptography, pp. 215-224, Proceedings of the 1998 IEEE Symposium on Security and Privacy. |
G. H. Hardy and E. M. Wright, “An Introduction to the Theory of Numbers”, Oxford Press. |
A. Menexes, P. Oorschot. S. Vanstone, “Handbook of Applied cryptography” ,CRC Press. 1996. |
Henry S. Warren. Jr., “Hacker's Delight”, Addison-Wesley. Boston, 2002. |
D. E. Knuth. The art of computer programming, vol. 2: semi-numerical algorithms, 3rd edition, ISBN 0-201-89684-2, Addison-Wesley, Reading. Massachusetts, 1997. |
Communication pursuant to Article 94(3) EPC issued in EP Patent Application No. 13767519.5, dated Nov. 13, 2017, 5 pages. |
Number | Date | Country | |
---|---|---|---|
20150067875 A1 | Mar 2015 | US |
Number | Date | Country | |
---|---|---|---|
61617991 | Mar 2012 | US | |
61618010 | Mar 2012 | US |