.\" @(#)des_crypt.3 2.1 88/08/11 4.0 RPCSRC; from 1.16 88/03/02 SMI; .\" .\" Taken from libc4 sources, which say: .\" Copyright (C) 1993 Eric Young - can be distributed under GPL. .\" .\" However, the above header line suggests that this file in fact is .\" Copyright Sun Microsystems, Inc (and is provided for unrestricted use, .\" see other Sun RPC sources). .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated Fri Jul 23 05:53:35 JST 2004 .\" by Yuichi SATO .\" .TH DES_CRYPT 3 2007-05-18 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- fast .\"O DES encryption des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED \- 高速な DES 暗号化 .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .\" Sun version .\" Sun の場合は .\" .B #include .B #include .LP .BI "int ecb_crypt(char *" key ", char *" data ", unsigned " datalen , .BI " unsigned " mode ); .LP .BI "int cbc_crypt(char *" key ", char *" data ", unsigned " datalen , .BI " unsigned " mode ", char *" ivec ); .LP .BI "void des_setparity(char *" key ); .LP .BI "int DES_FAILED(int " status ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O .BR ecb_crypt () .\"O and .\"O .BR cbc_crypt () .\"O implement the .\"O NBS .\"O DES .\"O (Data Encryption Standard). .BR ecb_crypt () と .BR cbc_crypt () は NBS DES (Data Encryption Standard, データ暗号化規格) を実装している。 .\"O These routines are faster and more general purpose than .\"O .BR crypt (3). これらのルーチンは .BR crypt (3) よりも高速でより一般的な目的に使用できる。 .\"O They also are able to utilize .\"O DES .\"O hardware if it is available. 利用可能であれば、これらのルーチンは DES ハードウェアを使用することもできる。 .\"O .BR ecb_crypt () .\"O encrypts in .\"O ECB .\"O (Electronic Code Book) .\"O mode, which encrypts blocks of data independently. .BR ecb_crypt () は ECB (Electronic Code Book) モードで暗号化する。 このモードでは (個々の) データのブロックを独立して暗号化する .\"O .BR cbc_crypt () .\"O encrypts in .\"O CBC .\"O (Cipher Block Chaining) .\"O mode, which chains together .\"O successive blocks. .BR cbc_crypt () は CBC (Cipher Block Chaining) モードで暗号化する。 このモードでは連続するブロックを互いに連鎖させて暗号化する。 .\"O CBC .\"O mode protects against insertions, deletions and .\"O substitutions of blocks. .\"O Also, regularities in the clear text will .\"O not appear in the cipher text. CBC はブロックの挿入・削除・置き換えから保護する。 また平文の規則性が暗号文に現れない。 .LP .\"O Here is how to use these routines. .\"O The first argument, .\"O .IR key , .\"O is the 8-byte encryption key with parity. これらのルーチンの使用法を示す。 第 1 引き数 .I key はパリティ付きの 8 バイトの暗号化鍵である。 .\"O To set the key's parity, which for .\"O DES .\"O is in the low bit of each byte, use .\"O .BR des_setparity (). 鍵のパリティを設定するには .BR des_setparity () を使うこと。 DES の場合、鍵のパリティは各バイトの最下位ビットである。 .\"O The second argument, .\"O .IR data , .\"O contains the data to be encrypted or decrypted. 第 2 引き数 .I data は暗号化または復号化されるデータを含む。 .\"O The .\"O third argument, .\"O .IR datalen , .\"O is the length in bytes of .\"O .IR data , .\"O which must be a multiple of 8. 第 3 引き数 .I datalen は .I data のバイト長であり、8 の倍数でなければならない。 .\"O The fourth argument, .\"O .IR mode , .\"O is formed by .\"O OR'ing .\"O together some things. 第 4 引き数 .I mode はいくつかの値を OR することで作成する。 .\"O For the encryption direction OR in either .\"O .BR DES_ENCRYPT .\"O or .\"O .BR DES_DECRYPT . 暗号化の方向 (訳註: 暗号化なのか復号化なのか) を指定するため、 .BR DES_ENCRYPT または .BR DES_DECRYPT を OR する。 .\"O For software versus hardware .\"O encryption, OR in either .\"O .BR DES_HW .\"O or .\"O .BR DES_SW . 暗号化をソフトウェアで行うかハードウェアで行うかを指定するため、 .BR DES_HW または .BR DES_SW を OR する。 .\"O If .\"O .BR DES_HW .\"O is specified, and there is no hardware, then the encryption is performed .\"O in software and the routine returns .\"O .BR DESERR_NOHWDEVICE . .BR DES_HW が指定されていて、かつハードウェアがない場合、 暗号化はソフトウェアで実行されて、ルーチンは .BR DESERR_NOHWDEVICE を返す。 .\"O For .\"O .BR cbc_crypt (), .\"O the argument .\"O .I ivec .\"O is the 8-byte initialization .\"O vector for the chaining. .\"O It is updated to the next initialization .\"O vector upon return. .BR cbc_crypt () において、引き数 .I ivec はデータブロックを連鎖させる際の 8 バイトの初期化ベクトルである。 この引き数はルーチンから戻るときに次の初期化ベクトルに更新される。 .\"O .SH RETURN VALUE .SH 返り値 .PD 0 .TP 20 .\"O .BR DESERR_NONE .B DESERR_NONE .\"O No error. エラーなし。 .TP .\"O .BR DESERR_NOHWDEVICE .B DESERR_NOHWDEVICE .\"O Encryption succeeded, but done in software instead of the requested hardware. 暗号化は成功したが、要求されたハードウェアの代わりにソフトウェアで実行された。 .TP .\"O .BR DESERR_HWERROR .B DESERR_HWERROR .\"O An error occurred in the hardware or driver. ハードウェアまたはドライバでエラーが発生した。 .TP .\"O .BR DESERR_BADPARAM .B DESERR_BADPARAM .\"O Bad argument to routine. ルーチンへの引き数が不正である。 .PD .LP .\"O Given a result status .\"O .IR stat , .\"O the macro .\"O .\" .BR DES_FAILED\c .\"O .\" .BR ( stat ) .\"O .BI DES_FAILED( stat ) .\"O is false only for the first two statuses. 結果の状態 .I stat を与えたとき、マクロ .\" .BR DES_FAILED\c .\" .BR ( stat ) .BI DES_FAILED( stat ) が false になるのは、最初の 2 つだけである。 .\"O .\" So far the Sun page .\"O .\" Some additions - aeb .\" ここまでが Sun の man ページである。 .\" aeb がいくつか追加を行った。 .\"O .SH VERSIONS .SH バージョン .\"O These routines are present in libc 4.6.27 and later, and in .\"O glibc 2.1 and later. これらのルーチンは libc 4.6.27 以降と glibc 2.1 以降に存在する。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O 4.3BSD. .\"O Not in POSIX.1-2001. 4.3BSD. POSIX.1-2001 にはない。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR des (1), .BR crypt (3), .BR xcrypt (3)