WO2003094419A1 - Method and apparatus for encryption/decryption in a medium converter - Google Patents

Method and apparatus for encryption/decryption in a medium converter Download PDF

Info

Publication number
WO2003094419A1
WO2003094419A1 PCT/JP2002/004314 JP0204314W WO03094419A1 WO 2003094419 A1 WO2003094419 A1 WO 2003094419A1 JP 0204314 W JP0204314 W JP 0204314W WO 03094419 A1 WO03094419 A1 WO 03094419A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
length
additional
variable
encryption
Prior art date
Application number
PCT/JP2002/004314
Other languages
French (fr)
Japanese (ja)
Inventor
Seiho Itano
Original Assignee
Allied-Telesis, K.K.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Allied-Telesis, K.K. filed Critical Allied-Telesis, K.K.
Priority to PCT/JP2002/004314 priority Critical patent/WO2003094419A1/en
Priority to AU2002253659A priority patent/AU2002253659A1/en
Priority to JP2004502533A priority patent/JPWO2003094419A1/en
Priority to US10/307,400 priority patent/US20030179882A1/en
Priority to TW092105884A priority patent/TWI224896B/en
Priority to DE2003113016 priority patent/DE10313016A1/en
Priority to GB0306838A priority patent/GB2387091A/en
Priority to CN03130794.9A priority patent/CN1455557A/en
Publication of WO2003094419A1 publication Critical patent/WO2003094419A1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0625Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry

