The present application is related to software cryptography systems. More specifically, the present application is related to lightweight software cryptography systems for variable length messages suitable for embedded real time system.
With the increasing use of embedded real time systems and their need for constant and prevalent communications, the security and privacy of the electronic communications among those systems raise many concerns. Data interception and alteration are real threats to the safety of data which may cause all kinds of problems. Many times, physical protections are not viable choices for those systems. Software-based cryptography has long been recognized as an indispensable protection for achieving data security and privacy by many. The security and robustness of the cryptography as a means to protect data directly rather than relying on physical communication channels depends on the security and robustness of the underlying encryption and decryption algorithms.
The advantages and other features of the disclosure will become more apparent to and the invention will be better understood by persons of ordinary skill of the art, with reference to the following description of the examples of the disclosure taken in conjunction with the accompanying drawings, wherein:
Several embodiments of the present application are illustrated by the accompanying drawings and described in detail below. In the figures of the accompanying drawings, elements having the same reference numeral designations represent like elements throughout. The drawings are not to scale, unless otherwise noted. The embodiments are described by way of example, and not by limitation. All terminologies and phraseology used herein are for the purpose of illustrating only and should not be understood as limiting. The phrases such as “including”, “comprising”, “having” and other variations thereof are meant to encompass the items as described and their equivalents without excluding any additional items thereof. The phrases such as “algorithm” and “process” may be used interchangeably in the description.
Many symmetric key cryptography systems have been developed in the prior art. One such system is the block cipher system. A block cipher system uses algorithm which acts on a fixed-length group of bits, which is referred to as a block. The size of the block may vary among systems, such as 128-bit, 192-bit, and so on. The block cipher system uses a so-called substitution technique, in which entire blocks are enciphered using predetermined cipher keys. With such techniques, the enciphered messages become unintelligible ciphertext and can only be understood with a corresponding cipher key. An advantage of the substitution technique is that deciphering process may be easily implemented by a reverse application of the cipher key. In other words, the block cipher uses symmetric cipher key. Further, the block cipher algorithms may run several rounds on the same block to make the enciphered or encrypted message hard to guess.
The Feistel Cipher is a well-known design model which provides a design paradigm for many other block cipher algorithms.
As such, the plain block 102 will go through n rounds of the encryption process described above. In each round, a round key K 120 is provided as an input for the function ƒ(K,R) of that round, wherein each key K 120 of the n rounds may be same or different. After n rounds of calculation, the Feistel Cipher algorithm will output the encrypted block 104, which can then be publicly shared or transmitted in unsecured channels. The decryption algorithms use the same set of round keys K to decipher and unwind the blocks in a reverse manner until the original block 102 is recovered.
Despite a past ground-breaking and elegant design, the prior art Feistel Cipher has many disadvantages for lightweight systems, such as real time systems that communicate using variable length messages. For example, the fixed block size of the Feistel Cipher may be cumbersome for such systems. Given a fixed block size, for messages that are longer than it, the algorithm has to run multiple times for both encryption and decryption processes. On the other hand, the block size of the Feistel Cipher is usually in the order of over a hundred of bits, which requires memory allocation and computational power that many lightweight embedded systems find expensive and unnecessary. Also, when the plain message is shorter than the fixed block size, the Feistel Cipher still needs to run on the longer fixed block size, which wastes the resource of the system. As such, for real time system where the block size of the messages varies but may be anticipated to be within a certain range, variable-size cipher would be a better option. Such ciphers conserve system resources, take less CPU time and use less memory.
The present application discloses a lightweight cryptography system that improves over the prior art Feistel Cipher. As in the Feistel Cipher, the cryptography system of the present application is also a symmetric key system. Further, the principle of the substitution technique used in the Feistel Cipher is also embodied the present application. However, the lightweight encryption system of the present application allows for much more efficient encryption and decryption of variable length messages. The plain message may be encrypted and decrypted in blocks as small as 8-bit and all arithmetic operations of the system may be based on eight (8) bits.
The small block size and the arithmetic operation of the present application make the encryption system suitable for a wide range of embedded system devices with different computational capability and memory size. Using 8-bit operations as basic building blocks, the encryption and decryption algorithms may be further optimized in most embedded microprocessors by using their assembly instructions, because the assembly instructions are also based on 8-bit instructions. Such optimizations further save the computational cost of the encryption system and are highly desirable for many embedded systems. In addition, as will be made clear in the present application, the code size of the encryption and decryption algorithm may be set very small, which further saves the system's resources. In the meanwhile, the security and the robustness of the encryption system are guaranteed by similar design philosophy of the Feistel Cipher which supports highly secured cryptography systems and has stood the test of time.
According to an example of the present application, the lightweight cryptography algorithm runs multiple rounds. In each round, the blocks of the message are divided into two parts, namely the Reference Part and the Target Part. The Reference Part is used by the cryptography algorithm to determine the way the Target Part may be or have been encrypted and decrypted. Those single-round encryption and decryption algorithms are repeated multiple times. Between the rounds, the cryptography algorithm will use a block shifting technique to rotate the blocks between the Reference Part and the Target Part, thereby guaranteeing all blocks of the message are encrypted or decrypted after the as a result of the cryptography algorithms.
According to an example of the present application, the Reference Part comprises the first block of the message and the Target Part comprises the remaining blocks. More specifically, the plain original message m comprising n blocks may be denoted with each as m=X[0], X[1], . . . , X[n−1]. As such, the Reference Part may comprise the first, or the leftmost, block of the message m, i.e., X[0] and the Target Part may comprise the remainder of the blocks of the message X[1], . . . , X[n−1]. According to the example, each block of the message m may be 8 bits, although other number of bits, such as 16 bits and 32 bits, etc. may also be supported.
In order to clearly describe the methods of the cryptography system of the present application, single-round encryption and decryption algorithms are described first.
According to an example of the present application, the lightweight cryptography system uses the Reference Part as a basis to decide the operation on the Target Part in the encryption process. In the example illustrated in
Persons skilled in the art understand that self-rotation is a bit-wise operation on a block of data. Usually, computer systems use 8-bit as a basic memory block unit, although operations using another block size are also available. Because 8-bit block size is commonly used in lightweight systems, the examples illustrated in the present application are all based on 8-bit block size.
The idea of self-rotating of a block of data is to shift all bits of information in a single block to one direction and patch the overflowed bits back to the tail of the block sequentially. It can shift to the right (“Shift to the Right Rotation”, or “SRR”) or to the left (“Shift to the Left Rotation”, or “SRL”). For example, for an 8-bit block consisting of 10001010, after one SRR, or SRR(1), it becomes 01000101. Thereafter, if one SRL or SRL(1) is applied to the same block, it will be shifted back to the original value of 10001010. It is plain to see that a block that is self-rotated l times, i.e., SRR(l), can be recovered by applying SRL(l) and vice versa, wherein l is the total number of rotations performed. In the examples of the present application, the encryption algorithms always rotate to the right and the decryption algorithms always rotate to the left. Persons skilled in the art understand that that is an arbitrary choice and the opposite directions for the encryption and decryption can be readily adapted. Therefore, such rotation design is within the scope of the present application.
Referring back to the example in
According to an example of the present application, the arithmetic function may be an Exclusive OR, i.e., XOR, function. Persons skilled in the art understand that the XOR function is a logical function operating on logical operands of TRUE and FALSE. When implemented in computers where binary operations are the basis of computing, the computer implemented XOR function commonly take the binary 1 as TRUE and the binary 0 as FALSE and compute a result that corresponds to a logical XOR function of the same inputs. The computer implemented XOR function will return either 1 or 0, also representing TRUE or FALSE, as a result.
In the present example, the blocks are denoted as Xr.ƒ after an XOR function is applied in 230. Referring to 230 of
Persons skilled in the art understand that the XOR function is a self-inverse function which satisfy the equation x=ƒ(ƒ(x)). When there is more than one input variable, the self-inverse functions satisfy the equation x=ƒ(ƒ(x,y),y). In the context of cryptography, the self-inverse functions are very useful in symmetric key cryptography system. More specifically, in the symmetric cryptography system, there is a key which is both the encryption key and the decryption key of the cryptography system. To illustrate this important characteristic of the XOR function, we denote x as the input message, and y as the key. We further denote z=XOR(x,y), which corresponds to a message encrypted by the XOR function. After receiving the encrypted message z, the decryption algorithm may simply apply another XOR operation on the encrypted message z and key y to recover the original message x. This is tr because according to the self-inversion characteristic of the XOR function, XOR (z,y)=XOR(XOR(x,y), y)=x.
As illustrated in the single-round encryption process of
Thereafter, the decryption process 300 counts the number of 1's in Xr[0] to determine how many times the original message was self-rotated in the encryption process. As illustrated in
In the n-round algorithms, in order to identify the particular round of, the round number is added in superscripts to each block for clarity. It is also noted that the n rounds of the algorithms range from round 0 to round n−1. Now referring to
In the n-round encryption process 400, however, after the single-round encryption is completed, the blocks of the entire message will be shifting to a direction similar to the self-rotation of a single block. That is, each of the n blocks will be shifted to one direction. The block at one end of the n blocks to which direction the blocks are shifted will be added at the other end of the blocks and occupies the block that has been “emptied” because all blocks have been shifted up. After the shifting, the new order of the blocks is renumbered from 0 to n−1 based on their shifted positions. Thereafter, another single-round encryption as illustrated in
In the encryption process 400 of
Steps 408-412 illustrates the second round of the encryption, which includes the exact same steps of a single-round encryption shown in 402-406. Thereafter, another block shifting process as illustrated in 408 will be performed and the encryption will continue to the third round of the encryption thereafter and so on. The single-round encryption and block shifting will be performed in turn until the nth round is r completed as shown in 414-418 of
As illustrated in 418 of
In 508, the decryption process will perform a block shift to the opposite direction of the encryption process. In the example illustrates in
As mentioned above, the present application discloses a symmetric key cryptography design. That is, the encryption process and the decryption process use the same key. Persons skilled in the art understand that the security of the key y is critical to the security of the system. Securely ascertaining the symmetric key y by the encryption algorithm and the decryption algorithm is a critical issue of the lightweight cryptography system of the present application. According to an example illustrated in
Referring to
Then using the random number 610, both the encryption process and the decryption process use a same KEY POOL 602 to generate the key y.
Referring to
To generate location coordinates for positioning of the device 890, the device 890 may include a global positioning system (GPS) receiver. Alternatively, or additionally the device 890 can utilize either or both the short range XCVRs 820 and WWAN XCVRs 810 for generating location coordinates for positioning. For example, cellular network, WiFi, or Bluetooth™ based positioning systems can generate very accurate location coordinates, particularly when used in combination. Such location coordinates can be transmitted to the eyewear device over one or more network connections via XCVRs 810, 820.
The transceivers 810, 820 (network communication interface) conforms to one or more of the various digital wireless communication standards utilized by modern mobile networks. Examples of WWAN transceivers 810 include (but are not limited to) transceivers configured to operate in accordance with Code Division Multiple Access (CDMA) and 3rd Generation Partnership Project (3GPP) network technologies including, for example and without limitation, 3GPP type 2 (or 3GPP2) and LTE, at times referred to as “4G.” For example, the transceivers 810, 820 provide two-way wireless communication of information including digitized audio signals, still image and video signals, web page information for display as well as web related inputs, and various types of mobile message communications to/from the device 890.
The device 890 further includes a microprocessor, shown as CPU 830, sometimes referred to herein as the host controller. A processor is a circuit having elements structured and arranged to perform one or more processing functions, typically various data processing functions. Although discrete logic components could be used, the examples utilize components forming a programmable CPU. A microprocessor for example includes one or more integrated circuit (IC) chips incorporating the electronic elements to perform the functions of the CPU. The processor 830, for example, may be based on any known or available microprocessor architecture, such as a Reduced Instruction Set Computing (RISC) using an ARM architecture, as commonly used today in devices and other portable electronic devices. Of course, other processor circuitry may be used to form the CPU 830 or processor hardware in smartphone, laptop computer, and tablet.
The microprocessor 830 serves as a programmable host controller for the device 890 by configuring the device 890 to perform various operations, for example, in accordance with instructions or programming executable by processor 830. For example, such operations may include various general operations of the device. Although a processor may be configured by use of hardwired logic, typical processors in devices are general processing circuits configured by execution of programming.
The device 890 includes a memory or storage device system, for storing data and programming In the example, the memory system may include a flash memory 840A and a random access memory (RAM) 840B. The RAM 840B serves as short term storage for instructions and data being handled by the processor 830, e.g., as a working data processing memory. The flash memory 840A typically provides longer term storage.
Hence, in the example of device 890, the flash memory 840A is used to store programming or instructions for execution by the processor 830. Depending on the type of device, the device 890 stores and runs a mobile operating system through which specific applications. Applications may be a native application, a hybrid application, or a web application (e.g., a dynamic web page executed by a web browser) that runs on device 890. Examples of mobile operating systems include Google Android, Apple iOS (I-Phone or iPad devices), Windows Mobile, Amazon Fire OS, RIM BlackBerry operating system, or the like.
The machine 900 may comprise, but not be limited to, a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a PDA, an entertainment media system, a cellular telephone, a smart phone, a device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web appliance, a network router, a network switch, a network bridge, or any machine capable of executing the instructions 908, sequentially or otherwise, that specify actions to be taken by the machine 900. Further, while only a single machine 900 is illustrated, the term “machine” shall also be taken to include a collection of machines that individually or jointly execute the instructions 908 to perform any one or more of the methodologies discussed herein.
The machine 900 may include processors 902, memory 904, and I/O components 942, which may be configured to communicate with each other via a bus 944. In an example, the processors 902 (e.g., a Central Processing Unit (CPU), a Reduced Instruction Set Computing (RISC) processor, a Complex Instruction Set Computing (CISC) processor, a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), an ASIC, a Radio-Frequency Integrated Circuit (RFIC), another processor, or any suitable combination thereof) may include, for example, a processor 906 and a processor 910 that execute the instructions 908. The term “processor” is intended to include multi-core processors that may comprise two or more independent processors (sometimes referred to as “cores”) that may execute instructions contemporaneously. Although
The memory 904 includes a main memory 912, a static memory 914, and a storage unit 916, both accessible to the processors 902 via the bus 944. The main memory 904, the static memory 914, and storage unit 916 store the instructions 908 embodying any one or more of the methodologies or functions described herein. The instructions 908 may also reside, completely or partially, within the main memory 912, within the static memory 914, within machine-readable medium 918 (e.g., a non-transitory machine-readable storage medium) within the storage unit 916, within at least one of the processors 902 (e.g., within the processor's cache memory), or any suitable combination thereof, during execution thereof by the machine 900.
Furthermore, the machine-readable medium 918 is non-transitory (in other words, not having any transitory signals) in that it does not embody a propagating signal. However, labeling the machine-readable medium 918 “non-transitory” should not be construed to mean that the medium is incapable of movement; the medium should be considered as being transportable from one physical location to another. Additionally, since the machine-readable medium 918 is tangible, the medium may be a machine-readable device.
The I/O components 942 may include a wide variety of components to receive input, provide output, produce output, transmit information, exchange information, capture measurements, and so on. The specific I/O components 942 that are included in a particular machine will depend on the type of machine. For example, portable machines such as mobile phones may include a touch input device or other such input mechanisms, while a headless server machine will likely not include such a touch input device. It will be appreciated that the I/O components 942 may include many other components that are not shown in
In further examples, the I/O components 942 may include biometric components 932, motion components 934, environmental components 936, or position components 938, among a wide array of other components. For example, the biometric components 932 include components to detect expressions (e.g., hand expressions, facial expressions, vocal expressions, body gestures, or eye tracking), measure biosignals (e.g., blood pressure, heart rate, body temperature, perspiration, or brain waves), identify a person (e.g., voice identification, retinal identification, facial identification, fingerprint identification, or electroencephalogram-based identification), and the like. The motion components 934 include acceleration sensor components (e.g., accelerometer), gravitation sensor components, rotation sensor components (e.g., gyroscope), and so forth. The environmental components 936 include, for example, illumination sensor components (e.g., photometer), temperature sensor components (e.g., one or more thermometers that detect ambient temperature), humidity sensor components, pressure sensor components (e.g., barometer), acoustic sensor components (e.g., one or more microphones that detect background noise), proximity sensor components (e.g., infrared sensors that detect nearby objects), gas sensors (e.g., gas detection sensors to detection concentrations of hazardous gases for safety or to measure pollutants in the atmosphere), or other components that may provide indications, measurements, or signals corresponding to a surrounding physical environment. The position components 938 include location sensor components (e.g., a GPS receiver component), altitude sensor components (e.g., altimeters or barometers that detect air pressure from which altitude may be derived), orientation sensor components (e.g., magnetometers), and the like.
Communication may be implemented using a wide variety of technologies. The I/O components 942 further include communication components 940 operable to couple the machine 900 to a network 920 or devices 922 via a coupling 924 and a coupling 926, respectively. For example, the communication components 940 may include a network interface component or another suitable device to interface with the network 920. In further examples, the communication components 940 may include wired communication components, wireless communication components, cellular communication components, Near Field Communication (NFC) components, Bluetooth® components (e.g., Bluetooth® Low Energy), Wi-Fi® components, and other communication components to provide communication via other modalities. The devices 922 may be another machine or any of a wide variety of peripheral devices (e.g., a peripheral device coupled via a USB).
Moreover, the communication components 940 may detect identifiers or include components operable to detect identifiers. For example, the communication components 940 may include Radio Frequency Identification (RFID) tag reader components, NFC smart tag detection components, optical reader components (e.g., an optical sensor to detect one-dimensional bar codes such as Universal Product Code (UPC) bar code, multi-dimensional bar codes such as Quick Response (QR) code, Aztec code, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2D bar code, and other optical codes), or acoustic detection components (e.g., microphones to identify tagged audio signals). In addition, a variety of information may be derived via the communication components 940, such as location via Internet Protocol (IP) geolocation, location via Wi-Fi® signal triangulation, location via detecting an NFC beacon signal that may indicate a particular location, and so forth.
The various memories (e.g., memory 904, main memory 912, static memory 914, memory of the processors 902), storage unit 916 may store one or more sets of instructions and data structures (e.g., software) embodying or used by any one or more of the methodologies or functions described herein. These instructions (e.g., the instructions 908), when executed by processors 902, cause various operations to implement the disclosed examples.
The instructions 908 may be transmitted or received over the network 920, using a transmission medium, via a network interface device (e.g., a network interface component included in the communication components 940) and using any one of a number of well-known transfer protocols (e.g., hypertext transfer protocol (HTTP)). Similarly, the instructions 908 may be transmitted or received using a transmission medium via the coupling 926 (e.g., a peer-to-peer coupling) to the devices 922.
The operating system 1012 manages hardware resources and provides common services. The operating system 1012 includes, for example, a kernel 1014, services 1016, and drivers 1022. The kernel 1014 acts as an abstraction layer between the hardware and the other software layers. For example, the kernel 1014 provides memory management, processor management (e.g., scheduling), component management, networking, and security settings, among other functionality. The services 1016 can provide other common services for the other software layers. The drivers 1022 are responsible for controlling or interfacing with the underlying hardware. For instance, the drivers 1022 can include display drivers, camera drivers, BLUETOOTH® or BLUETOOTH® Low Energy drivers, flash memory drivers, serial communication drivers (e.g., Universal Serial Bus (USB) drivers), WI-FI® drivers, audio drivers, power management drivers, and so forth.
The libraries 1010 provide a low-level common infrastructure used by the applications 1006. The libraries 1010 can include system libraries 1018 (e.g., C standard library) that provide functions such as memory allocation functions, string manipulation functions, mathematic functions, and the like. In addition, the libraries 1010 can include API libraries 1024 such as media libraries (e.g., libraries to support presentation and manipulation of various media formats such as Moving Picture Experts Group-4 (MPEG4), Advanced Video Coding (H.264 or AVC), Moving Picture Experts Group Layer-3 (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate (AMR) audio codec, Joint Photographic Experts Group (JPEG or JPG), or Portable Network Graphics (PNG)), graphics libraries (e.g., an OpenGL framework used to render in two dimensions (2D) and three dimensions (3D) in a graphic content on a display), database libraries (e.g., SQLite to provide various relational database functions), web libraries (e.g., WebKit to provide web browsing functionality), and the like. The libraries 1010 can also include a wide variety of other libraries 1028 to provide many other APIs to the applications 1006.
The frameworks 1008 provide a high-level common infrastructure that is used by the applications 1006. For example, the frameworks 1008 provide various graphical user interface (GUI) functions, high-level resource management, and high-level location services. The frameworks 1008 can provide a broad spectrum of other APIs that can be used by the applications 1006, some of which may be specific to a particular operating system or platform.
In an example, the applications 1006 may include a home application 1036, a contacts application 1030, a browser application 1032, a book reader application 1034, a location application 1042, a media application 1044, a messaging application 1046, a game application 1048, and a broad assortment of other applications such as a third-party application 1040. The applications 1006 are programs that execute functions defined in the programs. Various programming languages can be employed to create one or more of the applications 1006, structured in a variety of manners, such as object-oriented programming languages (e.g., Objective-C, Java, or C++) or procedural programming languages (e.g., C or assembly language). In a specific example, the third-party application 1040 (e.g., an application developed using the ANDROID™ or IOS™ software development kit (SDK) by an entity other than the vendor of the particular platform) may be mobile software running on a mobile operating system such as IOS™, ANDROID™, WINDOWS® Phone, or another mobile operating system. In this example, the third-party application 1040 can invoke the API calls 1050 provided by the operating system 1012 to facilitate functionality described herein.
It will be understood that the terms and expressions used herein have the ordinary meaning as is accorded to such terms and expressions with respect to their corresponding respective areas of inquiry and study except where specific meanings have otherwise been set forth herein. Relational terms such as first and second and the like may be used solely to distinguish one entity or action from another without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms “comprises,” “comprising,” “includes,” “including,” or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises or includes a list of elements or steps does not include only those elements or steps but may include other elements or steps not expressly listed or inherent to such process, method, article, or apparatus. An element preceded by “a” or “an” does not, without further constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
Unless otherwise stated, any and all measurements, values, ratings, positions, magnitudes, sizes, and other specifications that are set forth in this specification, including in the claims that follow, are approximate, not exact. Such amounts are intended to have a reasonable range that is consistent with the functions to which they relate and with what is customary in the art to which they pertain. For example, unless expressly stated otherwise, a parameter value or the like, whether or not qualified by a term of degree (e.g., approximate, substantially or about), may vary by as much as ±10% from the recited amount.
The examples illustrated herein are described in sufficient detail to enable those skilled in the art to practice the teachings disclosed. Other examples may be used and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. The Detailed Description, therefore, is not to be taken in a limiting sense, and the scope of various examples is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.