JPWO2003094419A1 - Encryption / decryption method and apparatus in media converter - Google Patents
Encryption / decryption method and apparatus in media converter Download PDFInfo
- Publication number
- JPWO2003094419A1 JPWO2003094419A1 JP2004502533A JP2004502533A JPWO2003094419A1 JP WO2003094419 A1 JPWO2003094419 A1 JP WO2003094419A1 JP 2004502533 A JP2004502533 A JP 2004502533A JP 2004502533 A JP2004502533 A JP 2004502533A JP WO2003094419 A1 JPWO2003094419 A1 JP WO2003094419A1
- Authority
- JP
- Japan
- Prior art keywords
- data
- length
- additional
- byte
- encryption
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic 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/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0625—Block 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/12—Details relating to cryptographic hardware or logic circuitry
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
メディアコンバータに暗号化/復号化部を設ける。入力したnバイト可変長データ201を固定長mに分割した際の余りデータ長rを算出し、固定長mと余りデータ長rとの差を付加データ長kとして決定する。kバイト付加データ202をnバイト可変長データ201の最後尾に付加し、付加データ長を決定するための参照データを(n+k)バイトデータ205の最後尾に配置する。(n+k)バイトデータ205に対して暗号化を実行する。暗号化データの復号化は、参照データから付加データ長を決定し、それに応じたデータを削除することで元の可変長データを復元する。An encryption / decryption unit is provided in the media converter. The remainder data length r when the input n-byte variable length data 201 is divided into the fixed length m is calculated, and the difference between the fixed length m and the remainder data length r is determined as the additional data length k. The k-byte additional data 202 is added to the end of the n-byte variable length data 201, and reference data for determining the additional data length is arranged at the end of the (n + k) byte data 205. Encryption is performed on the (n + k) byte data 205. In decryption of encrypted data, the additional data length is determined from the reference data, and the original variable length data is restored by deleting the corresponding data.
Description
技術分野
本発明は異なる種類の伝送媒体を接続するためのメディアコンバータに係り、特にメディアコンバータにおける暗号化/復号化方法及び装置に関する。
背景技術
近年、各家庭まで光ファイバ回線をのばして、音楽や動画像、医療データなどを高速回線で自在にやり取りできるFTTH(Fiber To The Home)が話題を集めている。このようなFTTHが実現されると、光ファイバ回線をオフィスあるいは家庭内のコンピュータに接続するためのメディアコンバータが不可欠となる。
メディアコンバータには、一般に、光ケーブルを接続するためのポートとUTPケーブルを接続するためのポートとが設けられ、それぞれに物理層デバイスが接続されている。各物理層デバイスはIEEE802.3規格によって規定されたMII(Media Independent Interface)をサポートしている。また、メディアコンバータの性質上、一方のリンクが切断された場合に他方のリンクを自動的に切断するミッシングリング機能を有するものが一般的である。
このようなメディアコンバータを用いることで光ケーブルを介した長距離伝送が可能となる。たとえば、LAN(Local Area Network)のマネジメントスイッチをUTP(Unshielded Twisted Pair)ケーブルを用いてメディアコンバータの一方のポートに接続し、他方のポートに光ケーブルを接続する。相手側も同様に、メディアコンバータを用いて光ケーブルをUTPケーブルに変換し、マネジメントスイッチに接続する。こうして光通信回線を通してLAN同士が単一ドメインを構成することができる。
このような通信システムにおいて、光通信回線やLANにおけるセキュリティは重要な問題の1つである。そこで、データの暗号化/復号化機能をメディアコンバータに組み込むことが考えられている。
しかしながら、暗号技術の一つであるDES(Data Encryption Standard)暗号を使用して可変長nバイトのデータを暗号化する場合、DESへの入力を8バイト単位に分割しなければならない。この場合、nの値によっては分割する際に8バイト未満の余りが生じる。このために、その余り部分をDES入力可能な8バイトに拡張する技術が必要である。
従来、可変長データを固定長データに変換する技術は種々提案されている。例えば、特開平08−030437号公報には、可変長データを最適な固定長データに分割し複数の演算処理部で並列処理を行う計算機が開示されている。また、特開2001−332978号公報に開示されたデータストリーム変換方法では、可変長データをレジスタに転送し、そのレジスタのデータ量が所定ビットを超えたときに、固定長ビット数ごとに順次出力することで固定長データを生成する。最後にレジスタに残ったデータは、次の入力データと結合され、次回の固定長データとして出力される。
しかしながら、上記特開平08−030437号公報に開示された計算機では、可変長データの長さが固定長データの整数倍に設定されており、可変長データを分割したときに余りが生じることは想定されていない。
これに対して、上記特開2001−332978号公報には、可変長データを固定長データごとに分割出力した後にレジスタに残ったデータ(余り)の処理について言及されている。
しかしながら、この従来の方法は可変長データを固定長データのストリームとして出力することを目的としており、ある可変長データを一組として固定長データに分割し、それぞれの固定長データをデータ処理するわけではない。したがって、最後にレジスタに残ったデータを次の入力データと結合させることができ、次回の固定長データとして出力できるわけである。
本発明の目的は、可変長データを固定長データに変換して暗号化処理を行うメディアコンバータにおける暗号化/復号化方法及び装置を提供することにある。
本発明の他の目的は、可変長データを固定長データに分割した際に余りが生じても各固定長データの効率的な暗号化処理を可能にする暗号化方法及び装置を提供することにある。
更に、本発明の別の目的は、可変長データの暗号化処理により得られたデータを容易に元の可変長データに復号化することができる復号化方法及び装置を提供することにある。
発明の開示
本発明の第1の観点によれば、可変長データを固定長処理するためにデータ変換する方法において、前記可変長データを所定の固定長に分割した際の余りデータ長を算出し、前記固定長と前記余りデータ長との差を付加データ長として決定し、前記付加データ長を決定するための参照データを含めた付加データを生成し、前記可変長データに前記付加データを付加することで前記固定長処理が実行可能な拡張されたデータを生成する、ことを特徴とする。
参照データは拡張されたデータの予め定められた位置に配置されることが望ましい。特に、参照データを拡張されたデータの最後尾に配置することが望ましい。
本発明の第2の観点によれば、可変長データを固定長処理することで得られたデータを前記可変長データに変換する方法において、前記可変長データを所定の固定長に分割した際の余りデータ長を算出し、前記固定長と前記余りデータ長との差を付加データ長として決定し、前記付加データ長を決定するための参照データを含む前記付加データ長の付加データを生成し、前記付加データを前記可変長データに付加し、前記参照データが所定位置に存在する拡張されたデータを生成し、前記拡張されたデータに対して前記固定長処理を実行することで固定処理結果データを生成し、前記固定処理結果データに対して前記固定処理とは逆の固定処理を実行することで、前記拡張されたデータに対応する受信データを生成し、前記受信データの前記所定位置から前記参照データを読み出し、前記参照データから前記付加データ長を決定し、前記受信データから前記付加データ長に相当するデータを除去することで、元の可変長データを復元する、ことを特徴とする。
前記固定長処理は、前記拡張されたデータを前記固定長ごとに分割し、固定長データをそれぞれ処理することを特徴とする。好ましくは、前記固定長処理は暗号化処理であり、前記逆の固定処理は前記暗号化処理に対応する復号化処理である。
発明を実施するための最良の形態
1.メディアコンバータ
第1図は、本発明による暗号化/復号化方法を適用したメディアコンバータの一例を示すブロック図である。メディアコンバータ10の一対のポートにはそれぞれ物理層デバイス(PHY)11および12が設けられ、一方の物理層デバイス11はUTPケーブルに、他方の物理層デバイス12は光ケーブルに、それぞれ接続されている。上述したように、物理層デバイス11および12の各々は、IEEE802.3によって規定されたMII(Media Independent Interface)をサポートする。
物理層デバイス11と物理層デバイス12との間には、FIFO(First in First out)メモリを含む暗号化/復号化部13が設けられ、後述するように、送受信データの暗号化/復号化が行われる。また、FIFOメモリによって送受信間の周波数偏差を吸収することもできる。たとえば、一方の物理層デバイスで受信された可変長データはFIFOメモリに順次書き込まれ、書き込まれた順に読み出されて固定長データで暗号化処理された後、他方の物理層デバイスへ送出される。逆に、他方の物理層デバイスで受信された暗号化されたデータはFIFOメモリに順次書き込まれ、書き込まれた順に読み出されて復号化された後、可変長データとして他方の物理層デバイスへ送出される。
なお、本実施形態による暗号化/復号化部13は特定用途向け集積回路(ASIC)により構成され、暗号化/復号化鍵の生成を含むメディアコンバータ全体の動作制御も行う。
2.暗号化/復号化システムの構成
第2図は、本発明の一実施形態による暗号化/復号化手法を採用したデータ処理システムの概略的ブロック図である。
第2図において、送信側は拡張データ付加部101、付加バイト長計算部102、および暗号化処理部103を有し、受信側は復号化処理部104、拡張データ除去部105、および付加バイト長計算部106を有する。ここでは、可変長データの長さをnバイト(nは自然数)とし、暗号化処理部103は固定長mバイト(mは1以上の自然数)のデータのみを暗号化処理できるものとする。
拡張データ付加部101は、可変長nバイトデータを入力すると、可変長nバイトデータが過不足なく暗号化処理部103で処理されるようにデータを拡張する。まず、拡張データ付加部101は可変長nバイトデータのデータ長nを付加バイト長計算部102へわたす。付加バイト長計算部102は、n/mの余りバイト数rと付加バイト長kとを計算して拡張データ付加部101へかえす(詳しくは後述する)。
拡張データ付加部101は、所定位置に余りバイト数rを含むkバイトの拡張データを生成し、それを可変長nバイトデータの所定位置に付加し、(n+k)バイトデータとして暗号化処理部103へ出力する。拡張データは、可変長nバイトデータの最後尾に付加されるのが望ましい。その際、余りバイト数rを表すデータが(n+k)バイトデータの最後尾からどの位置に存在するかを特定する必要がある。したがって、望ましいのは、余りバイト数rを表すデータを(n+k)バイトデータの最後尾に配置することである。
暗号化処理部103は、(n+k)バイトデータを固定長mバイトごとに分割し、分割された固定長mバイトデータの各々に対して暗号化処理を実行する。こうして処理された結果としてのデータは、たとえば伝送路を通して受信側へ送出される。
受信側の復号化処理部104は、受信データに対して暗号化処理部103の処理とは逆の処理を施して固定長mバイトデータを復号化し、それらを合成して(n+k)バイトデータとして拡張データ除去部105へ出力する。
拡張データ除去部105は、入力した(n+k)バイトデータの所定位置から余りバイト数rを読み出し、付加バイト長計算部106へわたす。付加バイト長計算部106は余りバイト数rから付加されたバイト長kを算出し、拡張データ除去部105へかえす。拡張データ除去部105は、(n+k)バイトデータの所定位置からkバイト拡張データを除去し、元の可変長nバイトデータを出力する。
3.拡張データの生成および付加
第3図は本発明の一実施形態による拡張データ付加動作の一例を示す流れ図であり、第4図は拡張データの生成を説明するためのフォーマット図である。
第3図に示すように、可変長nバイトデータ201のバイト数nを入力すると、付加バイト長計算部102はnをmで除算した余りr(=nMODm)を計算し、暗号化処理部103の固定長mから当該余りrを差し引いた値を付加バイト長kとして算出する(ステップS20)。
第4図を参照しながら、固定長m、余りバイト長rおよび付加バイト長kの間の関係を説明する。既に述べたように、暗号化処理部103は固定長mバイトしか受け付けないために、可変長nバイトデータ201を固定長mバイトごとに分割しなければならない。その際、rバイト(0≦r<m)の余りデータが生じる場合がある。
このrバイトの余りデータも暗号化処理部103で処理するために、k(=m−r)バイトの拡張データ202をnバイトデータ201の所定位置(ここでは、最後尾)に付加する。これによって、固定長mで割り切れるバイト長(n+k)のデータ205が得られる。
拡張データ202は最終的には除去されるから、拡張データ202の長さを計算可能にする参照データを拡張データ202に書き込んでおく必要がある。本実施形態では、参照データとして余りデータ長rの値を拡張データ202の所定位置(ここでは最後尾)に書き込んでおく。
たとえば、固定長mの範囲を1<m<256とすれば、r<mであるから、余りデータ長rを表すために1バイト(≦255)のデータ領域を確保しておけば十分である。
こうして、付加データ長計算部102は余りデータ長rと付加バイト長kとを算出し、拡張データ付加部101へかえす。拡張データ付加部101は、第3図に示すように、(k−1)バイトのパドル203と1バイトの参照データ204とからなるkバイト拡張データ202を生成し、それをnバイトデータ201の所定位置(ここでは、最後尾)に付加する(ステップS21)。
これによって、固定長mで割り切れるバイト長(n+k)のデータ205が暗号化処理部103に与えられ、(n+k)/m個の固定長mバイトデータに対する分割処理が実行される(ステップS22)。このように、少量の拡張データ202を付加するだけで、可変長データ201の固定長処理が可能となる。
4.拡張データの削除
第5図は、本発明の一実施形態による拡張データ削除動作の一例を示す流れ図である。まず、復号化処理部104は、受信データに対して暗号化処理部103の処理とは逆の処理を施して固定長mバイトデータを復号し、それらを合成した(n+k)バイトデータ205を拡張データ除去部105へ出力する。
上述したように、入力した(n+k)バイトデータ205の所定位置(ここでは最後尾の1バイト)には参照データとして余りバイト数rが書き込まれている。従って、拡張データ除去部105は、最後尾の1バイトのデータを読み出し、付加バイト長計算部106へわたす。付加バイト長計算部106は、固定長mから余りバイト数rを差し引いて付加バイト長k=m−rを算出し(ステップS23)、その値kを拡張データ除去部105へかえす。
拡張データ除去部105は、(n+k)バイトデータ205の最後尾のkバイト、すなわち拡張データ202、を除去し(ステップS24)、オリジナルの可変長nバイトデータ201を出力する。このように、固定長暗号化処理系からの出力データを元の可変長データに容易に復元することができる。
5.実施例
以下、具体例として、送信すべきデータをDES暗号化して送信し、DES暗号化されたデータから受信データを復号するメディアコンバータについて説明する。この場合、第2図における暗号化処理部103はDES暗号化モジュールに対応し、復号化処理部104はDES復号化モジュールに対応する。
第6図は、第1図の暗号化/復号化部13の詳細なブロック図である。データ処理部(図示せず)から出力された可変長バイトの送信データは、物理層300aを通して入力FIFO(First In First Out)メモリ301に入力し、順次、パドル付加モジュール302へ出力される。
パドル付加モジュール302は、第2図の拡張データ付加部101および付加バイト長計算部102に対応する。パドル付加モジュール302は、入力したnバイト送信データにkバイト拡張データを付加し、(n+k)バイトデータを暗号化モジュール303へ出力する。
暗号化モジュール303では、(n+k)バイトデータを固定長バイトmデータごとに分割し、それぞれに対して暗号化キーに従った暗号化処理を実行する。暗号化された(n+k)バイトデータは出力FIFOメモリ304を介して物理層300bへ送出される。
物理層300bから受信したデータは、順次、入力FIFOメモリ305を介して復号化モジュール306に入力する。復号化モジュール306は、暗号化キーに従って、受信したデータから固定長mバイトデータを復号化し、それらを合成して(n+k)バイトデータとしてパドル除去モジュール307へ出力する。
パドル除去モジュール307は、第2図の拡張データ除去部105および付加バイト長計算部106に対応する。パドル除去モジュール307は、最後尾の1バイトのデータから付加バイト長kを算出し、(n+k)バイトデータの最後尾のkバイトデータを除去して可変長nバイトデータを生成し、出力FIFOメモリ308を通して物理層300aへ出力する。
なお、送信部の入力FIFOメモリ301は、物理層300a側の送信クロックと暗号化/復号化モジュールのクロックとの位相差を吸収するために設けられ、出力FIFOメモリ304は、他方の物理層300b側の送信クロックと暗号化/復号化モジュールのクロックとの位相差を吸収するために設けられている。同様に、受信部の入力FIFOメモリ305は、物理層300b側の受信クロックと暗号化/復号化モジュールのクロックとの位相差を吸収するために設けられ、出力FIFOメモリ308は、物理層300a側の受信クロックと暗号化/復号化モジュールのクロックとの位相差を吸収するために設けられている。
第7図は、第6図に示す送受信部の暗号化/復号化の流れを示す図である。ここでは、DES暗号化モジュール303の固定長バイト数m=8、0≦r<8とし、可変長バイト数n=67のデータを送受信する場合について説明する。
まず、67バイトの送信データが入力すると(第7図(a))、67バイト/8バイト=8余り3であるから、r=3、k=m−r=5である(第7図(b))。したがって、67バイトの送信データに、末尾の1バイトにr=3を含む5バイトのパドルデータ(0x0000000003)を付加して、送信データを72バイトに拡張する(第7図(c))。
続いて、72バイトの拡張された送信データを8バイト単位に分割し、分割された9個の8バイトデータをDES ECBモードによりそれぞれ暗号化する(第7図(d))。こうして、72バイトの暗号化データが得られる(第7図(e))。このように、少量のパドルデータを付加するだけで、可変長データのDES暗号化処理が可能となる。
他方、このような暗号化データが受信されると、DES復号化モジュール306は8バイトデータをそれぞれ復号化する(第7図(f))。復号化された8バイトデータが合成されて72バイトデータが得られ、その最後の1バイト(0x03)から付加パドル長kが計算される。ここでは、k=8−3=5バイトであるから、末尾の5バイトのパドルデータ(0x0000000003)が72バイトデータから除去される(第7図(h))。こうして、元の67バイトデータを得る(第7図(i))。このように、DES暗号化データを元の可変長データに容易に復元することができる。
なお、本実施例では、DES暗号技術を一例として説明したが、これに限定されるものではない。本発明は、可変長の入力データに対する処理に固定長データのみを受け入れる暗号化処理技術を使用する場合に適用することができる。
また、第2図に示す送信側の拡張データ付加部101、付加バイト長計算部102、および暗号化処理部103、あるいは受信側の復号化処理部104、拡張データ除去部105、および付加バイト長計算部106は、ハードウエアとして構成することもできるが、ソフトウエアにより実現することも可能である。すなわち、第3図〜第5図で説明した拡張データ生成、付加および除去動作をコンピュータに指令するプログラムをメモリに格納しておき、各動作に対応するプログラムをコンピュータ上で走らせることで同様の機能を実現できる。
以上説明したように、本発明によれば、可変長データを所定の固定長に分割した際の余りデータ長を算出し、固定長と余りデータ長との差を付加データ長として決定する。そして、付加データ長を決定するための参照データを含めた付加データを可変長データに付加することで、固定長暗号化処理を実行可能な拡張されたデータが生成される。したがって、少量の付加データを可変長データに付加するだけで、可変長データの固定長暗号化処理が可能となる。
また、拡張されたデータから参照データを読み出して、それに付加された付加データ長を決定できるために、拡張されたデータから付加データ長分のデータを除去することで、容易に元の可変長データを復元することができる。
このように、本発明は、可変長データに対して、入力が固定長となっている暗号化処理を実行する場合にきわめて有効な手法である。
【図面の簡単な説明】
第1図は、本発明による暗号化/復号化方法を適用したメディアコンバータの一例を示すブロック図であり、
第2図は、本発明の一実施形態による暗号化/復号化手法を採用したデータ処理システムの概略的ブロック図であり、
第3図は、本発明の一実施形態による拡張データ付加動作の一例を示す流れ図であり、
第4図は、拡張データの生成を説明するためのフォーマット図であり、
第5図は、本発明の一実施形態による拡張データ削除動作の一例を示す流れ図であり、
第6図は、第1図の暗号化/復号化部13のブロック図であり、
第7図は、第6図に示す暗号化/復号化処理部の暗号化/復号化の流れを示す図である。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.
BACKGROUND ART In recent years, FTTH (Fiber To The Home) has been attracting attention because it can extend an optical fiber line to each home and freely exchange music, moving images, medical data, etc. via a high-speed line. When such FTTH is realized, a media converter for connecting an optical fiber line to a computer in an office or home becomes indispensable.
In general, a media converter is provided with a port for connecting an optical cable and a port for connecting a UTP cable, and a physical layer device is connected to each port. Each physical layer device supports MII (Media Independent Interface) defined by the IEEE 802.3 standard. Also, due to the nature of the media converter, it is common to have a missing ring function that automatically disconnects the other link when one link is disconnected.
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 also converts the optical cable into a UTP cable using a media converter and connects it to the management switch. Thus, the LANs can form a single domain through the optical communication line.
In such a communication system, security in an optical communication line or a LAN is one of important problems. Thus, it is considered to incorporate a data encryption / decryption function into a media converter.
However, when data of variable length n bytes is encrypted using DES (Data Encryption Standard) encryption, which is one of encryption techniques, the input to DES must be divided into units of 8 bytes. In this case, a remainder of less than 8 bytes occurs when dividing depending on the value of n. For this purpose, a technique for extending the remainder to 8 bytes capable of DES input is required.
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 optimum fixed-length data and performs parallel processing using a plurality of arithmetic processing units. In addition, in the data stream conversion method disclosed in Japanese Patent Laid-Open No. 2001-332978, variable length data is transferred to a register, and when the amount of data in the register exceeds a predetermined bit, it is sequentially output for each fixed length bit number. To generate fixed-length data. Finally, the data remaining in the register is combined with the next input data and output as the next fixed length data.
However, in the computer disclosed in the above-mentioned Japanese Patent Application Laid-Open No. 08-030437, it is assumed that the length of the variable length data is set to an integral multiple of the fixed length data, and a remainder is generated when the variable length data is divided. It has not been.
On the other hand, Japanese Patent Laid-Open No. 2001-332978 mentions processing of data (residue) remaining in a register after variable length data is divided and output for each fixed length data.
However, this conventional method is intended to output variable-length data as a stream of fixed-length data. The variable-length data is divided into fixed-length data as a set, and each fixed-length data is processed. is not. Therefore, the last data remaining in the register can be combined with the next input data, and can be 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 performs encryption processing by converting variable-length data into fixed-length data.
Another object of the present invention is to provide an encryption method and apparatus that enables efficient encryption processing of each fixed-length data even when a remainder occurs when variable-length data is divided into fixed-length data. is there.
Furthermore, another object of the present invention is to provide a decryption method and apparatus capable of easily decrypting data obtained by encryption processing of variable length data into original variable length data.
DISCLOSURE OF THE INVENTION According to a first aspect of the present invention, in a data conversion method for processing variable length data to a fixed length, a remainder data length when the variable length data is divided into a predetermined fixed length is calculated. The difference between the fixed length and the remainder data length is determined as an additional data length, additional data including reference data for determining the additional data length is generated, and the additional data is added to the variable length data. In this way, expanded data that can execute the fixed-length processing is generated.
The reference data is preferably arranged at a predetermined position of the expanded data. In particular, it is desirable to place the reference data at the end of the expanded data.
According to a second aspect of the present invention, in a method for converting data obtained by fixed length processing of variable length data into the variable length data, the variable length data is divided into a predetermined fixed length. Calculating a remainder data length, determining a difference between the fixed length and the remainder data length as an additional data length, and generating additional data of the additional data length including reference data for determining the additional data length; Fixed processing result data by adding the additional data to the variable length data, generating expanded data in which the reference data exists at a predetermined position, and executing the fixed length processing on the expanded data And generating the reception data corresponding to the expanded data by executing a fixed process opposite to the fixed process on the fixed process result data, and generating the received data Reading the reference data from a fixed position, determining the additional data length from the reference data, and removing the data corresponding to the additional data length from the received data, thereby restoring the original variable length data; Features.
The fixed-length processing is characterized in that the extended data is divided into fixed lengths and 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.
BEST MODE FOR CARRYING OUT THE INVENTION 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. A pair of ports of the
An encryption /
Note that the encryption /
2. Configuration of Encryption / Decryption System FIG. 2 is a schematic block diagram of a data processing system employing an encryption / decryption technique according to an embodiment of the present invention.
In FIG. 2, the transmission side has an extended
When the variable length n-byte data is input, the extension
The extension
The
The
The extended
3. Generation and Addition of Extension Data FIG. 3 is a flowchart showing an example of an extension data addition 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 the variable-length n-
The relationship among the fixed length m, the extra byte length r, and the additional byte length k will be described with reference to FIG. As already described, since the
In order to process the remaining r bytes of data by the
Since the
For example, if the range of the fixed length m is 1 <m <256, then r <m. Therefore, it is sufficient to secure a data area of 1 byte (≦ 255) to represent the remainder data length r. .
In this way, the additional data
As a result, byte length (n + k)
4). Extension Data Deletion FIG. 5 is a flowchart showing an example of an extension data deletion operation according to an embodiment of the present invention. First, the
As described above, the surplus number of bytes r is written as reference data at a predetermined position (here, the last one byte) of the input (n + k)
The extended
5. Embodiments As a specific example, a media converter that transmits data to be transmitted after DES encryption and decrypts received data from the DES encrypted data will be described. In this case, the
FIG. 6 is a detailed block diagram of the encryption /
The
The
The data received from the physical layer 300b is sequentially input to the
The
The
FIG. 7 is a diagram showing a flow of encryption / decryption of the transmission / reception unit shown in FIG. Here, a case will be described in which the fixed-length byte count m = 8 and 0 ≦ r <8 of the
First, when 67 bytes of transmission data is input (FIG. 7A), since 67 bytes / 8 bytes =
Subsequently, the 72-byte extended transmission data is divided into units of 8 bytes, and the divided 9 pieces of 8-byte data are respectively encrypted in the DES ECB mode (FIG. 7 (d)). Thus, 72-byte encrypted data is obtained (FIG. 7 (e)). In this way, variable length data DES encryption processing can be performed only by adding a small amount of paddle data.
On the other hand, when such encrypted data is received, the
In the present embodiment, the DES encryption technique has been described as an example, but the present invention is not limited to this. The present invention can be applied to the case of using an encryption processing technique that accepts only fixed-length data for processing variable-length input data.
Further, the transmission side extended
As described above, according to the present invention, the remainder data length when variable length data is divided into a predetermined fixed length is calculated, and the difference between the fixed length and the remainder data length is determined as the 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 capable of executing the fixed length encryption process is generated. Therefore, it is possible to perform fixed-length encryption processing of variable-length data only by adding a small amount of additional data to variable-length data.
In addition, since it is possible to read the reference data from the expanded data and determine the additional data length added to it, the original variable length data can be easily removed by removing the additional data length data from the expanded data. Can be restored.
As described above, the present invention is a very effective technique for executing encryption processing in which the input has a fixed length for variable length data.
[Brief description of the drawings]
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 / decryption technique according to an embodiment of the present invention.
FIG. 3 is a flowchart showing an example of the extended data adding operation according to the 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 extended data deletion operation according to an embodiment of the present invention.
FIG. 6 is a block diagram of the encryption /
FIG. 7 is a diagram showing the flow of encryption / decryption of the encryption / decryption processing unit shown in FIG.
Claims (13)
第1伝送媒体を接続するための第1物理層インタフェースと、
第2伝送媒体を接続するための第2物理層インタフェースと、
前記第1及び第2物理層インタフェースの間に接続され、前記第1物理層インタフェースから入力する可変長データを所定の固定長データに変換して暗号化し、暗号化されたデータを前記第2物理層インタフェースへ出力する暗号化手段と、
を有し、
前記暗号化手段は、
前記可変長データを所定の固定長に分割した際の余りデータ長を算出し、前記固定長と前記余りデータ長との差を付加データ長として決定する演算手段と、
前記付加データ長を決定するための参照データを所定位置に含めた付加データを生成し、前記可変長データに前記付加データを付加することで暗号化処理が実行可能な拡張されたデータを生成する拡張データ付加手段と、
前記拡張されたデータを前記暗号化処理することで前記暗号化されたデータを生成する暗号化処理手段と、
を有することを特徴とするメディアコンバータ。In media converters that connect different types of transmission media,
A first physical layer interface for connecting a first transmission medium;
A second physical layer interface for connecting a second transmission medium;
Connected between the first and second physical layer interfaces, variable length data input from the first physical layer interface is converted into predetermined fixed length data and encrypted, and the encrypted data is converted into the second physical layer interface. Encryption means for outputting to the layer interface;
Have
The encryption means includes
A calculation means for calculating a remainder data length when the variable length data is divided into a predetermined fixed length, and determining a difference between the fixed length and the remainder data length as an additional data length;
Generate additional data including reference data for determining the additional data length in a predetermined position, and generate the expanded data that can be encrypted by adding the additional data to the variable length data. Extended data appending means;
Encryption processing means for generating the encrypted data by performing the encryption processing on the expanded data;
The media converter characterized by having.
前記復号化手段は、
前記暗号化されたデータを復号化して前記拡張されたデータに対応する受信データを生成する復号化処理手段と、
前記受信データの前記所定位置から前記参照データを読み出し、前記参照データから前記付加データ長を決定し、前記受信データから前記付加データ長に相当するデータを除去する拡張データ除去手段と、
を有することを特徴とする請求の範囲第1項記載のメディアコンバータ。Decryption connected between the first physical layer interface and the second physical layer interface, decrypting encrypted data input from the second physical layer interface to generate variable-length data, and outputting to the first physical layer interface Further comprising:
The decoding means includes
Decryption processing means for decrypting the encrypted data and generating received data corresponding to the expanded data;
An extended data removing unit that reads the reference data from the predetermined position of the received data, determines the additional data length from the reference data, and removes data corresponding to the additional data length from the received data;
The media converter according to claim 1, further comprising:
a)前記可変長データを所定の固定長に分割した際の余りデータ長を算出し、
b)前記固定長と前記余りデータ長との差を付加データ長として決定し、
c)前記付加データ長を決定するための参照データを含めた付加データを生成し、
d)前記可変長データに前記付加データを付加することで暗号化処理が実行可能な拡張されたデータを生成し、
e)前記拡張されたデータを前記固定長ごとに暗号化する、
ことを特徴とするメディアコンバータにおける暗号化方法。In a method of encrypting variable length data in a media converter connecting different types of first transmission medium and second transmission medium
a) calculating a remainder data length when the variable length data is divided into a predetermined fixed length;
b) determining a difference between the fixed length and the remainder data length as an additional data length;
c) generating additional data including reference data for determining the additional data length;
d) generating expanded data that can be encrypted by adding the additional data to the variable-length data;
e) encrypting the expanded data for each fixed length;
The encryption method in the media converter characterized by the above-mentioned.
a)前記暗号化データを受信し、
b)前記受信した暗号化データに対して復号化処理を実行することで受信データを生成し、
c)前記受信データの所定位置から参照データを読み出し、
d)前記参照データから付加データ長を決定し、
e)前記受信データから前記付加データ長に相当するデータを除去することで元の可変長データを復元する、
ことを特徴とするメディアコンバータにおける復号化方法。In the method for decrypting encrypted data generated by the encryption method according to claim 5,
a) receiving the encrypted data;
b) generating received data by executing a decryption process on the received encrypted data;
c) reading reference data from a predetermined position of the received data;
d) determining the additional data length from the reference data;
e) restoring the original variable length data by removing data corresponding to the additional data length from the received data;
The decoding method in the media converter characterized by the above-mentioned.
n/mの余りrを算出するステップと、
前記固定長mと前記余りrとの差を付加データ長kとして決定するステップと、
前記付加データ長kを特定するための参照データrを含めた付加データを生成するステップと、
前記可変長データに前記付加データを付加することで(n+k)バイトの拡張されたデータを生成するステップと、
前記(n+k)バイトの拡張されたデータを前記固定長mごとに分割して暗号化するステップと、
を有することを特徴とするプログラム。Processing for encrypting variable length data of n (n is a natural number) bytes in fixed length m (0 <m <n) byte unit in a computer in a media converter connecting different types of first transmission medium and second transmission medium In the program to execute
calculating a remainder r of n / m;
Determining a difference between the fixed length m and the remainder r as an additional data length k;
Generating additional data including reference data r for specifying the additional data length k;
Generating (n + k) byte extended data by adding the additional data to the variable length data;
Dividing the (n + k) byte extended data into the fixed length m and encrypting the data;
The program characterized by having.
前記暗号化データを復号化することで、前記拡張されたデータに対応する(n+k)バイトの受信データを生成するステップと、
前記(n+k)バイトの受信データの前記所定位置から前記参照データを読み出し、前記参照データから前記付加データ長kを決定するステップと、
前記(n+k)バイトの受信データから前記付加データ長kに相当するデータを除去することで、元のnバイトの可変長データを復元するステップと、
を有することを特徴とするプログラム。In a program for executing the process of decrypting the encrypted data described in claim 12 and restoring the original variable length data,
Generating (n + k) bytes of received data corresponding to the expanded data by decrypting the encrypted data;
Reading the reference data from the predetermined position of the received data of (n + k) bytes, and determining the additional data length k from the reference data;
Removing the data corresponding to the additional data length k from the received data of (n + k) bytes to restore the original n-byte variable length data;
The program characterized by having.
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 |
---|---|
JPWO2003094419A1 true JPWO2003094419A1 (en) | 2005-09-08 |
Family
ID=29287938
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004502533A Pending JPWO2003094419A1 (en) | 2002-04-30 | 2002-04-30 | Encryption / decryption method and apparatus in media converter |
Country Status (3)
Country | Link |
---|---|
JP (1) | JPWO2003094419A1 (en) |
AU (1) | AU2002253659A1 (en) |
WO (1) | WO2003094419A1 (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001086073A (en) * | 1999-09-09 | 2001-03-30 | Fujikura Ltd | Optical transmission system and optical transmitter |
-
2002
- 2002-04-30 JP JP2004502533A patent/JPWO2003094419A1/en active Pending
- 2002-04-30 AU AU2002253659A patent/AU2002253659A1/en not_active Abandoned
- 2002-04-30 WO PCT/JP2002/004314 patent/WO2003094419A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
AU2002253659A1 (en) | 2003-11-17 |
WO2003094419A1 (en) | 2003-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4486680B2 (en) | Apparatus and method for performing RC4 encryption | |
TW490968B (en) | Apparatus for encrypting data and cipher system | |
US7885404B2 (en) | Cryptographic systems and methods supporting multiple modes | |
CN104579646B (en) | Method, device and circuit that the limited monotonic transformation of clobber book and encryption and decryption thereof are applied | |
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 | |
US20060078108A1 (en) | Hardware-based encryption/decryption employing dual ported memory and fast table initialization | |
WO2021129470A1 (en) | Polynomial-based system and method for fully homomorphic encryption of binary data | |
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 | |
JPWO2003094419A1 (en) | Encryption / decryption method and apparatus in media converter | |
CN115412241A (en) | Fusion password security processor for realizing post-quantum password algorithm Kyber and Saber | |
JP4938430B2 (en) | Nonlinear function unit, stream cipher encryption apparatus, decryption apparatus, MAC generation apparatus, stream cipher encryption method, decryption method, MAC generation method, and program | |
JP4785471B2 (en) | Common key encryption communication system | |
JP2011119985A (en) | Encryption and decryption method | |
GB2387091A (en) | Variable-length/fixed-length data conversion | |
JP4819576B2 (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 | |
JP5415020B2 (en) | Stream cipher encryption apparatus, decryption apparatus, MAC generation apparatus, stream cipher encryption method, decryption method, MAC generation method, and program | |
CN110912679A (en) | Password device | |
JP2004180234A (en) | Encrypted packet processing system | |
JP3473171B2 (en) | Sequential encryption | |
JP5755600B2 (en) | Commitment system, common reference information generating device, commit generating device, commit receiving device, commitment method | |
JP2001285281A (en) | Encryption system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20040706 |