BlowFish算法用来加密64Bit长度的字符串。
BlowFish算法使用两个“盒”——ungigned long pbox[18]和unsigned long sbox[4,256]。
BlowFish算法中,有一个核心加密函数:BF_En(后文详细介绍)。该函数输入64位信息,运算后, 以64位密文的形式输出。 用BlowFish算法加密信息,需要两个过程:
源文:
---------------------------------------------------------------------------------------
_WeakKey
Function : Test if the generated Boxes are weak
Argument : none
Return : AX = Status (1=weak, 0=good)
Affects : AX, BX, CX, DX, SI, DI, direction Flag
Description: After "_InitCrypt" you should test the Boxes with this function.
If they provide a weakness which a cryptoanalyst could use to
break the cipher a "1" is returned. In this case you should
reload the original boxes and let the user choose a different
password.
---------------------------------------------------------------------------------------
译文:
---------------------------------------------------------------------------------------
_WeakKey
功能:测试产生的box是否安全
参数:无
返回:AX=1 不安全;AX=0 安全
影响:AX, BX, CX, DX, SI, DI, 方向标志
描述:使用"_InitCrypt"函数产生用于加密的Boxes后,你应该用这个函数测试产生的Boxes是否安全。如果该key产生的Boxes不安全——可以被密码分析者通过分析Boxes得到key,那么,你应该采用另外一个key产生一个安全的Boxes用来加密。