⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 列表4.4.txt

📁 klinux书籍的配套光盘。可以学习学习。
💻 TXT
字号:
【列表4.4】Blowfish.pas和针对第三方的Blowfish库的完整接口单元。
unit Blowfish;
interface
Const
          BF_ENCRYPT = 1;
          BF_DECRYPT = 0;
          BF_ROUNDS = 16;
          BF_BLOCK = 8;
          BFmodule = 'libbf.so.1';
Type
         BF_LONG = LongWord;
         BF_KEY = Record
                     P: Array[1 .. BF_ROUNDS + 2] of BF_LONG;
                     S: Array[1 .. 1024] of BF_LONG;
          end;
          PBF_KEY = ^BF_KEY;
Procedure BF_set_key( key: PBF_KEY; len: LongInt; data: Pointer ); cdecl;
Procedure BF_ecb_encrypt( input: Pointer; out: Pointer;
                                       key: PBF KEY; enc: LongInt); cdecl;
Procedure BF_cbc_encrypt( input: Pointer; out: Pointer; length: LongInt;
                                       ks: PBF_KEY; iv: Pointer; enc: LongInt ); cdecl;
Procedure BF_cfb64_encrypt( input: Pointer; out: Pointer; length: LongInt;
                                          schedule: PBF KEY; ivec: Pointer;
                                          num: PlongInt; enc: LongInt ); cdecl;
Procedure BF_ofb64_encrypt( input: Pointer; out: Pointer; length: LongInt;
                                          schedule: PBF KEY; ivec: Pointer;
                                          num: PlongInt ); cdecl;
Function BF_options: PChar; cdecl;
implementation
procedure BF_set_key;        external BFmodule name 'BF_set_key';
procedure BF_ecb_encrypt;    external BFmodule name 'BF_ecb_encrypt';
procedure BF_cbc_encrypt;    external BFmodule name 'BF_cbc_encrypt';
procedure BF_cfb64_encrypt;  external BFmodule name 'BF_cfb64_encrypt';
procedure BF_ofb64_encrypt;  external BFmodule name 'BF_ofb64_encrypt';
function  BF_options;        external BFmodule name 'BF_options';
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -