RC6加密解密算法(MD5)

Discussion in '聚合阅读 | Feeds' started by c5soft, Jun 21, 2015.

  1. c5soft

    c5soft 端茶倒水的 Administrator

    Country:
    China
    Admin Post
    Code (Text):
    1. {**********}
    2. {          }
    3. {       RC6加密解密算法(MD5)          }
    4. {          }
    5. {       版权所有 (C) 2011 QQ:9844201          }
    6. {          }
    7. {**********}
    8. unit RC6Dcrypt;
    9.  
    10. interface
    11.    uses
    12.      SysUtils;
    13.    
    14. {----------
    15.   过程名:    RC6Encode
    16.   作者:      YCJ
    17.   日期:      2011.09.08
    18.   参数:      const InData; var OutData; Size:Cardinal; Key:PAnsiChar
    19.   返回值:    无
    20.   用途: 加密内存流
    21.   Key 为PAnsiChar 类型
    22.   OutData 要预先分配好内存
    23. ----------}
    24. procedure RC6Encode(const InData; var OutData; Size:Cardinal; Key:PAnsiChar);
    25.  
    26. {----------
    27.   过程名:    RC6Encode
    28.   作者:      YCJ
    29.   日期:      2011.09.08
    30.   参数:      const InData; var OutData; Size:Cardinal; Key:PAnsiChar
    31.   返回值:    无
    32.   用途: 解密内存流
    33.   Key 为PAnsiChar 类型
    34.   OutData 要预先分配好内存
    35. ----------}
    36. procedure RC6Decode(const InData; var OutData; Size:Cardinal; Key:PAnsiChar);
    37. implementation
    38.  
    39. const
    40.   OPCODE:Array [0..4515] of Byte =
    41.   (
    42.     $55,$8B,$EC,$81,$C4,$10,$FF,$FF,$FF,$53,$56,$57,$8B,$5D,$14,$8B,
    43.     $7D,$10,$8D,$75,$F4,$E8,$00,$00,$00,$00,$58,$2D,$1A,$3D,$45,$00,
    44.     $50,$8F,$45,$FC,$B8,$C8,$4C,$45,$00,$03,$45,$FC,$89,$45,$F0,$8B,
    45.     $45,$08,$89,$45,$F8,$8B,$45,$0C,$89,$06,$8B,$45,$F0,$83,$C0,$5C,
    46.     $B1,$FF,$BA,$B0,$00,$00,$00,$E8,$8C,$05,$00,$00,$8D,$45,$E0,$B1,
    47.     $FF,$BA,$10,$00,$00,$00,$E8,$7D,$05,$00,$00,$8D,$85,$10,$FF,$FF,
    48.     $FF,$33,$C9,$BA,$40,$00,$00,$00,$E8,$6B,$05,$00,$00,$8D,$85,$50,
    49.     $FF,$FF,$FF,$33,$C9,$BA,$80,$00,$00,$00,$E8,$59,$05,$00,$00,$8B,
    50.     $C3,$E8,$2A,$0F,$00,$00,$8B,$C8,$8D,$85,$50,$FF,$FF,$FF,$8B,$D3,
    51.     $E8,$13,$0F,$00,$00,$8B,$45,$F0,$E8,$57,$05,$00,$00,$8D,$85,$50,
    52.     $FF,$FF,$FF,$8B,$4D,$F0,$BA,$80,$00,$00,$00,$E8,$7C,$0E,$00,$00,
    53.     $8D,$95,$10,$FF,$FF,$FF,$8B,$45,$F0,$E8,$92,$05,$00,$00,$8D,$85,
    54.     $10,$FF,$FF,$FF,$8B,$4D,$F0,$BA,$40,$00,$00,$00,$E8,$47,$01,$00,
    55.     $00,$8D,$85,$10,$FF,$FF,$FF,$33,$C9,$BA,$40,$00,$00,$00,$E8,$F5,
    56.     $04,$00,$00,$80,$7D,$18,$00,$0F,$84,$8D,$00,$00,$00,$8B,$DF,$C1,
    57.     $EB,$04,$85,$DB,$76,$4C,$8B,$16,$8B,$45,$F8,$B9,$10,$00,$00,$00,
    58.     $E8,$77,$04,$00,$00,$8D,$55,$E0,$8B,$06,$B9,$10,$00,$00,$00,$E8,
    59.     $14,$04,$00,$00,$8B,$06,$8B,$D0,$8B,$4D,$F0,$E8,$E8,$01,$00,$00,
    60.     $8D,$55,$E0,$8B,$06,$B9,$10,$00,$00,$00,$E8,$4D,$04,$00,$00,$8B,
    61.     $45,$F8,$83,$C0,$10,$89,$45,$F8,$8B,$06,$83,$C0,$10,$89,$06,$4B,
    62.     $75,$B4,$8B,$DF,$83,$E3,$0F,$85,$DB,$0F,$84,$C0,$00,$00,$00,$8D,
    63.     $55,$E0,$8D,$45,$E0,$8B,$4D,$F0,$E8,$AB,$01,$00,$00,$8B,$CB,$8B,
    64.     $16,$8B,$45,$F8,$E8,$13,$04,$00,$00,$8B,$CB,$8D,$55,$E0,$8B,$06,
    65.     $E8,$B3,$03,$00,$00,$E9,$95,$00,$00,$00,$8B,$DF,$C1,$EB,$04,$85,
    66.     $DB,$76,$5D,$8B,$16,$8B,$45,$F8,$B9,$10,$00,$00,$00,$E8,$EA,$03,
    67.     $00,$00,$8D,$55,$D0,$8B,$45,$F8,$B9,$10,$00,$00,$00,$E8,$DA,$03,
    68.     $00,$00,$8B,$06,$8B,$D0,$8B,$4D,$F0,$E8,$6E,$02,$00,$00,$8D,$55,
    69.     $E0,$8B,$06,$B9,$10,$00,$00,$00,$E8,$6B,$03,$00,$00,$8D,$55,$E0,
    70.     $8D,$45,$D0,$B9,$10,$00,$00,$00,$E8,$AF,$03,$00,$00,$8B,$45,$F8,
    71.     $83,$C0,$10,$89,$45,$F8,$8B,$06,$83,$C0,$10,$89,$06,$4B,$75,$A3,
    72.     $8B,$DF,$83,$E3,$0F,$85,$DB,$74,$26,$8D,$55,$E0,$8D,$45,$E0,$8B,
    73.     $4D,$F0,$E8,$11,$01,$00,$00,$8B,$CB,$8B,$16,$8B,$45,$F8,$E8,$79,
    74.     $03,$00,$00,$8B,$CB,$8D,$55,$E0,$8B,$06,$E8,$19,$03,$00,$00,$5F,
    75.     $5E,$5B,$8B,$E5,$5D,$C2,$14,$00,$53,$56,$57,$55,$81,$C4,$F4,$FE,
    76.     $FF,$FF,$89,$0C,$24,$8B,$DA,$8B,$F0,$8D,$44,$24,$0C,$33,$C9,$BA,
    77.     $00,$01,$00,$00,$E8,$9F,$03,$00,$00,$8D,$54,$24,$0C,$8B,$C6,$8B,
    78.     $CB,$E8,$36,$03,$00,$00,$8B,$C3,$C1,$E8,$02,$89,$44,$24,$04,$83,
    79.     $E3,$03,$85,$DB,$74,$04,$FF,$44,$24,$04,$8B,$04,$24,$8D,$50,$5C,
    80.     $8B,$04,$24,$05,$0C,$01,$00,$00,$B9,$B0,$00,$00,$00,$E8,$0A,$03,
    81.     $00,$00,$33,$FF,$33,$ED,$33,$DB,$33,$F6,$83,$7C,$24,$04,$2C,$76,
    82.     $09,$8B,$44,$24,$04,$8D,$04,$40,$EB,$05,$B8,$84,$00,$00,$00,$85,
    83.     $C0,$76,$57,$89,$44,$24,$08,$8B,$04,$24,$8B,$44,$B8,$5C,$03,$C3,
    84.     $03,$C6,$BA,$03,$00,$00,$00,$E8,$A0,$02,$00,$00,$8B,$D8,$8B,$04,
    85.     $24,$89,$5C,$B8,$5C,$8D,$14,$1E,$8B,$44,$AC,$0C,$03,$C3,$03,$C6,
    86.     $E8,$87,$02,$00,$00,$8B,$F0,$89,$74,$AC,$0C,$8D,$47,$01,$B9,$2C,
    87.     $00,$00,$00,$33,$D2,$F7,$F1,$8B,$FA,$8D,$45,$01,$33,$D2,$F7,$74,
    88.     $24,$04,$8B,$EA,$FF,$4C,$24,$08,$75,$AD,$8D,$44,$24,$0C,$33,$C9,
    89.     $BA,$00,$01,$00,$00,$E8,$DE,$02,$00,$00,$81,$C4,$0C,$01,$00,$00,
    90.     $5D,$5F,$5E,$5B,$C3,$8D,$40,$00,$53,$56,$57,$55,$83,$C4,$E8,$89,
    91.     $4C,$24,$08,$89,$54,$24,$04,$89,$04,$24,$8B,$14,$24,$8B,$32,$8B,
    92.     $04,$24,$8B,$C2,$8B,$D0,$83,$C2,$04,$8B,$3A,$8B,$14,$24,$8B,$D0,
    93.     $83,$C2,$08,$8B,$2A,$8B,$14,$24,$83,$C0,$0C,$8B,$00,$89,$44,$24,
    94.     $0C,$8B,$44,$24,$08,$03,$78,$5C,$8B,$44,$24,$08,$8B,$40,$60,$01,
    95.     $44,$24,$0C,$C7,$44,$24,$14,$01,$00,$00,$00,$8B,$C7,$03,$C0,$40,
    96.     $F7,$EF,$BA,$05,$00,$00,$00,$E8,$E0,$01,$00,$00,$8B,$D8,$8B,$44,
    97.     $24,$0C,$03,$C0,$40,$F7,$6C,$24,$0C,$BA,$05,$00,$00,$00,$E8,$C9,
    98.     $01,$00,$00,$89,$44,$24,$10,$8B,$C3,$33,$C6,$8B,$54,$24,$10,$E8,
    99.     $B8,$01,$00,$00,$8B,$54,$24,$14,$03,$D2,$8B,$4C,$24,$08,$03,$44,
    100.     $91,$5C,$8B,$F0,$8B,$44,$24,$10,$33,$C5,$8B,$D3,$E8,$9B,$01,$00,
    101.     $00,$8B,$54,$24,$14,$03,$D2,$8B,$4C,$24,$08,$03,$44,$91,$60,$8B,
    102.     $E8,$8B,$DE,$8B,$F7,$8B,$FD,$8B,$6C,$24,$0C,$89,$5C,$24,$0C,$FF,
    103.     $44,$24,$14,$83,$7C,$24,$14,$15,$75,$81,$8B,$44,$24,$08,$03,$B0,
    104.     $04,$01,$00,$00,$8B,$44,$24,$08,$03,$A8,$08,$01,$00,$00,$8B,$44,
    105.     $24,$04,$89,$30,$8B,$44,$24,$04,$83,$C0,$04,$89,$38,$8B,$44,$24,
    106.     $04,$83,$C0,$08,$89,$28,$8B,$44,$24,$04,$83,$C0,$0C,$8B,$54,$24,
    107.     $0C,$89,$10,$83,$C4,$18,$5D,$5F,$5E,$5B,$C3,$90,$53,$56,$57,$55,
    108.     $83,$C4,$EC,$89,$4C,$24,$04,$89,$14,$24,$8B,$C8,$8B,$31,$8B,$D1,
    109.     $8B,$CA,$83,$C1,$04,$8B,$39,$8B,$CA,$83,$C1,$08,$8B,$29,$83,$C2,
    110.     $0C,$8B,$02,$89,$44,$24,$08,$8B,$44,$24,$04,$2B,$A8,$08,$01,$00,
    111.     $00,$8B,$44,$24,$04,$2B,$B0,$04,$01,$00,$00,$C7,$44,$24,$10,$14,
    112.     $00,$00,$00,$8B,$DE,$8B,$74,$24,$08,$89,$6C,$24,$08,$8B,$EF,$8B,
    113.     $FB,$8B,$44,$24,$08,$03,$C0,$40,$F7,$6C,$24,$08,$BA,$05,$00,$00,
    114.     $00,$E8,$C6,$00,$00,$00,$89,$44,$24,$0C,$8B,$C7,$03,$C0,$40,$F7,
    115.     $EF,$BA,$05,$00,$00,$00,$E8,$B1,$00,$00,$00,$8B,$D8,$8B,$44,$24,
    116.     $10,$03,$C0,$8B,$54,$24,$04,$FF,$74,$82,$60,$8B,$C5,$5A,$2B,$C2,
    117.     $8B,$D3,$E8,$AD,$00,$00,$00,$33,$44,$24,$0C,$8B,$E8,$8B,$44,$24,
    118.     $10,$03,$C0,$8B,$54,$24,$04,$FF,$74,$82,$5C,$8B,$C6,$5A,$2B,$C2,
    119.     $8B,$54,$24,$0C,$E8,$8B,$00,$00,$00,$33,$D8,$8B,$F3,$FF,$4C,$24,
    120.     $10,$83,$7C,$24,$10,$00,$0F,$85,$77,$FF,$FF,$FF,$8B,$44,$24,$04,
    121.     $8B,$40,$60,$29,$44,$24,$08,$8B,$44,$24,$04,$2B,$78,$5C,$8B,$04,
    122.     $24,$89,$30,$8B,$04,$24,$83,$C0,$04,$89,$38,$8B,$04,$24,$83,$C0,
    123.     $08,$89,$28,$8B,$04,$24,$83,$C0,$0C,$8B,$54,$24,$08,$89,$10,$83,
    124.     $C4,$14,$5D,$5F,$5E,$5B,$C3,$90,$53,$56,$57,$8B,$F1,$85,$F6,$76,
    125.     $17,$B9,$01,$00,$00,$00,$8B,$DA,$03,$D9,$4B,$8A,$1B,$8B,$F8,$03,
    126.     $F9,$4F,$30,$1F,$41,$4E,$75,$EE,$5F,$5E,$5B,$C3,$53,$8B,$CA,$8B,
    127.     $D8,$D3,$E3,$B9,$20,$00,$00,$00,$2B,$CA,$D3,$E8,$0B,$D8,$8B,$C3,
    128.     $5B,$C3,$8B,$C0,$53,$8B,$CA,$8B,$D8,$D3,$EB,$B9,$20,$00,$00,$00,
    129.     $2B,$CA,$D3,$E0,$0B,$D8,$8B,$C3,$5B,$C3,$8B,$C0,$53,$83,$C4,$F8,
    130.     $89,$04,$24,$89,$54,$24,$04,$8B,$04,$24,$3B,$44,$24,$04,$74,$41,
    131.     $8B,$44,$24,$04,$3B,$04,$24,$76,$1D,$8B,$C1,$48,$83,$F8,$00,$7C,
    132.     $30,$8B,$14,$24,$8A,$14,$02,$8B,$4C,$24,$04,$88,$14,$01,$48,$83,
    133.     $F8,$FF,$75,$ED,$EB,$1B,$8B,$D1,$4A,$85,$D2,$7C,$14,$42,$33,$C0,
    134.     $8B,$0C,$24,$8A,$0C,$01,$8B,$5C,$24,$04,$88,$0C,$03,$40,$4A,$75,
    135.     $EF,$59,$5A,$5B,$C3,$8D,$40,$00,$51,$89,$04,$24,$8B,$C2,$48,$83,
    136.     $F8,$00,$7C,$0C,$8B,$14,$24,$88,$0C,$02,$48,$83,$F8,$FF,$75,$F4,
    137.     $5A,$C3,$8B,$C0,$53,$8B,$D8,$8B,$C3,$E8,$1E,$00,$00,$00,$C7,$43,
    138.     $0C,$01,$23,$45,$67,$C7,$43,$10,$89,$AB,$CD,$EF,$C7,$43,$14,$FE,
    139.     $DC,$BA,$98,$C7,$43,$18,$76,$54,$32,$10,$5B,$C3,$53,$8B,$D8,$33,
    140.     $C0,$89,$03,$33,$C0,$89,$43,$04,$33,$C0,$89,$43,$08,$8D,$43,$1C,
    141.     $33,$C9,$BA,$40,$00,$00,$00,$E8,$9C,$FF,$FF,$FF,$8D,$43,$0C,$33,
    142.     $C9,$BA,$10,$00,$00,$00,$E8,$8D,$FF,$FF,$FF,$5B,$C3,$8D,$40,$00,
    143.     $53,$56,$8B,$F2,$8B,$D8,$8B,$43,$08,$C6,$44,$03,$1C,$80,$83,$7B,
    144.     $08,$38,$72,$07,$8B,$C3,$E8,$31,$00,$00,$00,$8D,$43,$54,$8B,$53,
    145.     $04,$89,$10,$8D,$43,$58,$8B,$13,$89,$10,$8B,$C3,$E8,$1B,$00,$00,
    146.     $00,$8B,$D6,$8D,$43,$0C,$B9,$10,$00,$00,$00,$E8,$EC,$FE,$FF,$FF,
    147.     $8B,$C3,$E8,$85,$FF,$FF,$FF,$5E,$5B,$C3,$8B,$C0,$53,$56,$57,$55,
    148.     $83,$C4,$BC,$89,$04,$24,$8D,$54,$24,$04,$8B,$04,$24,$83,$C0,$1C,
    149.     $B9,$40,$00,$00,$00,$E8,$C2,$FE,$FF,$FF,$8B,$04,$24,$8B,$58,$0C,
    150.     $8B,$04,$24,$8B,$70,$10,$8B,$04,$24,$8B,$78,$14,$8B,$04,$24,$8B,
    151.     $68,$18,$8B,$C5,$33,$C7,$23,$C6,$33,$C5,$03,$C3,$03,$44,$24,$04,
    152.     $05,$78,$A4,$6A,$D7,$BA,$07,$00,$00,$00,$E8,$5D,$FE,$FF,$FF,$03,
    153.     $C6,$8B,$D8,$8B,$C7,$33,$C6,$23,$C3,$33,$C7,$03,$C5,$03,$44,$24,
    154.     $08,$05,$56,$B7,$C7,$E8,$BA,$0C,$00,$00,$00,$E8,$3C,$FE,$FF,$FF,
    155.     $03,$C3,$8B,$E8,$8B,$C6,$33,$C3,$23,$C5,$33,$C6,$03,$C7,$03,$44,
    156.     $24,$0C,$05,$DB,$70,$20,$24,$BA,$11,$00,$00,$00,$E8,$1B,$FE,$FF,
    157.     $FF,$03,$C5,$8B,$F8,$8B,$C3,$33,$C5,$23,$C7,$33,$C3,$03,$C6,$03,
    158.     $44,$24,$10,$05,$EE,$CE,$BD,$C1,$BA,$16,$00,$00,$00,$E8,$FA,$FD,
    159.     $FF,$FF,$03,$C7,$8B,$F0,$8B,$C5,$33,$C7,$23,$C6,$33,$C5,$03,$C3,
    160.     $03,$44,$24,$14,$05,$AF,$0F,$7C,$F5,$BA,$07,$00,$00,$00,$E8,$D9,
    161.     $FD,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C7,$33,$C6,$23,$C3,$33,$C7,$03,
    162.     $C5,$03,$44,$24,$18,$05,$2A,$C6,$87,$47,$BA,$0C,$00,$00,$00,$E8,
    163.     $B8,$FD,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C6,$33,$C3,$23,$C5,$33,$C6,
    164.     $03,$C7,$03,$44,$24,$1C,$05,$13,$46,$30,$A8,$BA,$11,$00,$00,$00,
    165.     $E8,$97,$FD,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C3,$33,$C5,$23,$C7,$33,
    166.     $C3,$03,$C6,$03,$44,$24,$20,$05,$01,$95,$46,$FD,$BA,$16,$00,$00,
    167.     $00,$E8,$76,$FD,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C5,$33,$C7,$23,$C6,
    168.     $33,$C5,$03,$C3,$03,$44,$24,$24,$05,$D8,$98,$80,$69,$BA,$07,$00,
    169.     $00,$00,$E8,$55,$FD,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C7,$33,$C6,$23,
    170.     $C3,$33,$C7,$03,$C5,$03,$44,$24,$28,$05,$AF,$F7,$44,$8B,$BA,$0C,
    171.     $00,$00,$00,$E8,$34,$FD,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C6,$33,$C3,
    172.     $23,$C5,$33,$C6,$03,$C7,$03,$44,$24,$2C,$05,$B1,$5B,$FF,$FF,$BA,
    173.     $11,$00,$00,$00,$E8,$13,$FD,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C3,$33,
    174.     $C5,$23,$C7,$33,$C3,$03,$C6,$03,$44,$24,$30,$05,$BE,$D7,$5C,$89,
    175.     $BA,$16,$00,$00,$00,$E8,$F2,$FC,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C5,
    176.     $33,$C7,$23,$C6,$33,$C5,$03,$C3,$03,$44,$24,$34,$05,$22,$11,$90,
    177.     $6B,$BA,$07,$00,$00,$00,$E8,$D1,$FC,$FF,$FF,$03,$C6,$8B,$D8,$8B,
    178.     $C7,$33,$C6,$23,$C3,$33,$C7,$03,$C5,$03,$44,$24,$38,$05,$93,$71,
    179.     $98,$FD,$BA,$0C,$00,$00,$00,$E8,$B0,$FC,$FF,$FF,$03,$C3,$8B,$E8,
    180.     $8B,$C6,$33,$C3,$23,$C5,$33,$C6,$03,$C7,$03,$44,$24,$3C,$05,$8E,
    181.     $43,$79,$A6,$BA,$11,$00,$00,$00,$E8,$8F,$FC,$FF,$FF,$03,$C5,$8B,
    182.     $F8,$8B,$C3,$33,$C5,$23,$C7,$33,$C3,$03,$C6,$03,$44,$24,$40,$05,
    183.     $21,$08,$B4,$49,$BA,$16,$00,$00,$00,$E8,$6E,$FC,$FF,$FF,$03,$C7,
    184.     $8B,$F0,$8B,$C7,$33,$C6,$23,$C5,$33,$C7,$03,$C3,$03,$44,$24,$08,
    185.     $05,$62,$25,$1E,$F6,$BA,$05,$00,$00,$00,$E8,$4D,$FC,$FF,$FF,$03,
    186.     $C6,$8B,$D8,$8B,$C6,$33,$C3,$23,$C7,$33,$C6,$03,$C5,$03,$44,$24,
    187.     $1C,$05,$40,$B3,$40,$C0,$BA,$09,$00,$00,$00,$E8,$2C,$FC,$FF,$FF,
    188.     $03,$C3,$8B,$E8,$8B,$C3,$33,$C5,$23,$C6,$33,$C3,$03,$C7,$03,$44,
    189.     $24,$30,$05,$51,$5A,$5E,$26,$BA,$0E,$00,$00,$00,$E8,$0B,$FC,$FF,
    190.     $FF,$03,$C5,$8B,$F8,$8B,$C5,$33,$C7,$23,$C3,$33,$C5,$03,$C6,$03,
    191.     $44,$24,$04,$05,$AA,$C7,$B6,$E9,$BA,$14,$00,$00,$00,$E8,$EA,$FB,
    192.     $FF,$FF,$03,$C7,$8B,$F0,$8B,$C7,$33,$C6,$23,$C5,$33,$C7,$03,$C3,
    193.     $03,$44,$24,$18,$05,$5D,$10,$2F,$D6,$BA,$05,$00,$00,$00,$E8,$C9,
    194.     $FB,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C6,$33,$C3,$23,$C7,$33,$C6,$03,
    195.     $C5,$03,$44,$24,$2C,$05,$53,$14,$44,$02,$BA,$09,$00,$00,$00,$E8,
    196.     $A8,$FB,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C3,$33,$C5,$23,$C6,$33,$C3,
    197.     $03,$C7,$03,$44,$24,$40,$05,$81,$E6,$A1,$D8,$BA,$0E,$00,$00,$00,
    198.     $E8,$87,$FB,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C5,$33,$C7,$23,$C3,$33,
    199.     $C5,$03,$C6,$03,$44,$24,$14,$05,$C8,$FB,$D3,$E7,$BA,$14,$00,$00,
    200.     $00,$E8,$66,$FB,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C7,$33,$C6,$23,$C5,
    201.     $33,$C7,$03,$C3,$03,$44,$24,$28,$05,$E6,$CD,$E1,$21,$BA,$05,$00,
    202.     $00,$00,$E8,$45,$FB,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C6,$33,$C3,$23,
    203.     $C7,$33,$C6,$03,$C5,$03,$44,$24,$3C,$05,$D6,$07,$37,$C3,$BA,$09,
    204.     $00,$00,$00,$E8,$24,$FB,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C3,$33,$C5,
    205.     $23,$C6,$33,$C3,$03,$C7,$03,$44,$24,$10,$05,$87,$0D,$D5,$F4,$BA,
    206.     $0E,$00,$00,$00,$E8,$03,$FB,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C5,$33,
    207.     $C7,$23,$C3,$33,$C5,$03,$C6,$03,$44,$24,$24,$05,$ED,$14,$5A,$45,
    208.     $BA,$14,$00,$00,$00,$E8,$E2,$FA,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C7,
    209.     $33,$C6,$23,$C5,$33,$C7,$03,$C3,$03,$44,$24,$38,$05,$05,$E9,$E3,
    210.     $A9,$BA,$05,$00,$00,$00,$E8,$C1,$FA,$FF,$FF,$03,$C6,$8B,$D8,$8B,
    211.     $C6,$33,$C3,$23,$C7,$33,$C6,$03,$C5,$03,$44,$24,$0C,$05,$F8,$A3,
    212.     $EF,$FC,$BA,$09,$00,$00,$00,$E8,$A0,$FA,$FF,$FF,$03,$C3,$8B,$E8,
    213.     $8B,$C3,$33,$C5,$23,$C6,$33,$C3,$03,$C7,$03,$44,$24,$20,$05,$D9,
    214.     $02,$6F,$67,$BA,$0E,$00,$00,$00,$E8,$7F,$FA,$FF,$FF,$03,$C5,$8B,
    215.     $F8,$8B,$C5,$33,$C7,$23,$C3,$33,$C5,$03,$C6,$03,$44,$24,$34,$05,
    216.     $8A,$4C,$2A,$8D,$BA,$14,$00,$00,$00,$E8,$5E,$FA,$FF,$FF,$03,$C7,
    217.     $8B,$F0,$8B,$C7,$33,$C6,$33,$C5,$03,$C3,$03,$44,$24,$18,$05,$42,
    218.     $39,$FA,$FF,$BA,$04,$00,$00,$00,$E8,$3F,$FA,$FF,$FF,$03,$C6,$8B,
    219.     $D8,$8B,$C6,$33,$C3,$33,$C7,$03,$C5,$03,$44,$24,$24,$05,$81,$F6,
    220.     $71,$87,$BA,$0B,$00,$00,$00,$E8,$20,$FA,$FF,$FF,$03,$C3,$8B,$E8,
    221.     $8B,$C3,$33,$C5,$33,$C6,$03,$C7,$03,$44,$24,$30,$05,$22,$61,$9D,
    222.     $6D,$BA,$10,$00,$00,$00,$E8,$01,$FA,$FF,$FF,$03,$C5,$8B,$F8,$8B,
    223.     $C5,$33,$C7,$33,$C3,$03,$C6,$03,$44,$24,$3C,$05,$0C,$38,$E5,$FD,
    224.     $BA,$17,$00,$00,$00,$E8,$E2,$F9,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C7,
    225.     $33,$C6,$33,$C5,$03,$C3,$03,$44,$24,$08,$05,$44,$EA,$BE,$A4,$BA,
    226.     $04,$00,$00,$00,$E8,$C3,$F9,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C6,$33,
    227.     $C3,$33,$C7,$03,$C5,$03,$44,$24,$14,$05,$A9,$CF,$DE,$4B,$BA,$0B,
    228.     $00,$00,$00,$E8,$A4,$F9,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C3,$33,$C5,
    229.     $33,$C6,$03,$C7,$03,$44,$24,$20,$05,$60,$4B,$BB,$F6,$BA,$10,$00,
    230.     $00,$00,$E8,$85,$F9,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C5,$33,$C7,$33,
    231.     $C3,$03,$C6,$03,$44,$24,$2C,$05,$70,$BC,$BF,$BE,$BA,$17,$00,$00,
    232.     $00,$E8,$66,$F9,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C7,$33,$C6,$33,$C5,
    233.     $03,$C3,$03,$44,$24,$38,$05,$C6,$7E,$9B,$28,$BA,$04,$00,$00,$00,
    234.     $E8,$47,$F9,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C6,$33,$C3,$33,$C7,$03,
    235.     $C5,$03,$44,$24,$04,$05,$FA,$27,$A1,$EA,$BA,$0B,$00,$00,$00,$E8,
    236.     $28,$F9,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C3,$33,$C5,$33,$C6,$03,$C7,
    237.     $03,$44,$24,$10,$05,$85,$30,$EF,$D4,$BA,$10,$00,$00,$00,$E8,$09,
    238.     $F9,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C5,$33,$C7,$33,$C3,$03,$C6,$03,
    239.     $44,$24,$1C,$05,$05,$1D,$88,$04,$BA,$17,$00,$00,$00,$E8,$EA,$F8,
    240.     $FF,$FF,$03,$C7,$8B,$F0,$8B,$C7,$33,$C6,$33,$C5,$03,$C3,$03,$44,
    241.     $24,$28,$05,$39,$D0,$D4,$D9,$BA,$04,$00,$00,$00,$E8,$CB,$F8,$FF,
    242.     $FF,$03,$C6,$8B,$D8,$8B,$C6,$33,$C3,$33,$C7,$03,$C5,$03,$44,$24,
    243.     $34,$05,$E5,$99,$DB,$E6,$BA,$0B,$00,$00,$00,$E8,$AC,$F8,$FF,$FF,
    244.     $03,$C3,$8B,$E8,$8B,$C3,$33,$C5,$33,$C6,$03,$C7,$03,$44,$24,$40,
    245.     $05,$F8,$7C,$A2,$1F,$BA,$10,$00,$00,$00,$E8,$8D,$F8,$FF,$FF,$03,
    246.     $C5,$8B,$F8,$8B,$C5,$33,$C7,$33,$C3,$03,$C6,$03,$44,$24,$0C,$05,
    247.     $65,$56,$AC,$C4,$BA,$17,$00,$00,$00,$E8,$6E,$F8,$FF,$FF,$03,$C7,
    248.     $8B,$F0,$8B,$C5,$F7,$D0,$0B,$C6,$33,$C7,$03,$C3,$03,$44,$24,$04,
    249.     $05,$44,$22,$29,$F4,$BA,$06,$00,$00,$00,$E8,$4D,$F8,$FF,$FF,$03,
    250.     $C6,$8B,$D8,$8B,$C7,$F7,$D0,$0B,$C3,$33,$C6,$03,$C5,$03,$44,$24,
    251.     $20,$05,$97,$FF,$2A,$43,$BA,$0A,$00,$00,$00,$E8,$2C,$F8,$FF,$FF,
    252.     $03,$C3,$8B,$E8,$8B,$C6,$F7,$D0,$0B,$C5,$33,$C3,$03,$C7,$03,$44,
    253.     $24,$3C,$05,$A7,$23,$94,$AB,$BA,$0F,$00,$00,$00,$E8,$0B,$F8,$FF,
    254.     $FF,$03,$C5,$8B,$F8,$8B,$C3,$F7,$D0,$0B,$C7,$33,$C5,$03,$C6,$03,
    255.     $44,$24,$18,$05,$39,$A0,$93,$FC,$BA,$15,$00,$00,$00,$E8,$EA,$F7,
    256.     $FF,$FF,$03,$C7,$8B,$F0,$8B,$C5,$F7,$D0,$0B,$C6,$33,$C7,$03,$C3,
    257.     $03,$44,$24,$34,$05,$C3,$59,$5B,$65,$BA,$06,$00,$00,$00,$E8,$C9,
    258.     $F7,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C7,$F7,$D0,$0B,$C3,$33,$C6,$03,
    259.     $C5,$03,$44,$24,$10,$05,$92,$CC,$0C,$8F,$BA,$0A,$00,$00,$00,$E8,
    260.     $A8,$F7,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C6,$F7,$D0,$0B,$C5,$33,$C3,
    261.     $03,$C7,$03,$44,$24,$2C,$05,$7D,$F4,$EF,$FF,$BA,$0F,$00,$00,$00,
    262.     $E8,$87,$F7,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C3,$F7,$D0,$0B,$C7,$33,
    263.     $C5,$03,$C6,$03,$44,$24,$08,$05,$D1,$5D,$84,$85,$BA,$15,$00,$00,
    264.     $00,$E8,$66,$F7,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C5,$F7,$D0,$0B,$C6,
    265.     $33,$C7,$03,$C3,$03,$44,$24,$24,$05,$4F,$7E,$A8,$6F,$BA,$06,$00,
    266.     $00,$00,$E8,$45,$F7,$FF,$FF,$03,$C6,$8B,$D8,$8B,$C7,$F7,$D0,$0B,
    267.     $C3,$33,$C6,$03,$C5,$03,$44,$24,$40,$05,$E0,$E6,$2C,$FE,$BA,$0A,
    268.     $00,$00,$00,$E8,$24,$F7,$FF,$FF,$03,$C3,$8B,$E8,$8B,$C6,$F7,$D0,
    269.     $0B,$C5,$33,$C3,$03,$C7,$03,$44,$24,$1C,$05,$14,$43,$01,$A3,$BA,
    270.     $0F,$00,$00,$00,$E8,$03,$F7,$FF,$FF,$03,$C5,$8B,$F8,$8B,$C3,$F7,
    271.     $D0,$0B,$C7,$33,$C5,$03,$C6,$03,$44,$24,$38,$05,$A1,$11,$08,$4E,
    272.     $BA,$15,$00,$00,$00,$E8,$E2,$F6,$FF,$FF,$03,$C7,$8B,$F0,$8B,$C5,
    273.     $F7,$D0,$0B,$C6,$33,$C7,$03,$C3,$03,$44,$24,$14,$05,$82,$7E,$53,
    274.     $F7,$BA,$06,$00,$00,$00,$E8,$C1,$F6,$FF,$FF,$03,$C6,$8B,$D8,$8B,
    275.     $C7,$F7,$D0,$0B,$C3,$33,$C6,$03,$C5,$03,$44,$24,$30,$05,$35,$F2,
    276.     $3A,$BD,$BA,$0A,$00,$00,$00,$E8,$A0,$F6,$FF,$FF,$03,$C3,$8B,$E8,
    277.     $8B,$C6,$F7,$D0,$0B,$C5,$33,$C3,$03,$C7,$03,$44,$24,$0C,$05,$BB,
    278.     $D2,$D7,$2A,$BA,$0F,$00,$00,$00,$E8,$7F,$F6,$FF,$FF,$03,$C5,$8B,
    279.     $F8,$8B,$C3,$F7,$D0,$0B,$C7,$33,$C5,$03,$C6,$03,$44,$24,$28,$05,
    280.     $91,$D3,$86,$EB,$BA,$15,$00,$00,$00,$E8,$5E,$F6,$FF,$FF,$03,$C7,
    281.     $8B,$F0,$8B,$04,$24,$01,$58,$0C,$8B,$04,$24,$01,$70,$10,$8B,$04,
    282.     $24,$01,$78,$14,$8B,$04,$24,$01,$68,$18,$8B,$04,$24,$33,$D2,$89,
    283.     $50,$08,$8B,$04,$24,$83,$C0,$1C,$33,$C9,$BA,$40,$00,$00,$00,$E8,
    284.     $B4,$F6,$FF,$FF,$83,$C4,$44,$5D,$5F,$5E,$5B,$C3,$53,$56,$57,$55,
    285.     $51,$8B,$D9,$8B,$F2,$8B,$D6,$C1,$EA,$1D,$01,$13,$8B,$D6,$C1,$E2,
    286.     $03,$01,$53,$04,$3B,$53,$04,$76,$02,$FF,$03,$89,$04,$24,$85,$F6,
    287.     $76,$4F,$B8,$40,$00,$00,$00,$8B,$7B,$08,$2B,$C7,$3B,$C6,$77,$2A,
    288.     $B9,$40,$00,$00,$00,$2B,$4B,$08,$8D,$54,$3B,$1C,$8B,$04,$24,$E8,
    289.     $08,$F6,$FF,$FF,$BD,$40,$00,$00,$00,$2B,$6B,$08,$2B,$F5,$01,$2C,
    290.     $24,$8B,$C3,$E8,$14,$F7,$FF,$FF,$EB,$13,$8D,$54,$3B,$1C,$8B,$04,
    291.     $24,$8B,$CE,$E8,$E4,$F5,$FF,$FF,$01,$73,$08,$33,$F6,$85,$F6,$77,
    292.     $B1,$5A,$5D,$5F,$5E,$5B,$C3,$90,$92,$E8,$CE,$F5,$FF,$FF,$C3,$90,
    293.     $33,$D2,$EB,$0A,$81,$FA,$80,$00,$00,$00,$77,$07,$40,$42,$80,$38,
    294.     $00,$75,$F1,$8B,$C2,$C3,$8B,$C0,$00,$00,$00,$00,$C0,$F3,$18,$00,
    295.     $EC,$F3,$18,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
    296.     $C9,$85,$7D,$75,$A2,$85,$7D,$75,$8F,$17,$01,$CB,$49,$00,$5A,$00,
    297.     $04,$F4,$18,$00,$04,$00,$00,$00,$00,$00,$00,$00,$46,$00,$00,$00,
    298.     $01,$00,$00,$00,$05,$00,$00,$00,$01,$00,$00,$00,$78,$F4,$18,$00,
    299.     $2F,$89,$AE,$75,$8F,$17,$01,$CB,$49,$00,$5A,$00,$04,$F4,$18,$00,
    300.     $04,$00,$00,$00,$98,$00,$00,$00,$E0,$11,$78,$00,$01,$00,$00,$00,
    301.     $13,$00,$00,$00,$04,$00,$00,$00,$04,$00,$00,$00,$43,$00,$00,$00,
    302.     $01,$00,$00,$00,$93,$00,$10,$01,$00,$00,$00,$00,$04,$00,$00,$00,
    303.     $14,$00,$00,$00,$43,$00,$00,$00,$01,$00,$00,$00,$93,$00,$10,$01,
    304.     $00,$00,$00,$00,$04,$00,$00,$00,$05,$00,$00,$00,$01,$00,$00,$00,
    305.     $0F,$00,$00,$00,$93,$00,$10,$01,$00,$00,$00,$00,$46,$00,$00,$00,
    306.     $05,$00,$00,$00,$01,$00,$00,$00,$0F,$00,$00,$00,$93,$00,$10,$01,
    307.     $00,$00,$00,$00,$01,$00,$00,$00,$05,$00,$00,$00,$47,$00,$00,$00,
    308.     $43,$00,$00,$00,$11,$00,$00,$00,$9C,$F4,$18,$00,$04,$8A,$AE,$75,
    309.     $8F,$17,$01,$CB,$04,$00,$00,$00,$93,$00,$10,$01,$49,$00,$5A,$00,
    310.     $01,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$30,$F5,$18,$00,
    311.     $DF,$69,$B1,$75,$63,$51,$E1,$B7,$1C,$CB,$18,$56,$D5,$44,$50,$F4,
    312.     $8E,$BE,$87,$92,$47,$38,$BF,$30,$00,$B2,$F6,$CE,$B9,$2B,$2E,$6D,
    313.     $72,$A5,$65,$0B,$2B,$1F,$9D,$A9,$E4,$98,$D4,$47,$9D,$12,$0C,$E6,
    314.     $56,$8C,$43,$84,$0F,$06,$7B,$22,$C8,$7F,$B2,$C0,$81,$F9,$E9,$5E,
    315.     $3A,$73,$21,$FD,$F3,$EC,$58,$9B,$AC,$66,$90,$39,$65,$E0,$C7,$D7,
    316.     $1E,$5A,$FF,$75,$D7,$D3,$36,$14,$90,$4D,$6E,$B2,$49,$C7,$A5,$50,
    317.     $02,$41,$DD,$EE,$BB,$BA,$14,$8D,$74,$34,$4C,$2B,$2D,$AE,$83,$C9,
    318.     $E6,$27,$BB,$67,$9F,$A1,$F2,$05,$58,$1B,$2A,$A4,$11,$95,$61,$42,
    319.     $CA,$0E,$99,$E0,$83,$88,$D0,$7E,$3C,$02,$08,$1D,$F5,$7B,$3F,$BB,
    320.     $AE,$F5,$76,$59,$67,$6F,$AE,$F7,$20,$E9,$E5,$95,$D9,$62,$1D,$34,
    321.     $92,$DC,$54,$D2,$4B,$56,$8C,$70,$04,$D0,$C3,$0E,$BD,$49,$FB,$AC,
    322.     $76,$C3,$32,$4B,$2F,$3D,$6A,$E9,$E8,$B6,$A1,$87,$A1,$30,$D9,$25,
    323.     $5A,$AA,$10,$C4,$13,$24,$48,$62,$CC,$9D,$7F,$00,$85,$17,$B7,$9E,
    324.     $3E,$91,$EE,$3C
    325.   );
    326.  
    327. procedure RC6Encode(const InData; var OutData; Size:Cardinal; Key:PAnsiChar);
    328. asm
    329.   pushad
    330.   push True
    331.   push key
    332.   push size
    333.   push OutData
    334.   push InData
    335.   call OPCODE
    336.   popad
    337. end;
    338.  
    339. procedure RC6Decode(const InData; var OutData; Size:Cardinal; Key:PAnsiChar);
    340. asm
    341.   pushad
    342.   push false
    343.   push key
    344.   push size
    345.   push OutData
    346.   push InData
    347.   call OPCODE
    348.   popad
    349. end;
    350.  
    351.  
    352. end.
    使用方法:(by cmfc)
    Code (Text):
    1.  
    2. unit Unit1;
    3.  
    4. interface
    5.  
    6. uses
    7.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    8.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
    9.  
    10. type
    11.   TForm1 = class(TForm)
    12.     Button1: TButton;
    13.     Memo1: TMemo;
    14.     Memo2: TMemo;
    15.     Memo3: TMemo;
    16.     procedure Button1Click(Sender: TObject);
    17.   private
    18.     { Private declarations }
    19.   public
    20.     { Public declarations }
    21.   end;
    22.  
    23. var
    24.   Form1: TForm1;
    25.  
    26. implementation
    27.  
    28. {$R *.dfm}
    29.  
    30. uses RC6Dcrypt;
    31.  
    32. procedure TForm1.Button1Click(Sender: TObject);
    33. var
    34. InDataStr,OutDataStr :string;
    35. Size,i : integer;
    36. Key :PAnsiChar;
    37. InData,OutData: array[0..1024] of byte;
    38. begin
    39.   InDataStr:= Memo1.Text;
    40.  
    41.   Size:=length(InDataStr);
    42.   Key :='abcd';
    43.  
    44.   for i := 0 to size-1 do
    45.     InData[i]:=byte(InDataStr[i+1]);
    46.  
    47.   RC6Encode(InData,OutData,Size,Key);
    48.   OutDataStr:='';
    49.   for i := 0 to size-1 do
    50.     OutDataStr := OutDataStr + InttoHex(OutData[i],2);
    51.   Memo2.Text:=OutDataStr;
    52.  
    53.   RC6Decode(OutData,InData,Size,Key);
    54.   InDataStr:='';
    55.   for i := 0 to size-1 do
    56.     InDataStr := InDataStr + chr(InData[i]);
    57.   Memo3.Text:=InDataStr;
    58. end;
    59.  
    60. end.
    61. [/i][/i][/i]
     
  2. seling

    seling New Member Member

    Country:
    China
    很不错。 加密算法。 收藏起来。楼主辛苦了