Definitions

  • the present invention relates to a media converter for connecting different types of transmission media, and more particularly, to an encryption / decryption method and apparatus in a media converter.
  • FTTH Fiber To The Home
  • a media converter for connecting an optical fiber line to an office or a home computer is indispensable.
  • a media converter is provided with a port for connecting an optical cable, a port for connecting an UTP cable, and a power supply, and a physical layer device is connected to each.
  • Each physical layer device supports MII (Media Independent Interface) defined by the IEEE 802.3 standard.
  • MII Media Independent Interface
  • a media converter generally has a missing function that automatically disconnects one link when one link is disconnected.
  • a LAN (Local Area Network) management switch is connected to one port of a media converter using a UTP (Unshielded Twisted Pair) cable, and an optical cable is connected to the other port.
  • UTP Unshielded Twisted Pair
  • the other party converts the optical cable to a UTP cable using a media converter and connects it to the management switch.
  • LANs can communicate with each other through optical communication lines.
  • a single domain can be configured.
  • variable-length data is transferred to a register, and when the data amount of the register exceeds a predetermined bit, Fixed-length data is generated by sequentially outputting data for each fixed-length bit number. Finally, the data remaining in the register is combined with the next input data and output as the next fixed-length data.
  • the length of the variable-length data is set to an integral multiple of the fixed-length data, and the variable-length data is divided. It is not expected that there will be a surplus when this is done.
  • this conventional method aims to output variable-length data as a stream of fixed-length data, and divides certain variable-length data into a set of fixed-length data and processes each fixed-length data. is not. I Therefore, the last data remaining in the register can be combined with the next input data and output as the next fixed-length data.
  • An object of the present invention is to provide an encryption / decryption method and apparatus in a media converter that converts variable-length data into fixed-length data and performs an encryption process.
  • Another object of the present invention is to provide an encryption method and apparatus which enable efficient encryption processing of each fixed-length data even if a remainder occurs when variable-length data is divided into fixed-length data. Is to do.
  • Still another object of the present invention is to provide a decoding method and apparatus capable of easily decoding data obtained by performing encryption processing of variable-length data into original variable-length data.
  • the method further comprises: calculating a remainder data length when dividing the variable length data into a predetermined fixed length; Determining the difference between the length and the remaining data length as the additional data length, generating additional data including reference data for determining the additional data length, and adding the additional data to the variable length data Generating extended data that can execute the fixed-length processing.
  • the reference data be placed at a predetermined position of the extended data. In particular, it is desirable to place the reference data at the end of the expanded data.
  • a method for converting data obtained by performing fixed-length processing on variable-length data into the variable-length data Calculating a surplus data length when dividing the variable length data into a predetermined fixed length, determining a difference between the fixed length and the surplus data length as an additional data length, To determine Generating additional data of the additional data length including reference data, adding the additional data to the variable length data, generating extended data in which the reference data is present at a predetermined position, The fixed-length processing is performed to generate fixed processing result data, and the fixed processing result data is subjected to a fixed processing opposite to the fixed processing to correspond to the extended data. Generating the received data, reading the reference data from the predetermined position of the received data, determining the additional data length from the reference data, and removing the data corresponding to the additional data length from the received data. In this way, the original variable-length data is restored.
  • the fixed length processing is characterized in that the extended data is divided for each of the fixed lengths, and each of the fixed length data is processed.
  • the fixed-length process is an encryption process
  • the reverse fixed process is a decryption process corresponding to the encryption process.
  • FIG. 1 is a block diagram showing an example of a media converter to which an encryption / decryption method according to the present invention is applied.
  • FIG. 2 is a schematic block diagram of a data processing system employing an encryption Z decryption method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart showing an example of an extended data adding operation according to an embodiment of the present invention
  • FIG. 4 is a format diagram for explaining generation of extension data
  • FIG. 5 is a flowchart showing an example of an extension data deletion operation according to an embodiment of the present invention.
  • FIG. 6 is a block diagram of the encrypted Z decryption unit 13 of FIG.
  • FIG. 7 shows the flow of encryption / decryption of the encryption / decryption processing unit shown in Fig. 6.
  • FIG. 1 is a block diagram showing an example of a media converter to which an encryption Z decryption method according to the present invention is applied.
  • a pair of ports of the media converter 10 are provided with physical layer devices (P HY) 11 and 12, respectively, one physical layer device 11 is connected to a UTP cable, the other physical layer device 12 is connected to an optical cable, Each is connected.
  • P HY physical layer devices
  • MII Media Independent Interface
  • an encryption / decryption unit 13 including a FIFO (First in First out) memory is provided between the physical layer device 11 and the physical layer device 12. Z decoding is performed. Further, the frequency deviation between transmission and reception can be absorbed by the FIFO memory. For example, variable-length data received by one physical layer device is sequentially written to the FIFO memory, read out in the order in which it was written, encrypted with fixed-length data, and then sent to the other physical layer device. Is done. Conversely, the encrypted data received by the other physical layer device is sequentially written to the FIFO memory, read out in the written order, decrypted, and then sent to the other physical layer device as variable-length data. Sent out.
  • FIFO First in First out
  • the encryption / decryption unit 13 is configured by an application-specific integrated circuit (ASIC), and also controls the operation of the entire media converter including generation of the encryption / decryption key.
  • ASIC application-specific integrated circuit
  • FIG. 2 is a schematic block diagram of a data processing system employing an encryption / decryption method according to an embodiment of the present invention.
  • the transmission side has an extension data addition unit 101, an additional byte length calculation unit 102, and an encryption processing unit 103
  • the reception side has a decryption processing unit 104
  • It has a data removal unit 105 and an added bite length calculation unit 106.
  • the length of the variable-length data is assumed to be n bytes (n is a natural number)
  • the encryption processing unit 103 can perform encryption processing only on data having a fixed length of m bytes (m is a natural number of 1 or more). Shall be assumed.
  • the extension data adding unit 101 expands the data so that the variable-length n-byte data is processed by the encryption unit 103 without any excess or shortage.
  • the extension data adding unit 101 transfers the data length n of the variable length n bit data to the additional bit length calculation unit 102.
  • the additional byte length calculation unit 102 calculates the number of remaining bytes r of n Zm and the additional byte length k and returns the result to the extension data addition unit 101 (details will be described later).
  • the extension data adding unit 101 generates extension data of k bits including the number of surplus pipes r at a predetermined position, attaches the extension data to a predetermined position of variable-length n-byte data, and adds (n + k) bytes
  • the data is output to the encryption processing unit 103 as data. It is desirable that extension data be added to the end of variable-length n-byte data. At this time, it is necessary to specify where the data representing the number of remaining bytes r exists from the end of the (n + k) byte data. Therefore, it is desirable to place data representing the number of remaining bytes r at the end of (n + k) -byte data.
  • the encryption processing unit 103 divides the (n + k) -byte data into fixed-length m bytes, and performs an encryption process on each of the divided fixed-length m-byte data.
  • the data as a result of the processing is transmitted to the receiving side through, for example, a transmission line.
  • the decryption processing unit 104 on the receiving side performs processing opposite to the processing of the encryption processing unit 103 on the received data to decrypt the fixed-length m-byte data, and combines them. Then, the data is output to the extended data removing unit 105 as (n + k) byte data.
  • the extension data removal unit 105 reads the number of bits r remaining from a predetermined position of the input (n + k) byte data, and passes the number to the additional byte length calculation unit 106.
  • the additional byte length calculation unit 106 calculates the added byte length k from the number of remaining bytes r, and returns it to the extended data removal unit 105.
  • the extended data removing unit 105 removes the k-byte extended data from a predetermined position of the (n + k) -byte data, and outputs the original variable-length n-byte data.
  • FIG. 3 is a flowchart showing an example of an extension data adding operation according to an embodiment of the present invention
  • FIG. 4 is a format diagram for explaining generation of extension data.
  • variable-length n-byte data 201 must be divided into fixed-length m bytes. At that time, there may be r bytes (0 ⁇ r ⁇ m) of extra data.
  • data 205 having a byte length (n + k) divisible by the fixed length m is obtained.
  • the extension data 202 Since the extension data 202 is eventually removed, it is necessary to write reference data to the extension data 202 so that the length of the extension data 202 can be calculated.
  • the value of the remaining data length r is written as a reference data at a predetermined position (here, at the end) of the extension data 202. For example, if the range of the fixed length m is 1 ⁇ m ⁇ 256, then r is m, so a data area of 1 byte ( ⁇ 255) is reserved to represent the remaining data length r. It's enough.
  • the additional data length calculation unit 102 calculates the remaining data length r and the additional bit length k, and returns to the extended data addition unit 101.
  • the extension data addition unit 101 generates k-byte extension data 202 consisting of a (k-1) -byte paddle 203 and 1-byte reference data 204. Then, it is added to a predetermined position (here, at the end) of the n-byte data 201 (step S21).
  • step S22 the fixed-length processing of the variable-length data 201 can be performed only by adding a small amount of the extended data 202.
  • FIG. 5 is a flowchart showing an example of an extended data deletion operation according to an embodiment of the present invention.
  • the decryption processing section 104 performs processing opposite to the processing of the encryption processing section 103 on the received data to decrypt the fixed-length m-byte data and synthesizes them ( (n + k)
  • the noise data 205 is output to the extended data removing unit 105.
  • the remaining byte number r is written as reference data at a predetermined position (here, the last byte) of the input (n + k) byte data 205. Therefore, the extended data removing unit 105 reads out the last one byte of data and passes it to the additional byte length calculating unit 106.
  • the extension data removal unit 105 removes the last k bits of the (n + k) byte data 205, that is, the extension data 202 (step S24), and removes the original variable length n Outputs byte data 201. Thus, from the fixed-length encryption Output data can be easily restored to the original variable-length data.
  • FIG. 6 is a detailed block diagram of the encryption / decryption unit 13 of FIG.
  • the variable-length transmission data output from the data processing unit (not shown) is input to an input FIFO (First In First Out) memory 301 through the physical layer 300a, and sequentially to the paddle addition module 3 Output to 02.
  • FIFO First In First Out
  • the paddle addition module 302 corresponds to the extension data addition unit 101 and the addition byte length calculation unit 102 in FIG.
  • the paddle addition module 302 adds k-bit extended data to the input n-byte transmission data, and outputs (n + k) -byte data to the encryption module 303.
  • the encryption module 303 divides (n + k) -byte data into fixed-length m-byte data and executes an encryption process on each of them according to the encryption key.
  • the encrypted (n + k) byte data is sent to the physical layer 300b via the output FIFO memory 304.
  • the data received from the physical layer 300 b is sequentially input to the decoding module 306 via the input FIFO memory 305.
  • the decryption module 303 decrypts the fixed-length m-byte data from the received data according to the encryption key, combines them, and outputs the resultant data to the paddle removal module 3007 as (n + k) -byte data. I do.
  • the paddle removal module 307 corresponds to the extended data removal unit 105 and the added byte length calculation unit 106 in FIG.
  • the paddle removal module 307 calculates the additional bit length k from the last one byte of data, and calculates the maximum length of (n + k) byte data. 2/04314
  • the trailing k-bit data is removed to generate variable-length n-byte data, which is output to the physical layer 300a through the output FIFO memory 308.
  • the input FI FO memory 301 of the transmission unit is provided to absorb the phase difference between the transmission clock of the physical layer 300a side and the clock of the encryption / decryption module.
  • the memory 304 is provided to absorb a phase difference between the transmission clock on the other physical layer 300b side and the port of the encryption / decryption module.
  • the input FI FO memory 305 of the receiving unit is provided to absorb the phase difference between the reception clock of the physical layer 30 Ob and the clock of the encryption / decryption module
  • the output FI FO memory 308 is provided. It is provided to absorb the phase difference between the reception clock on the physical layer 300a side and the clock of the encryption Z decryption module.
  • FIG. 7 is a diagram showing the flow of encryption / decryption by the transmission / reception unit shown in FIG.
  • the extended transmission data of 72 bytes is divided into 8-byte units, and the 9 divided 8-byte data are respectively encrypted in the DES ECB mode (Fig. 7 (d)).
  • 72 bytes of encrypted data are obtained (Fig. 7 (e)).
  • DES encryption of variable-length data can be performed only by adding a small amount of paddle data.
  • the DES decryption module 303 decrypts each of the 8-byte data (FIG. 7 (f)). 8 decrypted
  • the byte data is combined to obtain 72 bits of data, and the additional paddle length k is calculated from the last byte (0x03).
  • the last 5 bytes of paddle data (0x0000000003) are removed from the 72-byte data (Fig. 7 (h)).
  • the original 67-byte data is obtained (Fig. 7 (i)).
  • the DES encrypted data can be easily restored to the original variable length data.
  • the DES encryption technology has been described as an example, but the present invention is not limited to this.
  • INDUSTRIAL APPLICABILITY The present invention can be applied to a case where an encryption processing technique that accepts only fixed-length data is used for processing variable-length input data.
  • the data removing unit 105 and the additional byte length calculating unit 106 can be configured as hardware, but can also be realized by software. That is, a program for instructing the computer to perform the operation of generating, adding, and removing extended data described in FIGS.
  • 3 to 5 is stored in a memory, and a program corresponding to each operation is run on the computer.
  • a similar function can be realized.
  • a surplus data length when dividing variable-length data into a predetermined fixed length is calculated, and a difference between the fixed length and the surplus data length is determined as an additional data length. Then, by adding the additional data including the reference data for determining the additional data length to the variable length data, extended data that can execute the fixed length encryption processing is generated. Therefore, only by adding a small amount of additional data to variable-length data, fixed-length encryption of variable-length data becomes possible.
  • the original data can be easily changed by removing the additional data length from the extended data. Long data can be restored.
  • the input has a fixed length for variable-length data. This is a very effective technique when performing encryption processing.

Abstract

An encryption/decryption block is provided in a medium converter. Variable length n-byte data (201) entered is divided into a fixed length m to calculate a remainder data length r and a difference between the fixed length m and the remainder data length r is decided to be an additional data length k. Additional k-byte data (202) is added to the end of the variable length n-byte data (201) and reference data to determine the additional data length is arranged at the end of the (n + k)-byte data (205). The (n + k)-byte data (205) is encrypted. When decrypting the encrypted data, the additional data length is determined from the reference data and the corresponding data is deleted so as to restore the previous variable length data.

Description

コンバータにおける暗号ィヒノ復号ィ匕方法及び装置  Method and apparatus for encryption in a converter
技術分野 Technical field
本発明は異なる種類の伝送媒体を接続するためのメディアコンバータに係り、 特にメディアコンバータにおける暗号化/複号化方法及び装置に関する。  The present invention relates to a media converter for connecting different types of transmission media, and more particularly, to an encryption / decryption method and apparatus in a media converter.
明 背景技術 田 近年、 各家庭まで光ファイバ回線をのばして、 音楽や動画像、 医療データな どを高速回線で自在にやり取りできる F T T H (Fiber To The Home) が話題 を集めている。 このような F T T Hが実現されると、 光ファイバ回線をオフィ スあるいは家庭内のコンピュータに接続するためのメディアコンバータが不可 欠となる。  In recent years, FTTH (Fiber To The Home), which allows users to freely exchange music, video, medical data, and other data over high-speed lines over optical fiber lines to homes, has attracted much attention in recent years. When such FTTH is realized, a media converter for connecting an optical fiber line to an office or a home computer is indispensable.
メディアコンバータには、 一般に、 光ケーブルを接続するためのポートと U T Pケーブルを接続するためのポートとカ S設けられ、 それぞれに物理層デバイ スが接続されている。 各物理層デパイスは I E E E 8 0 2 . 3規格によって規 定された M I I (Media Independent Interface) をサポートしている。 また、 メディアコンバータの性質上、 一方のリンクが切断された場合に他方のリンク を自動的に切断するミッシンダリング機能を有するものが一般的である。  In general, a media converter is provided with a port for connecting an optical cable, a port for connecting an UTP cable, and a power supply, and a physical layer device is connected to each. Each physical layer device supports MII (Media Independent Interface) defined by the IEEE 802.3 standard. In addition, due to the nature of the media converter, a media converter generally has a missing function that automatically disconnects one link when one link is disconnected.
このようなメディアコンバータを用いることで光ケーブルを介した長距離伝 送が可能となる。 たとえば、 L AN (Local Area Network) のマネジメントス イッチを U T P (Unshielded Twisted Pair) ケーブルを用いてメディアコンパ ータの一方のポートに接続し、 他方のポートに光ケーブルを接続する。 相手側 も同様に、メディアコンバータを用いて光ケーブルを U T Pケーブルに変換し、 マネジメントスィツチに接続する。 こうして光通信回線を通して L AN同士が 単一ドメィンを構成することができる。 By using such a media converter, long-distance transmission via an optical cable becomes possible. For example, a LAN (Local Area Network) management switch is connected to one port of a media converter using a UTP (Unshielded Twisted Pair) cable, and an optical cable is connected to the other port. Similarly, the other party converts the optical cable to a UTP cable using a media converter and connects it to the management switch. In this way, LANs can communicate with each other through optical communication lines. A single domain can be configured.
このような通信システムにおいて、 光通信回線や L ANにおけるセキユリテ ィは重要な問題の 1つである。 そこで、 データの暗号化 Z復号化機能をメディ ァコンバータに組み込むことが考えられている。  In such communication systems, security in optical communication lines and LANs is one of the important issues. Therefore, it is considered to incorporate the data encryption and Z decryption functions into the media converter.
しかしながら、 暗号技術の一つである D E S (Data Encryption Standard) 暗号 を使用して可変長 nパイ トのデータを暗号ィ匕する場合、 D E Sへの入力を 8パ ィト単位に分割しなければならない。 この場合、 nの値によっては分割する際 に 8バイト未満の余りが生じる。 このために、 その余り部分を D E S入力可能 な 8バイトに拡張する技術が必要である。  However, when encrypting variable-length n-byte data using DES (Data Encryption Standard) encryption, one of the encryption technologies, the input to DES must be divided into 8-byte units. . In this case, depending on the value of n, there is a remainder of less than 8 bytes when dividing. For this reason, a technology is needed to expand the remainder to 8 bytes that can be input to DES.
従来、 可変長データを固定長データに変換する技術は種々提案されている。 例えば、 特開平 0 8— 0 3 0 4 3 7号公報には、 可変長データを最適な固定長 データに分割し複数の演算処理部で並列処理を行う計算機が開示されている。 また、 特開 2 0 0 1— 3 3 2 9 7 8号公報に開示されたデータストリーム変換 方法では、 可変長データをレジスタに転送し、 そのレジスタのデータ量が所定 ビットを超えたときに、 固定長ビット数ごとに順次出力することで固定長デー タを生成する。最後にレジスタに残ったデータは、次の入力データと結合され、 次回の固定長データとして出力される。  Conventionally, various techniques for converting variable-length data into fixed-length data have been proposed. For example, Japanese Patent Application Laid-Open No. 08-030437 discloses a computer that divides variable-length data into optimal fixed-length data and performs parallel processing by a plurality of arithmetic processing units. Also, in the data stream conversion method disclosed in Japanese Patent Application Laid-Open No. 2000-3323978, variable-length data is transferred to a register, and when the data amount of the register exceeds a predetermined bit, Fixed-length data is generated by sequentially outputting data for each fixed-length bit number. Finally, the data remaining in the register is combined with the next input data and output as the next fixed-length data.
しかしながら、 上記特開平 0 8— 0 3 0 4 3 7号公報に開示された計算機で は、 可変長データの長さが固定長データの整数倍に設定されており、 可変長デ ータを分割したときに余りが生じることは想定されていない。  However, in the computer disclosed in Japanese Patent Application Laid-Open No. 08-030437, the length of the variable-length data is set to an integral multiple of the fixed-length data, and the variable-length data is divided. It is not expected that there will be a surplus when this is done.
これに対して、 上記特開 2 0 0 1— 3 3 2 9 7 8号公報には、 可変長データ を固定長データごとに分割出力した後にレジスタに残ったデータ (余り) の処 理について言及されている。  On the other hand, the above-mentioned Japanese Patent Application Laid-Open Publication No. 2000-3322978 mentions processing of data (remainder) remaining in a register after variable-length data is divided and output for each fixed-length data. Have been.
しかしながら、 この従来の方法は可変長データを固定長データのストリーム として出力することを目的としており、 ある可変長データを一組として固定長 データに分割し、 それぞれの固定長データをデータ処理するわけではない。 し たがつて、 最後にレジスタに残つたデータを次の入力データと結合させること ができ、 次回の固定長データとして出力できるわけである。 However, this conventional method aims to output variable-length data as a stream of fixed-length data, and divides certain variable-length data into a set of fixed-length data and processes each fixed-length data. is not. I Therefore, the last data remaining in the register can be combined with the next input data and output as the next fixed-length data.
本発明の目的は、 可変長データを固定長データに変換して暗号化処理を行う メディアコンバータにおける暗号化/復号化方法及び装置を提供することにあ る。  An object of the present invention is to provide an encryption / decryption method and apparatus in a media converter that converts variable-length data into fixed-length data and performs an encryption process.
本発明の他の目的は、 可変長データを固定長データに分割した際に余りが生 じても各固定長データの効率的な暗号ィ匕処理を可能にする暗号化方法及ぴ装置 を提供することにある。  Another object of the present invention is to provide an encryption method and apparatus which enable efficient encryption processing of each fixed-length data even if a remainder occurs when variable-length data is divided into fixed-length data. Is to do.
更に、 本発明の別の目的は、 可変長データの暗号ィ匕処理により得られたデー タを容易に元の可変長データに復号化することができる復号化方法及び装置を 提供することにある。 発明の開示  Still another object of the present invention is to provide a decoding method and apparatus capable of easily decoding data obtained by performing encryption processing of variable-length data into original variable-length data. . Disclosure of the invention
本発明の第 1の観点によれば、 可変長データを固定長処理するためにデータ 変換する方法において、 前記可変長データを所定の固定長に分割した際の余り データ長を算出し、 前記固定長と前記余りデータ長との差を付加データ長とし て決定し、 前記付加データ長を決定するための参照データを含めた付加データ を生成し、 前記可変長データに前記付加データを付加することで前記固定長処 理が実行可能な拡張されたデータを生成する、 ことを特徴とする。  According to a first aspect of the present invention, in a method for performing data conversion for performing fixed length processing on variable length data, the method further comprises: calculating a remainder data length when dividing the variable length data into a predetermined fixed length; Determining the difference between the length and the remaining data length as the additional data length, generating additional data including reference data for determining the additional data length, and adding the additional data to the variable length data Generating extended data that can execute the fixed-length processing.
参照データは拡張されたデータの予め定められた位置に配置されることが望 ましい。 特に、 参照データを拡張されたデータの最後尾に配置することが望ま しレ、。  It is preferable that the reference data be placed at a predetermined position of the extended data. In particular, it is desirable to place the reference data at the end of the expanded data.
本発明の第 2の観点によれば、 可変長データを固定長処理することで得られ たデータを前記可変長データに変換する方法にお!/、て、 前記可変長データを所 定の固定長に分割した際の余りデータ長を算出し、 前記固定長と前記余りデー タ長との差を付加データ長として決定し、 前記付加データ長を決定するための 参照データを含む前記付加データ長の付加データを生成し、 前記付加データを 前記可変長データに付加し、 前記参照データが所定位置に存在する拡張された データを生成し、 前記拡張されたデータに対して前記固定長処理を実行するこ とで固定処理結果データを生成し、 前記固定処理結果データに対して前記固定 処理とは逆の固定処理を実行することで、 前記拡張されたデータに対応する受 信データを生成し、 前記受信データの前記所定位置から前記参照データを読み 出し、 前記参照データから前記付加データ長を決定し、 前記受信データから前 記付加データ長に相当するデータを除去することで、 元の可変長データを復元 する、 ことを特徴とする。 According to a second aspect of the present invention, there is provided a method for converting data obtained by performing fixed-length processing on variable-length data into the variable-length data. Calculating a surplus data length when dividing the variable length data into a predetermined fixed length, determining a difference between the fixed length and the surplus data length as an additional data length, To determine Generating additional data of the additional data length including reference data, adding the additional data to the variable length data, generating extended data in which the reference data is present at a predetermined position, The fixed-length processing is performed to generate fixed processing result data, and the fixed processing result data is subjected to a fixed processing opposite to the fixed processing to correspond to the extended data. Generating the received data, reading the reference data from the predetermined position of the received data, determining the additional data length from the reference data, and removing the data corresponding to the additional data length from the received data. In this way, the original variable-length data is restored.
前記固定長処理は、 前記拡張されたデータを前記固定長ごとに分割し、 固定 長データをそれぞれ処理することを特徴とする。 好ましくは、 前記固定長処理 は暗号化処理であり、 前記逆の固定処理は前記暗号化処理に対応する復号化処 理である。 図面の簡単な説明  The fixed length processing is characterized in that the extended data is divided for each of the fixed lengths, and each of the fixed length data is processed. Preferably, the fixed-length process is an encryption process, and the reverse fixed process is a decryption process corresponding to the encryption process. BRIEF DESCRIPTION OF THE FIGURES
第 1図は、 本発明による暗号化/複号化方法を適用したメディアコンバータ の一例を示すブロック図であり、  FIG. 1 is a block diagram showing an example of a media converter to which an encryption / decryption method according to the present invention is applied.
第 2図は、 本発明の一実施形態による暗号化 Z復号化手法を採用したデータ 処理システムの概略的ブロック図であり、  FIG. 2 is a schematic block diagram of a data processing system employing an encryption Z decryption method according to an embodiment of the present invention.
第 3図は、 本発明の一実施形態による拡張データ付加動作の一例を示す流れ 図であり、  FIG. 3 is a flowchart showing an example of an extended data adding operation according to an embodiment of the present invention;
第 4図は、 拡張データの生成を説明するためのフォーマツト図であり、 第 5図は、 本発明の一実施形態による拡張データ削除動作の一例を示す流れ 図であり、  FIG. 4 is a format diagram for explaining generation of extension data, and FIG. 5 is a flowchart showing an example of an extension data deletion operation according to an embodiment of the present invention.
第 6図は、 第 1図の暗号化 Z復号ィ匕部 1 3のプロック図であり、  FIG. 6 is a block diagram of the encrypted Z decryption unit 13 of FIG.
第 7図は、 第 6図に示す暗号化/複号化処理部の暗号化/復号化の流れを示 す図である。 発明を実施するための最良の形態 Fig. 7 shows the flow of encryption / decryption of the encryption / decryption processing unit shown in Fig. 6. FIG. BEST MODE FOR CARRYING OUT THE INVENTION
1 . メディアコンバータ  1. Media Converter
第 1図は、 本発明による暗号化 Z復号化方法を適用したメディアコンバータ の一例を示すブロック図である。 メディアコンバータ 1 0の一対のポートには それぞれ物理層デバイス (P HY) 1 1および 1 2が設けられ、 一方の物理層 デバイス 1 1は U T Pケーブルに、他方の物理層デバイス 1 2は光ケーブルに、 それぞれ接続されている。 上述したように、 物理層デバイス 1 1および 1 2の 各々は、 I E E E 8 0 2 . 3によって規定された M I I (Media Independent Interface) をサホート l 'る。  FIG. 1 is a block diagram showing an example of a media converter to which an encryption Z decryption method according to the present invention is applied. A pair of ports of the media converter 10 are provided with physical layer devices (P HY) 11 and 12, respectively, one physical layer device 11 is connected to a UTP cable, the other physical layer device 12 is connected to an optical cable, Each is connected. As described above, each of the physical layer devices 11 and 12 supports the MII (Media Independent Interface) defined by IEEE 802.3.
物理層デバイス 1 1と物理層デバイス 1 2との間には、 F I F O (First in First out) メモリを含む暗号ィ匕/復号ィ匕部 1 3が設けられ、 後述するように、 送受信データの暗号化 Z復号化が行われる。 また、 F I F Oメモリによって送 受信間の周波数偏差を吸収することもできる。 たとえば、 一方の物理層デバイ スで受信された可変長データは F I F Oメモリに順次書き込まれ、 書き込まれ た順に読み出されて固定長データで暗号化処理された後、 他方の物理層デバイ スへ送出される。 逆に、 他方の物理層デバイスで受信された暗号化されたデー タは F I F Oメモリに順次書き込まれ、 書き込まれた順に読み出されて復号化 された後、 可変長データとして他方の物理層デバイスへ送出される。  Between the physical layer device 11 and the physical layer device 12, an encryption / decryption unit 13 including a FIFO (First in First out) memory is provided. Z decoding is performed. Further, the frequency deviation between transmission and reception can be absorbed by the FIFO memory. For example, variable-length data received by one physical layer device is sequentially written to the FIFO memory, read out in the order in which it was written, encrypted with fixed-length data, and then sent to the other physical layer device. Is done. Conversely, the encrypted data received by the other physical layer device is sequentially written to the FIFO memory, read out in the written order, decrypted, and then sent to the other physical layer device as variable-length data. Sent out.
なお、 本実施形態による暗号ィヒ/復号ィ匕部 1 3は特定用途向け集積回路 (A S I C) により構成され、 暗号ィ匕 復号化鍵の生成を含むメディアコンバータ 全体の動作制御も行う。  Note that the encryption / decryption unit 13 according to the present embodiment is configured by an application-specific integrated circuit (ASIC), and also controls the operation of the entire media converter including generation of the encryption / decryption key.
2 . 暗号化/複号化システムの構成  2. Configuration of encryption / decryption system
第 2図は、 本発明の一実施形態による暗号ィ匕/復号ィヒ手法を採用したデータ 処理システムの概略的ブロック図である。 第 2図において、 送信側は拡張データ付加部 1 0 1、 付加バイト長計算部 1 0 2、 および暗号化処理部 1 0 3を有し、 受信側は複号化処理部 1 0 4、 拡張 データ除去部 1 0 5、 および付加パイト長計算部 1 0 6を有する。 ここでは、 可変長データの長さを nバイト (nは自然数) とし、 暗号ィ匕処理部 1 0 3は固 定長 mバイト (mは 1以上の自然数) のデータのみを暗号ィ匕処理できるものと する。 FIG. 2 is a schematic block diagram of a data processing system employing an encryption / decryption method according to an embodiment of the present invention. In FIG. 2, the transmission side has an extension data addition unit 101, an additional byte length calculation unit 102, and an encryption processing unit 103, and the reception side has a decryption processing unit 104, It has a data removal unit 105 and an added bite length calculation unit 106. Here, the length of the variable-length data is assumed to be n bytes (n is a natural number), and the encryption processing unit 103 can perform encryption processing only on data having a fixed length of m bytes (m is a natural number of 1 or more). Shall be assumed.
拡張データ付加部 1 0 1は、 可変長 nバイトデータを入力すると、 可変長 n パイトデータが過不足なく暗号ィ匕処理部 1 0 3で処理されるようにデータを拡 張する。 まず、 拡張データ付加部 1 0 1は可変長 nパイトデータのデータ長 n を付加パイト長計算部 1 0 2へわたす。 付加バイト長計算部 1 0 2は、 n Zm の余りバイト数 rと付加バイト長 kとを計算して拡張データ付加部 1 0 1へか えす (詳しくは後述する)。  Upon input of the variable-length n-byte data, the extension data adding unit 101 expands the data so that the variable-length n-byte data is processed by the encryption unit 103 without any excess or shortage. First, the extension data adding unit 101 transfers the data length n of the variable length n bit data to the additional bit length calculation unit 102. The additional byte length calculation unit 102 calculates the number of remaining bytes r of n Zm and the additional byte length k and returns the result to the extension data addition unit 101 (details will be described later).
拡張データ付加部 1 0 1は、 所定位置に余りパイト数 rを含む kパイトの拡 張データを生成し、 それを可変長 nバイトデータの所定位置に付カ卩し、 (n + k ) バイトデータとして暗号化処理部 1 0 3へ出力する。 拡張データは、 可変 長 nバイトデータの最後尾に付加されるのが望ましい。 その際、 余りバイト数 rを表すデータが (n + k ) バイトデータの最後尾からどの位置に存在するか を特定する必要がある。 したがって、 望ましいのは、 余りバイト数 rを表すデ ータを (n + k ) バイトデータの最後尾に配置することである。  The extension data adding unit 101 generates extension data of k bits including the number of surplus pipes r at a predetermined position, attaches the extension data to a predetermined position of variable-length n-byte data, and adds (n + k) bytes The data is output to the encryption processing unit 103 as data. It is desirable that extension data be added to the end of variable-length n-byte data. At this time, it is necessary to specify where the data representing the number of remaining bytes r exists from the end of the (n + k) byte data. Therefore, it is desirable to place data representing the number of remaining bytes r at the end of (n + k) -byte data.
暗号化処理部 1 0 3は、 ( n + k )バイトデータを固定長 mバイトごとに分割 し、 分割された固定長 mパイトデータの各々に対して暗号ィ匕処理を実行する。 こうして処理された結果としてのデータは、 たとえば伝送路を通して受信側へ 送出される。  The encryption processing unit 103 divides the (n + k) -byte data into fixed-length m bytes, and performs an encryption process on each of the divided fixed-length m-byte data. The data as a result of the processing is transmitted to the receiving side through, for example, a transmission line.
受信側の復号化処理部 1 0 4は、 受信データに対して暗号ィヒ処理部 1 0 3の 処理とは逆の処理を施して固定長 mバイトデ一タを復号ィ匕し、 それらを合成し て (n + k ) バイトデータとして拡張データ除去部 1 0 5へ出力する。 拡張データ除去部 1 0 5は、 入力した (n + k ) パイトデータの所定位置か ら余りパイト数 rを読み出し、 付加バイト長計算部 1 0 6へわたす。 付加バイ ト長計算部 1 0 6は余りバイト数 rから付加されたパイト長 kを算出し、 拡張 データ除去部 1 0 5へかえす。拡張データ除去部 1 0 5は、 (n + k )バイトデ ータの所定位置から kバイト拡張データを除去し、 元の可変長 nバイトデータ を出力する。 The decryption processing unit 104 on the receiving side performs processing opposite to the processing of the encryption processing unit 103 on the received data to decrypt the fixed-length m-byte data, and combines them. Then, the data is output to the extended data removing unit 105 as (n + k) byte data. The extension data removal unit 105 reads the number of bits r remaining from a predetermined position of the input (n + k) byte data, and passes the number to the additional byte length calculation unit 106. The additional byte length calculation unit 106 calculates the added byte length k from the number of remaining bytes r, and returns it to the extended data removal unit 105. The extended data removing unit 105 removes the k-byte extended data from a predetermined position of the (n + k) -byte data, and outputs the original variable-length n-byte data.
3 . 拡張データの生成および付加  3. Generation and addition of extension data
第 3図は本発明の一実施形態による拡張データ付加動作の一例を示す流れ図 であり、 第 4図は拡張データの生成を説明するためのフォーマツト図である。 第 3図に示すように、 可変長 nバイトデータ 2 0 1のバイト数 nを入力する と、 付加バイト長計算部 1 0 2は nを mで除算した余り r (= nM〇D m) を 計算し、 暗号化処理部 1 0 3の固定長 mから当該余り rを差し引いた値を付加 バイト長 kとして算出する (ステップ S 2 0 )。  FIG. 3 is a flowchart showing an example of an extension data adding operation according to an embodiment of the present invention, and FIG. 4 is a format diagram for explaining generation of extension data. As shown in Fig. 3, when the number of bytes n of variable-length n-byte data 201 is input, the additional byte length calculation unit 102 calculates the remainder r (= nM〇D m) of dividing n by m. Then, a value obtained by subtracting the remainder r from the fixed length m of the encryption processing unit 103 is calculated as an additional byte length k (step S20).
第 4図を参照しながら、 固定長 m、 余りバイト長 rおよび付加バイト長 の 間の関係を説明する。 既に述べたように、 暗号ィ匕処理部 1 0 3は固定長 mバイ トしか受け付けないために、 可変長 nバイトデータ 2 0 1を固定長 mバイトご とに分割しなければならない。 その際、 rバイト (0≤r <m) の余りデータ が生じる場合がある。  The relationship among the fixed length m, the remaining byte length r, and the additional byte length will be described with reference to FIG. As described above, since the encryption processing unit 103 accepts only fixed-length m bytes, the variable-length n-byte data 201 must be divided into fixed-length m bytes. At that time, there may be r bytes (0≤r <m) of extra data.
この rバイトの余りデータも暗号化処理部 1 0 3で処理するために、 k (= m- r ) バイトの拡張データ 2 0 2を nバイトデータ 2 0 1の所定位置 (ここ では、最後尾)に付加する。 これによつて、固定長 mで割り切れるバイト長(n + k ) のデータ 2 0 5が得られる。  In order to process the remaining r bytes of data in the encryption processing unit 103, k (= m-r) bytes of the extended data 202 are added to the n-byte data 201 at a predetermined position (here, the last byte). ). As a result, data 205 having a byte length (n + k) divisible by the fixed length m is obtained.
拡張データ 2 0 2は最終的には除去されるから、 拡張データ 2 0 2の長さを 計算可能にする参照データを拡張データ 2 0 2に書き込んでおく必要がある。 本実施形態では、 参照データとして余りデータ長 rの値を拡張データ 2 0 2の 所定位置 (ここでは最後尾) に書き込んでおく。 たとえば、 固定長 mの範囲を 1 <m< 2 5 6とすれば、 rく mであるから、 余りデータ長 rを表すために 1バイト (≤2 5 5 ) のデータ領域を確保してお けば十分である。 Since the extension data 202 is eventually removed, it is necessary to write reference data to the extension data 202 so that the length of the extension data 202 can be calculated. In the present embodiment, the value of the remaining data length r is written as a reference data at a predetermined position (here, at the end) of the extension data 202. For example, if the range of the fixed length m is 1 <m <256, then r is m, so a data area of 1 byte (≤ 255) is reserved to represent the remaining data length r. It's enough.
こうして、 付加データ長計算部 1 0 2は余りデータ長 rと付加パイト長 kと を算出し、 拡張データ付加部 1 0 1へかえす。 拡張データ付加部 1 0 1は、 第 3図に示すように、 (k一 1 )バイトのパドル 2 0 3と 1バイトの参照データ 2 0 4とからなる kバイト拡張データ 2 0 2を生成し、 それを nバイトデータ 2 0 1の所定位置 (ここでは、 最後尾) に付加する (ステップ S 2 1 )。  Thus, the additional data length calculation unit 102 calculates the remaining data length r and the additional bit length k, and returns to the extended data addition unit 101. As shown in FIG. 3, the extension data addition unit 101 generates k-byte extension data 202 consisting of a (k-1) -byte paddle 203 and 1-byte reference data 204. Then, it is added to a predetermined position (here, at the end) of the n-byte data 201 (step S21).
これによつて、 固定長 mで割り切れるバイト長 (n + k ) のデータ 2 0 5が 暗号ィヒ処理部 1 0 3に与えられ、 (n + k ) /m個の固定長 mバイトデータに対 する分割処理が実行される (ステップ S 2 2 )。 このように、少量の拡張データ 2 0 2を付加するだけで、 可変長データ 2 0 1の固定長処理が可能となる。  As a result, data 205 having a byte length (n + k) divisible by the fixed length m is supplied to the encryption processing unit 103, and is converted into (n + k) / m fixed-length m-byte data. The division process is executed (step S22). Thus, the fixed-length processing of the variable-length data 201 can be performed only by adding a small amount of the extended data 202.
4 . 拡張データの削除  4. Delete extended data
第 5図は、 本発明の一実施形態による拡張データ削除動作の一例を示す流れ 図である。 まず、 複号化処理部 1 0 4は、 受信データに対して暗号ィ匕処理部 1 0 3の処理とは逆の処理を施して固定長 mバイトデータを復号し、 それらを合 成した (n + k ) ノイトデータ 2 0 5を拡張データ除去部 1 0 5へ出力する。 上述したように、 入力した (n + k ) バイトデータ 2 0 5の所定位置 (ここ では最後尾の 1バイト) には参照データとして余りバイト数 rが書き込まれて レ、る。 従って、 拡張データ除去部 1 0 5は、 最後尾の 1バイトのデータを読み 出し、 付加バイト長計算部 1 0 6へわたす。 付加バイト長計算部 1 0 6は、 固 定長 mから余りバイト数 rを差し引いて付加バイト長 k =m— rを算出し (ス テツプ S 2 3 )、 その値 kを拡張データ除去部 1 0 5へかえす。  FIG. 5 is a flowchart showing an example of an extended data deletion operation according to an embodiment of the present invention. First, the decryption processing section 104 performs processing opposite to the processing of the encryption processing section 103 on the received data to decrypt the fixed-length m-byte data and synthesizes them ( (n + k) The noise data 205 is output to the extended data removing unit 105. As described above, the remaining byte number r is written as reference data at a predetermined position (here, the last byte) of the input (n + k) byte data 205. Therefore, the extended data removing unit 105 reads out the last one byte of data and passes it to the additional byte length calculating unit 106. The additional byte length calculation unit 106 calculates the additional byte length k = m-r by subtracting the number of remaining bytes r from the fixed length m (step S23), and uses the value k as the extension data removal unit 1 0 Return to 5.
拡張データ除去部 1 0 5は、 (n + k )バイトデータ 2 0 5の最後尾の kパイ ト、すなわち拡張データ 2 0 2、 を除去し (ステップ S 2 4 )、オリジナルの可 変長 nバイトデータ 2 0 1を出力する。 このように、 固定長暗号ィ匕処理系から の出力データを元の可変長データに容易に復元する.ことができる。 The extension data removal unit 105 removes the last k bits of the (n + k) byte data 205, that is, the extension data 202 (step S24), and removes the original variable length n Outputs byte data 201. Thus, from the fixed-length encryption Output data can be easily restored to the original variable-length data.
5 . 実施例  5. Examples
以下、 具体例として、 送信すべきデータを D E S暗号化して送信し、 D E S 暗号化されたデータから受信データを復号するメディアコンパータについて説 明する。 この場合、 第 2図における暗号化処理部 1 0 3は D E S暗号ィ匕モジュ ールに対応し、 復号化処理部 1 0 4は D E S復号ィ匕モジュールに対応する。 第 6図は、 第 1図の暗号ィ匕/複号化部 1 3の詳細なブロック図である。 デー タ処理部 (図示せず) から出力された可変長バイトの送信データは、 物理層 3 0 0 aを通して入力 F I F O (First In First Out) メモリ 3 0 1に入力し、順次、 パドル付加モジュール 3 0 2へ出力される。  Hereinafter, as a specific example, a media converter that transmits data to be transmitted after encrypting the data and then decrypts the received data from the data that has been encrypted will be described. In this case, the encryption processing unit 103 in FIG. 2 corresponds to the DS encryption module, and the decryption processing unit 104 corresponds to the DS decryption module. FIG. 6 is a detailed block diagram of the encryption / decryption unit 13 of FIG. The variable-length transmission data output from the data processing unit (not shown) is input to an input FIFO (First In First Out) memory 301 through the physical layer 300a, and sequentially to the paddle addition module 3 Output to 02.
パドル付加モジュール 3 0 2は、 第 2図の拡張データ付加部 1 0 1およぴ付 加バイト長計算部 1 0 2に対応する。 パドル付加モジュール 3 0 2は、 入力し た nバイト送信データに kパイト拡張データを付加し、 (n + k )バイトデータ を暗号ィヒモジュール 3 0 3へ出力する。  The paddle addition module 302 corresponds to the extension data addition unit 101 and the addition byte length calculation unit 102 in FIG. The paddle addition module 302 adds k-bit extended data to the input n-byte transmission data, and outputs (n + k) -byte data to the encryption module 303.
暗号化モジュール 3 0 3では、 (n + k )バイトデータを固定長バイト mデー タごとに分割し、それぞれに対して暗号化キーに従った暗号化処理を実行する。 暗号^された (n + k ) バイトデータは出力 F I F Oメモリ 3 0 4を介して物 理層 3 0 0 bへ送出される。  The encryption module 303 divides (n + k) -byte data into fixed-length m-byte data and executes an encryption process on each of them according to the encryption key. The encrypted (n + k) byte data is sent to the physical layer 300b via the output FIFO memory 304.
物理層 3 0 0 bから受信したデータは、 順次、 入力 F I F Oメモリ 3 0 5を 介して復号ィヒモジュール 3 0 6に入力する。 復号化モジュール 3 0 6は、 暗号 ィ匕キーに従って、 受信したデータから固定長 mバイトデータを復号化し、 それ らを合成して (n + k ) バイトデータとしてパドル除去モジュール 3 0 7へ出 力する。  The data received from the physical layer 300 b is sequentially input to the decoding module 306 via the input FIFO memory 305. The decryption module 303 decrypts the fixed-length m-byte data from the received data according to the encryption key, combines them, and outputs the resultant data to the paddle removal module 3007 as (n + k) -byte data. I do.
パドル除去モジュール 3 0 7は、 第 2図の拡張データ除去部 1 0 5およぴ付 加バイト長計算部 1 0 6に対応する。 パドル除去モジュール 3 0 7は、 最後尾 の 1バイトのデータから付加パイト長 kを算出し、 (n + k )バイトデータの最 2/04314 The paddle removal module 307 corresponds to the extended data removal unit 105 and the added byte length calculation unit 106 in FIG. The paddle removal module 307 calculates the additional bit length k from the last one byte of data, and calculates the maximum length of (n + k) byte data. 2/04314
10 Ten
後尾の kパイトデータを除去して可変長 nバイトデータを生成し、 出力 F I F Oメモリ 308を通して物理層 300 aへ出力する。 The trailing k-bit data is removed to generate variable-length n-byte data, which is output to the physical layer 300a through the output FIFO memory 308.
なお、 送信部の入力 F I FOメモリ 301は、 物理層 300 a側の送信クロ ックと暗号化/複号化モジュールのク口ックとの位相差を吸収するために設け られ、 出力 F I FOメモリ 304は、 他方の物理層 300 b側の送信クロック と暗号ィヒノ復号ィ匕モジュールのク口ックとの位相差を吸収するために設けられ ている。 同様に、 受信部の入力 F I FOメモリ 305は、 物理層 30 O b側の 受信クロックと暗号化/復号化モジュールのクロックとの位相差を吸収するた めに設けられ、 出力 F I FOメモリ 308は、 物理層 300 a側の受信クロッ クと暗号化 Z復号化モジュールのクロックとの位相差を吸収するために設けら れている。  The input FI FO memory 301 of the transmission unit is provided to absorb the phase difference between the transmission clock of the physical layer 300a side and the clock of the encryption / decryption module. The memory 304 is provided to absorb a phase difference between the transmission clock on the other physical layer 300b side and the port of the encryption / decryption module. Similarly, the input FI FO memory 305 of the receiving unit is provided to absorb the phase difference between the reception clock of the physical layer 30 Ob and the clock of the encryption / decryption module, and the output FI FO memory 308 is provided. It is provided to absorb the phase difference between the reception clock on the physical layer 300a side and the clock of the encryption Z decryption module.
第 7図は、 第 6図に示す送受信部の暗号ィ匕 Z復号ィ匕の流れを示す図である。 ここでは、 DES暗号化モジュール 303の固定長バイト数 m= 8、 0≤ r < 8とし、可変長バイト数 n=67のデータを送受信する場合について説明する。 まず、 67バイトの送信データが入力すると (第 7図 (a))、 67バイト Z 8バイト =8余り 3であるから、 r = 3、 k=m— r = 5である(第 7図(b))。 したがって、 67バイトの送信データに、 末尾の 1バイトに r = 3を含む 5バ ィトのパドルデータ (0x0000000003) を付加して、 送信データを 72パイト に拡張する (第 7図 (c))。  FIG. 7 is a diagram showing the flow of encryption / decryption by the transmission / reception unit shown in FIG. Here, a case will be described where the fixed-length byte number m = 8 and 0 ≦ r <8 of the DES encryption module 303 and data with a variable-length byte number n = 67 are transmitted and received. First, when 67 bytes of transmission data is input (Fig. 7 (a)), r = 3, k = m-r = 5 since 67 bytes Z 8 bytes = 8 remainders 3 (Fig. 7 ( b)). Therefore, the 5-byte paddle data (0x0000000003) including r = 3 in the last byte is added to the 67-byte transmission data to extend the transmission data to 72 bytes (Fig. 7 (c)) .
続いて、 72バイトの拡張された送信データを 8パイト単位に分割し、 分割 された 9個の 8バイトデータを DES ECBモードによりそれぞれ暗号化す る (第 7図 (d))。 こうして、 72バイトの暗号化データが得られる (第 7図 (e))。 このように、 少量のパドルデータを付加するだけで、 可変長データの DES暗号化処理が可能となる。  Next, the extended transmission data of 72 bytes is divided into 8-byte units, and the 9 divided 8-byte data are respectively encrypted in the DES ECB mode (Fig. 7 (d)). In this way, 72 bytes of encrypted data are obtained (Fig. 7 (e)). Thus, DES encryption of variable-length data can be performed only by adding a small amount of paddle data.
他方、 このような暗号化データが受信されると、 DES復号化モジュール 3 06は 8バイトデータをそれぞれ復号ィ匕する (第 7図 (f))。 復号化された 8 バイトデータが合成されて 7 2パイトデータが得られ、 その最後の 1バイト (0x03) から付加パドル長 kが計算される。 ここでは、 k = 8— 3 = 5バイト であるから、 末尾の 5バイトのパドルデータ (0x0000000003) が 7 2バイト データから除去される (第 7図 (h) )。 こうして、 元の 6 7バイトデータを得 る (第 7図 (i ) )。 このように、 D E S暗号化データを元の可変長データに容 易に復元することができる。 On the other hand, when such encrypted data is received, the DES decryption module 303 decrypts each of the 8-byte data (FIG. 7 (f)). 8 decrypted The byte data is combined to obtain 72 bits of data, and the additional paddle length k is calculated from the last byte (0x03). Here, since k = 8-3 = 5 bytes, the last 5 bytes of paddle data (0x0000000003) are removed from the 72-byte data (Fig. 7 (h)). Thus, the original 67-byte data is obtained (Fig. 7 (i)). Thus, the DES encrypted data can be easily restored to the original variable length data.
なお、 本実施例では、 D E S暗号技術を一例として説明したが、 これに限定 されるものではない。 本発明は、 可変長の入力データに対する処理に固定長デ ータのみを受け入れる暗号ィ匕処理技術を使用する場合に適用することができる。 また、 第 2図に示す送信側の拡張データ付 部 1 0 1、 付加バイト長計算部 1 0 2、 および暗号化処理部 1 0 3、 あるいは受信側の復号ィ匕処理部 1 0 4、 拡張データ除去部 1 0 5、 および付加バイト長計算部 1 0 6は、 ハードウエア として構成することもできるが、 ソフトウェアにより実現することも可能であ る。 すなわち、 第 3図〜第 5図で説明した拡張データ生成、 付加および除去動 作をコンピュータに指令するプログラムをメモリに格納しておき、 各動作に対 応するプログラムをコンピュータ上で走らせることで同様の機能を実現できる。 以上説明したように、 本発明によれば、 可変長データを所定の固定長に分割 した際の余りデータ長を算出し、 固定長と余りデータ長との差を付加データ長 として決定する。 そして、 付加データ長を決定するための参照データを含めた 付加データを可変長データに付加することで、 固定長暗号化処理を実行可能な 拡張されたデータが生成される。 したがって、 少量の付加データを可変長デー タに付加するだけで、 可変長データの固定長暗号化処理が可能となる。  In the present embodiment, the DES encryption technology has been described as an example, but the present invention is not limited to this. INDUSTRIAL APPLICABILITY The present invention can be applied to a case where an encryption processing technique that accepts only fixed-length data is used for processing variable-length input data. Also, the extension data appending unit 101, additional byte length calculation unit 102, and encryption processing unit 103 on the transmission side, or the decryption processing unit 104 on the reception side, shown in FIG. The data removing unit 105 and the additional byte length calculating unit 106 can be configured as hardware, but can also be realized by software. That is, a program for instructing the computer to perform the operation of generating, adding, and removing extended data described in FIGS. 3 to 5 is stored in a memory, and a program corresponding to each operation is run on the computer. A similar function can be realized. As described above, according to the present invention, a surplus data length when dividing variable-length data into a predetermined fixed length is calculated, and a difference between the fixed length and the surplus data length is determined as an additional data length. Then, by adding the additional data including the reference data for determining the additional data length to the variable length data, extended data that can execute the fixed length encryption processing is generated. Therefore, only by adding a small amount of additional data to variable-length data, fixed-length encryption of variable-length data becomes possible.
また、 拡張されたデータから参照データを読み出して、 それに付加された付 加データ長を決定できるために、 拡張されたデータから付加データ長分のデー タを除去することで、 容易に元の可変長データを復元することができる。  In addition, since the reference data is read from the extended data and the additional data length added to the reference data can be determined, the original data can be easily changed by removing the additional data length from the extended data. Long data can be restored.
このように、 本発明は、 可変長データに対して、 入力が固定長となっている 暗号化処理を実行する場合にきわめて有効な手法である。 As described above, according to the present invention, the input has a fixed length for variable-length data. This is a very effective technique when performing encryption processing.

Claims

請 求 の 範 囲 1 . 異なる種類の伝送媒体を接続するメディアコンバータにおいて、 Scope of Claim 1. For media converters that connect different types of transmission media,
第 1伝送媒体を接続するための第 1物理層ィンタフェースと、  A first physical layer interface for connecting a first transmission medium,
第 2伝送媒体を接続するための第 2物理層ィンタフェースと、  A second physical layer interface for connecting a second transmission medium;
前記第 1及び第 2物理層ィンタフェースの間に接続され、 前記第 1物理層ィ ンタフヱースから入力する可変長データを所定の固定長データに変換して暗号 化し、 暗号ィ匕されたデータを前記第 2物理層インタフェースへ出力する暗号化 手段と、  Is connected between the first and second physical layer interfaces, converts the variable length data input from the first physical layer interface into predetermined fixed length data, encrypts the data, and encrypts the encrypted data. An encryption means for outputting to the second physical layer interface,
を有し、  Has,
前記暗号化手段は、  The encryption means,
前記可変長データを所定の固定長に分割した際の余りデータ長を算出し、 前 記固定長と前記余りデータ長との差を付加データ長として決定する演算手段と、 前記付加データ長を決定するための参照データを所定位置に含めた付加デー タを生成し、 前記可変長データに前記付加データを付加することで暗号化処理 が実行可能な拡張されたデータを生成する拡張データ付加手段と、  Calculating means for calculating a surplus data length when dividing the variable length data into a predetermined fixed length, and determining a difference between the fixed length and the surplus data length as an additional data length; and determining the additional data length. Extension data adding means for generating additional data including reference data for performing the encryption processing at a predetermined position, and adding the additional data to the variable-length data to generate extended data that can be encrypted. ,
前記拡張されたデ一タを前記暗号化処理することで前記暗号化されたデ一タ を生成する暗号化処理手段と、  Encryption processing means for generating the encrypted data by performing the encryption processing on the extended data;
を有することを特徴とするメディアコンバータ。  A media converter comprising:
2 . 前記第 1及び第 2物理層インタフェースの間に接続され、 前記第 2物理 層インタフヱースから入力する暗号化されたデ一タを復号ィ匕して可変長データ を生成し、前記第 1物理層ィンタフヱ一スへ出力する復号ィ匕手段をさらに有し、 前記複号化手段は、 2. Connected between the first and second physical layer interfaces, and decrypts encrypted data input from the second physical layer interface to generate variable-length data; Further comprising decoding means for outputting to the layer interface, wherein the decoding means,
前記暗号化されたデ一タを復号化して前記拡張されたデ一タに対応する受信 データを生成する復号化処理手段と、  Decryption processing means for decrypting the encrypted data to generate received data corresponding to the extended data;
前記受信データの前記所定位置から前記参照データを読み出し、 前記参照デ ータから前記付加データ長を決定し、 前記受信データから前記付加データ長に 相当するデータを除去する拡張データ除去手段と、 Reading the reference data from the predetermined position of the received data; Extension data removing means for determining the additional data length from data, and removing data corresponding to the additional data length from the received data;
を有することを特徴とする請求の範囲第 1項記載のメディアコンバータ。  2. The media converter according to claim 1, comprising:
3 . 前記拡張データ付加手段は、 前記参照データを前記拡張されたデータの 最後尾に配置することを特徴とする請求の範囲第 1項記载のメディァコンパー タ。 3. The media converter according to claim 1, wherein the extension data adding means arranges the reference data at the end of the extension data.
4 . 前記暗号化処理手段は、 前記拡張されたデータを前記固定長ごとに分割 し、 固定長データをそれぞれ暗号化することを特徴とする請求の範囲第 1項記 載のメディアコンバータ。  4. The media converter according to claim 1, wherein the encryption processing means divides the extended data for each fixed length and encrypts the fixed length data.
5 . 種類の異なる第 1伝送媒体及び第 2伝送媒体を接続するメディアコンバ ータにおける可変長データの暗号化方法において、 5. A method for encrypting variable-length data in a media converter that connects different types of first transmission medium and second transmission medium,
a )前記可変長データを所定の固定長に分割した際の余りデータ長を算出し、 b ) 前記固定長と前記余りデータ長との差を付加データ長として決定し、 c ) 前記付加データ長を決定するための参照データを含めた付加データを生 成し、  a) calculating the remaining data length when dividing the variable length data into a predetermined fixed length, b) determining the difference between the fixed length and the remaining data length as an additional data length, c) the additional data length Generate additional data, including reference data for determining
d ) 前記可変長データに前記付加データを付加することで暗号化処理が実行 可能な拡張されたデータを生成し、  d) generating extended data that can be encrypted by adding the additional data to the variable-length data;
e ) 前記拡張されたデ一タを前記固定長ごとに暗号化する、  e) encrypting the extended data for each of the fixed lengths;
ことを特徴とするメディアコンバータにおける暗号化方法。  An encryption method in a media converter.
6 . 前記付加データの予め定められた位置に前記参照データを配置し、 前記 可変長データの予め定められた位置に前記付加データを配置する、 ことを特徴 とする請求の範囲第 5項記載のメディァコンバータにおける暗号化方法。 6. The method according to claim 5, wherein the reference data is arranged at a predetermined position of the additional data, and the additional data is arranged at a predetermined position of the variable length data. Encryption method in media converter.
7 . 前記参照データを前記拡張されたデータの最後尾に配置することを特徴 とする請求の範囲第 6項記載のメディアコンバータにおける暗号ィヒ方法。  7. The encryption method in a media converter according to claim 6, wherein the reference data is arranged at the end of the extended data.
8 . 前記参照データは前記余りデータ長であることを特徴とする請求の範囲 第 5項記載のメディアコンパータにおける暗号^ ί匕方法。 8. The method according to claim 5, wherein the reference data is the remaining data length.
9 . 請求の範囲第 5項記載の暗号化方法により生成された暗号化データの復 号化方法において、 9. In the method for decrypting encrypted data generated by the encryption method according to claim 5,
a ) 前記暗号化データを受信し、  a) receiving the encrypted data;
b ) 前記受信した暗号化データに対して複号化処理を実行することで受信デ ータを生成し、  b) generating received data by performing a decryption process on the received encrypted data;
c ) 前記受信データの所定位置から参照データを読み出し、  c) reading reference data from a predetermined position of the received data,
d ) 前記参照データから付加データ長を決定し、  d) determining an additional data length from the reference data,
e ) 前記受信データから前記付加データ長に相当するデータを除去すること で元の可変長データを復元する、  e) restoring the original variable length data by removing data corresponding to the additional data length from the received data,
ことを特徴とするメディアコンバータにおける復号化方法。  A decoding method in a media converter.
1 0 . 前記参照データを前記拡張されたデータの最後尾に配置することを特 徴とする請求の範囲第 9項記載のメディァコンパータにおける復号化方法。 10. The decoding method in the media converter according to claim 9, wherein said reference data is arranged at the end of said extended data.
1 1 . 前記参照データは前記余りデータ長であることを特徴とする請求の範 囲第 9項記載のメディァコンバータにおける復号化方法。 11. The decoding method in the media converter according to claim 9, wherein the reference data is the remaining data length.
1 2 . 種類の異なる第 1伝送媒体及び第 2伝送媒体を接続するメディアコン バータにおけるコンピュータに、 n ( nは自然数) バイ トの可変長データを固 定長 m ( 0 < m< n ) バイト単位で暗号化する処理を実行させるためのプログ ラムにおいて、 1 2. The computer in the media converter that connects the first transmission medium and the second transmission medium of different types transmits n (n is a natural number) variable-length data to a fixed length m (0 <m <n) bytes. In the program for executing the process of encrypting in units,
n/mの余り rを算出するステップと、  calculating the remainder r of n / m;
前記固定長 mと前記余り rとの差を付加データ長 kとして決定するステップ と、  Determining the difference between the fixed length m and the remainder r as an additional data length k;
前記付加データ長 kを特定するための参照データ rを含めた付加データを生 成するステップと、  Generating additional data including reference data r for specifying the additional data length k;
前記可変長データに前記付加データを付加することで (n + k ) バイ トの拡 張されたデータを生成するステップと、  Generating (n + k) bytes of extended data by adding the additional data to the variable length data;
前記 ( n + k ) バイ トの拡張されたデータを前記固定長 mごとに分割して暗 号化するステップと、 The (n + k) -byte expanded data is divided into the fixed Encrypting;
を有することを特徴とするプロダラム。  A program characterized by having:
1 3 . 請求の範囲第 1 2項に記載された暗号化データを復号化し、 元の可変 長データを復元させる処理を実行させるためのプログラムにおいて、 13. A program for executing a process of decrypting the encrypted data described in claim 12 and restoring the original variable-length data,
前記暗号化データを復号化することで、前記拡張されたデ一タに対応する( n + k ) バイトの受信データを生成するステップと、  Generating (n + k) bytes of received data corresponding to the extended data by decrypting the encrypted data;
前記 ( n + k ) バイトの受信データの前記所定位置から前記参照データを読 み出し、 前記参照データから前記付加データ長 kを決定するステップと、 前記 ( n + k ) バイトの受信データから前記付加データ長 kに相当するデー タを除去することで、 元の nバイトの可変長データを復元するステップと、 を有することを特徴とするプログラム。  Reading the reference data from the predetermined position of the (n + k) -byte received data, and determining the additional data length k from the reference data; and Reconstructing the original n-byte variable length data by removing data corresponding to the additional data length k.
PCT/JP2002/004314 2002-03-25 2002-04-30 Method and apparatus for encryption/decryption in a medium converter WO2003094419A1 (en)

