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

📄 rc4.inc

📁 The dinamyc link library that contains an implementation of SHA1, SHA512, CRC32, CRC32b, Adler32, Tw
💻 INC
字号:

; ----------------------------------------------------- ;
;       RC4 Encryption Algorithm ( Stream Cipher )      ;
;              by RSA Data Security, Inc                ;
;                                                       ;
; Block Size: N/A                                       ;
; Max Key Size: 2048 bits                               ;
; ----------------------------------------------------- ;

align 4
proc RC4_Init uses ebx esi edi,Key:PBYTE,KeySize:DWORD
     mov edi,[Key]
     mov esi,[KeySize]
     mov ebx,256
     xor ecx,ecx
@@:  mov [rc4_table+ecx],cl
     inc ecx
     cmp ecx,ebx
     jb @r
     shr esi,3
     jz .ret
     cmp esi,ebx
     cmova esi,ebx
     xor ecx,ecx
     xor ebx,ebx
@@:  mov eax,ecx
     xor edx,edx
     div si
     add bl,[edi+edx]
     mov ah,[rc4_table+ecx]
     add bl,ah
     mov al,[rc4_table+ebx]
     mov [rc4_table+ecx],al
     mov [rc4_table+ebx],ah
     inc ecx
     cmp ecx,255
     jbe @r
.ret:ret
endp

align 4
proc RC4_Crypt uses ebx esi edi,Data:PBYTE,DataSize:DWORD
     mov edi,[Data]
     xor eax,eax
     xor ecx,ecx
     xor edx,edx
@@:  cmp ecx,[DataSize]
     jae @f
     mov esi,ecx
     inc esi
     and esi,255
     mov al,[rc4_table+esi]
     add dl,al
     mov bl,[rc4_table+edx]
     mov [rc4_table+esi],bl
     mov [rc4_table+edx],al
     add al,bl
     mov al,[rc4_table+eax]
     xor [edi+ecx],al
     inc ecx
     jmp @r
@@:  ret
endp

⌨️ 快捷键说明

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