Encoding and decoding method and apparatus

Abstract: The present invention relates to a method for encoding information into a code which cannot be deciphered by an eavesdropper and a method of decoding the code to recover the original information. The encoding and decoding methods according to the invention improve the transmission of information and the efficiency of storage.

Description: The present invention relates to a method for encoding information into a code which cannot be deciphered by an eavesdropper, an encoding apparatus, a method of decoding the code to recover the original information, and a decoding apparatus. Typical of encoding and decoding methods heretofore proposed is an RSA method which is disclosed by R.L. Rivest, A. Shamir and L. Adleman in a paper entitled "A Method for Obtaining Digital Signatures and Public-key Crypto-systems", Comm. ACM, Vcl. 21, No. 2, pp. 120-126, 1978. For the convenience of description, the following description will concentrate only on a case wherein information is encoded into a cryptogram for the purpose of preventing an unauthorized person from eavesdropping the information. The encoding and decoding methods will be limited to the RSA method by way of example. Let the manipulation for converting information into a cryptogram and the manipulation for decoding a cryptogram into original information be called encoding and decoding, respectively. The encoding and decoding procedures according to the RSA method use an encoding key e and a decoding key d each being represented by a numerical value, and a common key n shared by both of encoding and decoding also being represented by a numerical value. These numerical values e , d , and n are predetermined integers. How to select the numerical values e , d , and n is not directly relevant to the present invention and therefore will not be described herein. The coding procedure particular to the RSA method begins with a step of obtaining a numerical representation P of information. Since information is usually rendered in the form of a bit sequence of (logical) ZEROs and (logical) ONEs, it will be automatically represented by a numerical value if the bit sequence is divided into blocks each having a finite length. In the following description, therefore, information and a numerical representation of information will not be distinguished from each other so long as there is no fear of confusion. A cryptogram C is obtained by applying to the information an arithmetic operation: C = P e mod n Specifically, the information is raised to power e and then divided by n , the residual being the cryptogram C. To recover the original information P from the cryptogram C, the following arithmetic operation is performed: P = C d mod n This equation means that the cryptogram C is raised to power d and then divided by n , the residue being the information P. The RSA method, as discussed in the previously mentioned paper, is elaborated not only to prevent an unauthorized person from eavesdropping information but also to eliminate occurrences that a person who transmitted information later denies the transmission for fraud and that an unauthorized person transmits information pretending to be an authorized person. A problem with the prior art encoding and decoding methods discussed above is that the information P has to be smaller than the common key n . Otherwise the information rendered by a numerical representation P and the information rendered by a numerical representation P+n would become indistinguishable because a residual produced by the division by the common key n is computed during the course of encoding operation. Further, to conform to the binary notation adopted fcr communications and computers, input information is usually divided such that the information P to be encoded is one bit shorter than the common key n . Moreover, since information applicable to communications and computers is managed by being fractioned to a length of 2's power such as 1024 bits, even the increase in the bit length by one amounts to an increase by 1024 in total. Thus, the prior art encoding method critically degrades the transmission of information and the efficiency of storage. US-A-4 405 829 relates to a cryptographic communications system and method. The system includes at least one encoding device, at least one decoding device, and a communication channel, wherein the encoding and decoding devices are coupled to the channel. The encoding device is responsive to an applied message-to-be-transmitted and an encoding key to provide a ciphertext word for transmission to a particular decoding device. The encoding key is a pair of positive integers which are related to the particular decoding device. The message is a number representative of a message-to-be-transmitted. It is an object of the present invention to provide an encoding method and a decoding method, as well as an encoding apparatus and a decoding apparatus, which eliminate the above-described shortcomings. This object is achieved by the encoding method, decoding method, encoding apparatus and decoding apparatus according to the claims. In accordance with the present invention, an encoding method for use in a secure data transmission system for producing a code associated with inputted information comprises the steps of (a) if a numerical representation of the inputted information is smaller than a predetermined numerical value, applying a predetermined operation to the information and producing as an interim result a residual remaining after a result of the operation is divided by the numerical value, (b) if the numerical representation of the inputted information is not smaller than the numerical value, applying a predetermined conversion to the information and producing a result cf the conversion as an interim result, (c) applying a predetermined code conversion to the interium result and producing a result of the code conversion as a new interim result, (d) if the new interim result is smaller than the numerical value, applying the predetermined operation to the new interim result and producing as the code a residual remaining after a result of the predetermined operation is divided by the numerical value and (e) if the new interim result is not smaller than the predetermined numerical value, applying a predetermined conversion to the new interim result and prcducing a result of the conversion as the code. Further in accordance with the present invention, a decoding method for use in a secure data communication system for decoding an inputted code to produce information associated with the code comprises the steps of (a) if a numerical representation of the code is smaller than a predetermined numerical value, applying a predetermined operation to the code, and producing as an interim result a residual remaining after a result of the operation is divided by the numerical value, (b) if the numerical representation of the code is not smaller than the predetermined numerical value, applying a predetermined inverse-conversion to the code and outputting a result of the inverse-conversion as an interim result, (c) applying a predetermined code inverse-conversion to the interim result and outputting a result of the code inverse-conversion as a new interim result, (d) if the new interim result is smaller than the numerical value, applying a predetermined operation to the interim result and outputting as the information a residual remaining after a result of the operation is divided by the numerical value and (e) if the new interim result is not smaller than the numerical value, applying a predetermined inverse-conversion to the interim result and outputting a result of the inverse-conversion as the information. Other features and advantages of the invention will become apparent from the following description when taken in conjunction with the accompanying drawings in which: Fig. 1 is a schematic block diagram of a device for practicing an encoding method embodying the present invention; Fig.2 is a schematic block diagram of a device for practicing a decoding method embodying the present invention; Fig. 3 is a schematic block diagram showing a specific construction of a code converter included in the encoding device of Fig. 1; Fig. 4 is a schematic block diagram showing a specific construction of a code inverse-converter included in the decoding device of Fig. 2; Fig. 5 is a schematic block diagram showing another specific construction of the code converter included in the encoding device of Fig. 1; Fig. 6 is a schematic block diagram showing still another specific construction of the code converter of Fig. 1; Fig. 7 is a schematic block diagram representative of an alternative embodiment of the coding method in accordance with the present invention; and Fig. 8 is a schematic block diagram showing an alternative embodiment of the decoding method in accordance with the present invention. The principle of the present invention will be described before entering into detailed description of the preferred embodiments. In order to confine the bit length of a cryptogram within the bit length of information P, it is necessary that all the information and cryptograms shorter than a common key n with respect to bit length be associated one-to-one with each other. Otherwise, different information would be encoded into the same cryptogram and, hence, the original information would not be correctly recovered. With the prior art RSA method, it is possible to hold information and cryptograms which are shorter than the common key n with respect to bit length in one-to-one correspondence, only if keys e , d and n are skillfully selected. This is described in detail in the previously mentioned paper. It follows that the bit length of a cryptogram C can be prevented from becoming longer than that of information P by associating those information and cryptograms whose values are greater than the common key n one-to-one by a predetermined conversion. Information P may be encoded by the conventional method if it is smaller than the common key n , while it may be encoded by the conversion if it is greater than the common key n . This kind of encoding procedure will hereinafter be referred to as a bit-length preservation encoding method for convenience. A cryptogram C produced by the bit-length preservation encoding method may be decoded to obtain original information P by using the prior art method if it is smaller than the common key n , while such a cryptogram C may be decoded by applying an inverse conversion thereto if it is greater than the common key n . Such a decoding procedure will be referred to as a bit-length preservation decoding method merely for convenience. A problem with the bit-length preservation encoding method is that, although the bit length does not increase, the information will be outputted after a simple conversion if the numerical representation P of the information is greater than the common key n . In the light of this, for those applications which need privacy, the following procedure is adopted. Specifically, inputs and outputs are held in one-to-one correspondence, and use is made of a code conversion which is such that in response to an inputted numerical value greater than the common key n a numerical Value which is smaller than the common key n is outputted. Such a code conversion is applied to a cryptogram produced by the bit-length preservation encoding method, and then the bit-length preservation encoding method is effected again with the code-converted cryptogram. This allows all the information to be encoded. To recover the original information from the information which has been encoded by the above method, the bit-length preservation decoding method is practiced with the cryptogram. Then, an inverse conversion opposite to the above code conversion is applied to the resulting data, followed by the bit-length preservation decoding again. While the present invention has been discussed above in relation to the RSA method only, it will be apparent that it is similarly applicable to any other encoding and decoding procedures of the kind performing a predetermined arithmetic operation with input data, dividing the result of arithmetic operation by a given numerical value, and outputting the residual. This is because the present invention adopts, among various properties of the RSA method, only the property that information and cryptograms which are smaller than the common key n are associated one-to-one with each other, and because this property is also true with the previously discussed general encoding and decoding methods. The above description has concentrated on preventing an unauthorized person from eavesdropping information. The present invention is also successful in eliminating occurrences that one who transmitted information later denies the transmission for fraud and that an unauthorized person transmits false information pretending to be an authorized person. It will be clear from the previously mentioned paper that combining the encoding and decoding procedures particular to the present invention implements the above alternative purposes. Referring to Fig. 1 of the drawings, a device for practicing an encoding method embodying the present invention is shown. In the figure, the encoding device is generally made up of an input terminal 101, comparators 102 and 107, encoders 103 and 108, converters 104 and 109, selectors 105 and 110, a code converter 106, and an output terminal 111. Information coming in through the input terminal 101 is fed to the comparator 102, encoder 103, and converter 104. The comparator 102 compares the input information, or numerical value, with a common key n and produces a (logical) ONE if the input value is smaller than the common key n and a (logical) ZERO if otherwise. The encoder 103 encodes the input by using the RSA method or similar conventional encoding method and produces the result. The converter 104 converts the input information, i.e., the numerical value on a predetermined one-to-one basis. The selector 105 selects the output of the encoder 103 if the output of the comparator 102 is a ONE and selects the output of the converter 104 if it is a ZERO. Receiving the output of the selector 105, the code converter 106 applies a predetermined code conversion thereto and delivers the result to the comparator 107, encoder 108, and converter 109. While the relationship between the comparator 107, encoder 108, converter 109 and selector 110 is the same as the relationship between the comparator 102, encoder 103, converter 104 and selector 105, it is not necessary that the former share the same common key, encoding key and conversion with the latter. The output of the selector 110 is fed out via the output terminal 111 in the form of a cryptogram. Referring to Fig. 2, a device for practicing a decoding method also embodying the present invention is shown which is constructed to recover the original information from the cryptogram outputted by the encoding device of Fig. 1. As shown, the decoding device has an input terminal 201, comparators 202 and 207, decoders 203 and 208, selectors 205 and 210, a code inverse-converter 206, and an output terminal 211. The cryptogram applied to the input terminal 201 is fed to the comparator 202, decoder 203 and inverse-converter 204. The comparator 202 compares the cryptogram, or numerical value, with the common key n and produces a ONE if the former is smaller than the latter while producing a ZERO if otherwise. The decoder 203 performs the conventional decoding operation corresponding to the encoder 108 with the input. The inverse-converter 204 applies a conversion opposite to the conversion performed by the converter 109 of Fig. 1 to the input numerical value. The selector 205 selects the output of the decoder 203 if the output of the comparator 202 is a ONE and selects the output of the inverse-converter 204 if it is a ZERO. Receiving the output of the selector 205, the code inverse-converter 206 applies a code conversion opposite to the code conversion performed by the code converter 106 of Fig. 1 thereto. The output of the code inverse-converter 206 is fed to the comparator 207, decoder 208, and inverse-converter 209. The comparator 207, decoder 208, inverse-converter 209 and selector 210 are related to each other in the same manner as the comparator 202, decoder 203, inverse-converter 204, and selector 205. However, a prerequisite is that the common key, decoding key and inverse conversion assigned to the comparator 207, decoder 208, and inverse-converter 209 be in a particular relationship with those of the comparator 102, encoder 103, and, the converter 104: the same common key is shared by the comparators 102 and 207, encoder 103, and decoder 208, the decoding key of the decoder 208 corresponds to the encoding key of the encoder 103, and the inverse conversion performed by the inverse-converter 209 is opposite to the conversion performed by the converter 104. The output of the selector 210 is fed out via the output terminal 211 in the form of recovered information. The comparators 102, 107, 202 and 207 and the selectors 105, 110, 205 and 210 are implemented by a connection of a plurality of standard logic integrated circuits. The encoders 103 and 108 and the decoders 203 and 208 may each be implemented by a commercially available signal processor such as µPD77230 developed by NEC for signal processing purposes. This signal processor is described in a paper entitled "Exponential Computation Using Signal Processor", 1987 National Conference of the Institute of Electronic Data Communication Engineers of Japan, Treatises, No. 15, and a paper entitled "Implementation of RSA Cryptosystem by Signal Processor", 1988 National Conference of the Institute of Electronic Data Communication Engineers of Japan, Treatises, No. A-298. Although the converters 104 and 109 may each be constituted by a ROM (Read Only Memory), there is a fear that an eavesdropper finds the conversion procedure by reading data out of the ROM. That is, performing complicated conversions with the converters 104 and 109 is not so effective. For this reason and considering the intricacy of construction of the device, it is rather effective that each of the converters 104 and 109 produces its output without any conversion. In such a case, the inverse-converters 204 and 209 will also produce their outputs without applying any inverse conversion thereto. While the code converter 106 may also be implemented by a ROM, performing no complicated processing is rather effective for the same reason as discussed above in relation to the converters 104 and 109. A simple code conversion is available for converting a numerical value which is not smaller than the common key n to a number which is smaller than the common key n and setting up one-to-one correspondence between inputs and outputs, as follows. Fig. 3 shows a specific construction of the code converter 106 included in the encoding device of Fig. 1. In the figure, a plurality of NOT circuits 306 are provided for inverting all the bits of the common key n which is applied to a terminal 301. An adder 303 adds the outputs of the NOT circuits 306 to a code which is fed thereto via an input terminal 302, the sum being fed out via an output terminal 305. The adder 303 has a carry input to which a ONE is fed via a terminal 304. In this construction, the common key n is subtracted from the input code and the result is outputted. Fig. 4 shows a specific construction of the code inverse converter 206 included in the decoding device of Fig. 2. An adder 403 adds the common key n applied to a terminal 401 and a code applied to an input terminal 402, the sum being fed out via an output terminal 405. The adder 403 has a carry input to which a ZERO is applied via a terminal 404. Fig. 5 shows another specific construction of the code converter 106. In the figure, a NOT circuit 502 inverts the most significant bit of a code which is fed thereto via an input terminal 501 and delivers the result via an output terminal 503. Lower bits of the input code are directly fed out via the output terminal 503. When use is made of such a code converter, a code inverse-converter associated with the code converter will have the same construction as the latter. Fig. 6 shows still another specific construction of the code converter 106 which is implemented by a ROM 602. The ROM 602 has L address bits and stores L bits of predetermined data in each of its addresses. Upper L bits of a code coming in through an input terminal 601 are fed to the ROM 602 in the form of an address signal, so that data associated with those bits are read out of the ROM 602 and fed out via an output terminal 603. Lower bits of the input code are directly outputted via the output terminal 603. A code inverse-converter associated with a code converter having the above construction will have the same construction as the latter, but a ROM of the code inverse-converter should be loaded with data in such a manner as to effect code conversion inversely to the ROM 602. Referring to Fig. 7, an alternative embodiment of the encoding method in accordance with the present invention is shown. As shown, the encoding device is composed of input terminals 701 and 713, a comparator 702, an encoder 703, a converter 704, selectors 705 and 712, a code converter 706, and an output terminal 711. Information applied to the input terminal 701 is fed to the selector 712. The selector 712 first selects the information and delivers it to the comparator 702, encoder 703, and converter 704. Comparing the input numerical value with the common key n , the comparator 702 produces a ONE if the former is smaller than the latter and a ZERO if otherwise. The encoder 703 performs the conventional encoding operation with the input and produces the result. The converter 704 applies a predetermined one-to-one conversion to the input numerical value. The selector 705 selects the output of the encoder 703 if the output of the comparator 702 is a ONE and selects the output of the converter 704 if it is a ZERO. The code converter 706 effects a predetermined code conversion with the output of the selector 705, delivering an output thereof to the selector 712. Then, the selector 712 selects the output of the code converter 706, so that the above-described manipulations applied to the information are executed with the output of the code converter 706. Finally, the output of the selector 705 is fed out via the output terminal 711 in the form of a cryptogram. The selector 712 is switched over by a control signal which is applied to an input terminal 713. With the encoding device of Fig. 7, it is possible to repeat the above operation applied to information more than two times by repeating the feedback of the output of the selector 705 to the code converter 706. For each of such repetitive operations, use may be made of a different common key and a different encoding key. Referring to Fig. 8, an alternative embodiment of the decoding method in accordance with the present invention is shown. As shown, the decoding device is made up of input terminals 801 and 813, a comparator 802, a decoder 803, an inverse-converter 804, selectors 805 and 812, a code inverse-converter 806, and an output terminal 811. A cryptogram applied to the input terminal 801 is fed to the selector 812. The selector 812 first selects the cryptogram and delivers it to the comparator 802, decoder 803, and inverse-converter 804. Comparing the input numerical value with the common key n , the comparator 802 produces a ONE if the former is smaller than the latter and a ZERO if otherwise. The decoder 803 decodes the input by using the conventional principle. The inverse-converter 804 applies a predetermined one-to-one conversion to the input numerical value. The selector 805 selects the output of the decoder 803 if the output of the comparator 802 is a ONE and selects the output of the inverse-converter 804 if it is a ZERO. Receiving the output of the selector 805, the code inverse-converter 806 performs a predetermined code inverse conversion with the input and feeds its output to the selector 812. At this time, the selector 812 selects the output of the code inverse-converter 806, so that the above operation applied to the cryptogram is executed with the output of the code inverse-converter 806. The output of the selector 805 is fed out in the form of recovered information. The selector 812 is switched over by a control signal which is applied to an input terminal 813. With the construction of Fig. 8, it is possible to repeat the above operation more than two times by repeating the feedback of the output of the selector 805 to the code inverse-converter 806. The number of times of repetition should be the same as that of the encoding device of Fig. 7. In the device shown in Fig. 8, a different common key and a different decoding key may be assigned to each of the repetitive operations. It is to be noted, however, that when the coding device of Fig. 7 uses common keys n (1), n (2), ..., n (M) and encoding keys e (1), e (2), ... e (M) in this order and decoding keys d (1), d (2), ,,., d (M) are associated respectively with the encoding keys e (1), e (2), ... e (M), the decoding device should use the common keys n (M), ..., n (2), n (1) and the decoding keys d (M), ..., d (2), d (1) in this order. While the present invention has been described in conjunction with the preferred embodiments thereof, it will now readily be possible for those skilled in the art to put the present invention into practice in various other manners.

