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

📄 bc_bf128.h

📁 加密解密,安全工具!很有意思的代码
💻 H
字号:
#ifndef __BC_BFISH
#define __BC_BFISH
#include "bc_types.h"
#define SERVICE_NAME	"BC_BF128"
#define DISPLAY_NAME    "BLOWFISH-128"
#define ALGORITHM_ID     0xC0

// Key length in bits
#define KEY_LENGTH          (128)
#define KEY_LENGTH_EXTENDED (4168*8)

#define BLOCK_LENGTH 8#define DRIVER_MAJOR_VERSION	1
#define DRIVER_MINOR_VERSION	1


/******* Hardware dependences *******/

// Currently we choose Intel processor
#define ORDER_DCBA 

/* DCBA - little endian - Intel */
#ifdef ORDER_DCBA
union unionDWORD 
 { DWORD Dword;
   struct
	{ BYTE Byte3;
      BYTE Byte2;
      BYTE Byte1;
      BYTE Byte0;
    } Byte;
 };
#endif	/* ORDER_DCBA */

/* ABCD - big endian - Motorola */
#ifdef ORDER_ABCD
union unionDWORD 
 { DWORD Dword;
   struct
	{ BYTE Byte0;
      BYTE Byte1;
      BYTE Byte2;
      BYTE Byte3;
    } Byte;
 };
#endif	/* ORDER_ABCD */

/* BADC - VAX */
#ifdef ORDER_BADC
union unionDWORD 
 { DWORD Dword;
   struct
	{ BYTE Byte1;
      BYTE Byte0;
      BYTE Byte3;
      BYTE Byte2;
    } Byte;
 };
#endif	/* ORDER_BADC */


/******* Exported functions *********/

#define IN

BOOL
KeyExtend( PUCHAR KeySource,          // 56       8-bit  uchars
           PDWORD KeyDestination );   // (4168/4) 32-bit dwords

VOID
Encrypt( DWORD *IVector, 
         DWORD *KeyAdress,
         DWORD *SrcBuffer,
         DWORD *DstBuffer,
         DWORD Length );    // in bytes

VOID
Decrypt( DWORD *IVector, 
         DWORD *KeyAdress,
         DWORD *SrcBuffer,
         DWORD *DstBuffer,
         DWORD Length );    // in bytes

#endif

⌨️ 快捷键说明

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