Priority Applications (8)

Application Number Priority Date Filing Date Title
PCT/JP2002/004314 WO2003094419A1 (en) 2002-04-30 2002-04-30 Method and apparatus for encryption/decryption in a medium converter
AU2002253659A AU2002253659A1 (en) 2002-04-30 2002-04-30 Method and apparatus for encryption/decryption in a medium converter
JP2004502533A JPWO2003094419A1 (en) 2002-04-30 2002-04-30 Encryption / decryption method and apparatus in media converter
US10/307,400 US20030179882A1 (en) 2002-03-25 2002-12-02 Variable-length/fixed-length data conversion method and apparatus
TW092105884A TWI224896B (en) 2002-03-25 2003-03-18 Variable-length/fixed-length data conversion method and apparatus
DE2003113016 DE10313016A1 (en) 2002-03-25 2003-03-24 Method and apparatus for converting between variable and fixed length data
GB0306838A GB2387091A (en) 2002-03-25 2003-03-25 Variable-length/fixed-length data conversion
CN03130794.9A CN1455557A (en) 2002-03-25 2003-03-25 Changeable length/fixed length data conversion method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2002/004314 WO2003094419A1 (en) 2002-04-30 2002-04-30 Method and apparatus for encryption/decryption in a medium converter

Publications (1)

Publication Number Publication Date
WO2003094419A1 true WO2003094419A1 (en) 2003-11-13

Family

ID=29287938

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2002/004314 WO2003094419A1 (en) 2002-03-25 2002-04-30 Method and apparatus for encryption/decryption in a medium converter

Country Status (3)

Country Link
JP (1) JPWO2003094419A1 (en)
AU (1) AU2002253659A1 (en)
WO (1) WO2003094419A1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001086073A (en) * 1999-09-09 2001-03-30 Fujikura Ltd Optical transmission system and optical transmitter

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001086073A (en) * 1999-09-09 2001-03-30 Fujikura Ltd Optical transmission system and optical transmitter

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DAVIES D.W. AND PRICE W.L., TRANSLATED UNDER THE SUPERVISION OF TADAHIRO UEZONO: "Network Security", 5 December 1985, NIKKEI MAGUROUHIRU-SHA, pages: 87 - 90, XP002955693 *
SCHNEIER B.: "Applied Cryptography", 1996, JOHN WILEY & SONS, INC., article "Algorithm types and modes", pages: 189 - 191, XP002955694 *

Also Published As

Publication number Publication date
JPWO2003094419A1 (en) 2005-09-08
AU2002253659A1 (en) 2003-11-17

Similar Documents

Publication Publication Date Title
JP3746098B2 (en) Data encryption device
US7885404B2 (en) Cryptographic systems and methods supporting multiple modes
JP4486680B2 (en) Apparatus and method for performing RC4 encryption
KR100362458B1 (en) Cryptographic processing apparatus, cryptographic processing method, and recording medium recording cryptographic processing program for realizing high-speed crypographic processing without impairing security
US20110255689A1 (en) Multiple-mode cryptographic module usable with memory controllers
US7623660B1 (en) Method and system for pipelined decryption
US20030179882A1 (en) Variable-length/fixed-length data conversion method and apparatus
JPH11510036A (en) Decryption of retransmitted data in encrypted communication systems
JP2001086110A (en) Packet communication system for encrypted information
JP2006311383A (en) Data managing method, data management system and data managing device
KR100922728B1 (en) AES encryption and decryption apparatus and method
JP2008099243A (en) Error correction encoding device, error correction encoding method, and program
JP4191915B2 (en) Conversion device, encryption / decryption system, multistage conversion device, program, and information recording medium
WO2003094419A1 (en) Method and apparatus for encryption/decryption in a medium converter
JP4785471B2 (en) Common key encryption communication system
JP2011119985A (en) Encryption and decryption method
JP4685621B2 (en) Key generation apparatus, encryption apparatus, decryption apparatus, multiplicative knapsack cryptosystem, multiplicative knapsack cipher decryption method and program
GB2387091A (en) Variable-length/fixed-length data conversion
JP3202544B2 (en) Encryption communication device and encryption device
JP5084224B2 (en) Self-synchronous stream cipher encryption apparatus, decryption apparatus, self-synchronous stream cipher system, MAC generation apparatus, encryption method, decryption method, MAC generation method, and program
JP2001285281A (en) Encryption system
JP3473171B2 (en) Sequential encryption
WO2000064096A1 (en) Encrypted communication system
Babbage et al. Probabilistic factors in the sober-t stream ciphers
JP2006245733A (en) Encryption communication method, transmitting terminal, and receiving terminal

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2004502533

Country of ref document: JP

AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ OM PH PL PT RO RU SD SE SG SI SK SL TJ TM TN TR TT TZ UA UG UZ VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
122 Ep: pct application non-entry in european phase