Claims: An encoding method for use in a secure data transmission system for producing a code associated with inputted information, comprising the steps of: (a) if a numerical representation of the inputted information is smaller than a predetermined numerical value, applying a predetermined operation to said information and producing as an interim result a residual remaining after a result of said operation is divided by said numerical value; (b) if the numerical representation of the inputted information is not smaller than the numerical value, applying a predetermined conversion to said information and producing a result of said conversion as an interim result; (c) applying a predetermined code conversion to the interim result and producing a result of said code conversion as a new interim result; (d) if the new interim result is smaller than the numerical value, applying the predetermined operation to said new interim result and producing as the code a residual remaining after a result of said predetermined operation is divided by said numerical value; and (e) if the new interim result is not smaller than the predetermined numerical value, applying a predetermined conversion to said new interim result and producing a result of said conversion as the code. An encoding method as claimed in claim 1, wherein the predetermined conversion comprises a conversion for directly outputting the information. An encoding method as claimed in claim 1 or 2, wherein the predetermined code conversion comprises a conversion for adding or subtracting the interim result and the numerical value. An encoding method as claimed in claims 1 to 3, wherein the predetermined code conversion comprises a conversion for inverting the most significant bit of the interim result. An encoding method as claimed in claims 1 to 4, wherein steps (c) to (e) are repeated a plurality of times by using the code produced by step (d) or (e) as an interim result, and the interim result produced by step (d) or (e) which is executed last is outputted as the code. A decoding method for use in a secure data transmission system for decoding an inputted code to produce information associated with said code, comprising the steps of: (a) if a numerical representation of the code is smaller than a predetermined numerical value, applying a predetermined operation to said code, and producing as an interim result a residual remaining after a result of said operation is divided by said numerical value; (b) if the numerical representation of the code is not smaller than the predetermined numerical value, applying a predetermined inverse-conversion to said code and outputting a result of said inverse-conversion as an interim result; (c) applying a predetermined code inverse-conversion to the interim result and outputting a result of said code inverse-conversion as a new interim result; (d) if the new interim result is smaller than the numerical value, applying a predetermined operation to said interim result and outputting as the information a residual remaining after a result of said operation is divided by said numerical value; and (e) if the new interim result is not smaller than the numerical value, applying a predetermined inverse-conversion to said interim result and outputting a result of said inverse-conversion as the information. A decoding method as claimed in claim 6, wherein the predetermined inverse-conversion comprises a conversion for directly outputting the code. A decoding method as claimed in claim 6 or 7, wherein the predetermined code inverse-conversion comprises a conversion for adding or subtracting the interim result and the numerical value. A decoding method as claimed in claims 6 to 8, wherein the predetermined inverse-conversion comprises a conversion for inverting the most significant bit of the interim result. A decoding method as claimed in claims 6 to 9, wherein steps (c) to (e) are repeated a plurality of times by using the code produced by step (d) or (e) as an interim result, and the new interim result produced by step (d) or (e) is outputted as the information. An encoding apparatus for use in a secure data transmission system for producing a code associated with inputted information, comprising: an input means (101) for feeding said inputted information to a first comparator (102), a first encoder (103) and a first converter (104), said first comparator (102) being adapted to compare a numerical representation of said inputted information with a first predetermined numerical value, said first encoder (103) being adapted to encode said inputted information, and said first converter (104) being adapted to convert said inputted information; a first selector (105) for selecting the output of said first encoder (103) or the output of said first converter (104) in response to the output of said first comparator (102); a code converter (106) for receiving the output of said first selector (105), applying a predetermined code conversion thereto and delivering the result to a second comparator (107), a second encoder (108) and a second converter (109), said second comparator (107) being adapted to compare said result with a second predetermined numerical value, said second encoder (108) being adapted to encode said result, and said second converter (109) being adapted to convert said result; a second selector (110) for selecting the output of said second encoder (108) or the output of said second converter (109) in response to the output of said second comparator (107); and an output means (111) for feeding out the output of said second selector (110) in the form of a cryptogram. An encoding apparatus as claimed in claim 11, wherein said code converter (106) comprises a plurality of NOT circuits (306) for inverting all the bits of said first predetermined numerical value, and an adder (303) for adding the outputs of said NOT circuits (306) to a code, said adder (303) having a carry input to which a ONE is fed via a terminal (304). An encoding apparatus as claimed in claim 11, wherein said code converter (106) comprises a NOT circuit (502) for inverting the most significant bit of a code which is fed thereto and for delivering the result via an output terminal (503), whereas the lower bits of said code are directly fed out via said output terminal (503). An encoding apparatus as claimed in claim 11, wherein said code converter (106) comprises a ROM (602) having L address bits and storing L bits of predetermined data in each of its addresses, the upper L bits of a code coming in through an input terminal (601) being fed to said ROM (602) in the form of an address signal, so that data associated with those bits are read out of said ROM (602) and fed out via an output terminal (603), whereas the lower bits of said input code are directly outputted via said output terminal (603). A decoding apparatus for use in a secure data transmission system for decoding an inputted code to produce information associated with said code, in particular to recover the original information from the cryptogram outputted by the encoding apparatus according to any of claims 11 to 14, said decoding apparatus comprising: an input means (201) for feeding a cryptogram to a first comparator (202), a first decoder (203) and a first inverse-converter (204), said first comparator (202) being adapted to compare a numerical representation of said cryptogram with a first predetermined numerical value, said first decoder (203) being adapted to decode said cryptogram, and said first inverse-converter (204) being adapted to convert said cryptogram; a first selector (205) for selecting the output of said first decoder (203) or the output of said first inverse-converter (204) in response to the output of said first comparator (202); a code inverse-converter (206) for receiving the output of said first selector (205), applying a predetermined code conversion thereto and delivering the result to a second comparator (207), a second decoder (208) and a second inverse-converter (209), said second comparator (207) being adapted to compare said result with a second predetermined numerical value, said second decoder (208) being adapted to decode said result, and said second inverse-converter (209) being adapted to convert said result; a second selector (210) for selecting the output of said second decoder (208) or the output of said second inverse-converter (209) in response to the output of said second comparator (207); and an output means (211) for feeding out the output of said second selector (210) in the form of recovered information. A decoding apparatus as claimed in claim 15, wherein said code inverse-converter (206) comprises an adder (403) for adding said first predetermined numerical value and a code, said adder (403) having a carry input to which a ZERO is applied via a terminal (404). A decoding apparatus as claimed in claim 15, wherein said code inverse-converter (206) comprises a NOT circuit (502) for inverting the most significant bit of a code which is fed thereto and for delivering the result via an output terminal (503), whereas the lower bits of said code are directly fed out via said output terminal (503). A decoding apparatus as claimed in claim 15, wherein said code inverse-converter (206) comprises a ROM (602) having L address bits and storing L bits of predetermined data in each of its addresses, the upper L bits of a code coming in through an input terminal (601) being fed to said ROM (602) in the form of an address signal, so that data associated with those bits are read out of said ROM (602) and fed out via an output terminal (603), whereas the lower bits of said input code are directly outputted via said output terminal (603). An encoding apparatus for use in a secure data transmission system for producing a code associated with inputted information, comprising: a first input means (701) for feeding said inputted information to a first selector (712), said first selector delivering said information to a comparator (702), an encoder (703) and a converter (704), said comparator (702) being adapted to compare the input numerical value with a predetermined numerical value, said encoder (703) being adapted to encode said input and produce a result, and said converter (704) being adapted to convert said input numerical value; a second selector (705) for selecting the output of said encoder (703) or the output of said converter (704) in response to the output of said comparator (702); a code converter (706) for receiving the output of said second selector (705), applying a predetermined code conversion thereto and delivering the result to said first selector (712); wherein said first selector (712) is adapted to select the output of said code converter (706) or the information fed by said first input means (701) in response to a control signal fed by a second input means (713); and an output terminal (711) for feeding out the output of said second selector (705) in the form of a cryptogram. A decoding apparatus for use in a secure data transmission system for decoding an inputted code to produce information associated with said code, in particular to recover the original information from the cryptogram outputted by the encoding apparatus according to claim 19, said decoding apparatus comprising: a first input means (801) for feeding a cryptogram to a first selector (812), said first selector delivering said cryptogram to a comparator (802), a decoder (803) and an inverse-converter (804), said comparator (802) being adapted to compare the input numerical value with a predetermined numerical value, said decoder (803) being adapted to decode said input and produce a result, and said inverse-converter (804) being adapted to convert said input numerical value; a second selector (805) for selecting the output of said decoder (803) or the output of said inverse-converter (804) in response to the output of said comparator (802); a code inverse-converter (806) for receiving the output of said second selector (805), applying a predetermined code inverse conversion thereto and delivering the result to said first selector (812); wherein said first selector (812) is adapted to select the output of said code inverse-converter (806) or the information fed by said first input means (801) in response to a control signal fed by a second input means (813); and an output means (811) for feeding out the output of said second selector (805) in the form of recovered information.

Inventors: SHIMADA MICHIO, SHIMADA, MICHIO
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1989
Main classification: H04L9
IPC codes: G09C1, H03M7, H04L9