unit Unit2;
interface
uses
Controls,
Classes,
SysUtils;
// 加密方法一(通过密钥加密解密)
function EncryptString(Source, Key: string): string;
function UnEncryptString(Source, Key: string): string;
//加密方法二(通过移位加密解密)
function Encode(Str: string): string;
function Decode(Str: string): string;
//加密方法三(异或加密解密)
function Enc(str: string): string;
function Dec(str: string): string;
implementation
var XorKey: array[0..7] of Byte = ($B2, $09, $AA, $55, $93, $6D, $84, $47);
function EncryptString(Source, Key: string): string;
// 对字符串加密(Source:源 Key:密匙)
var
KeyLen: integer;
KeyPos: integer;
Offset: integer;
Dest: string;
SrcPos: integer;
SrcAsc: integer;
Range: integer;
begin
KeyLen := Length(Key);
if KeyLen = 0 then
Key := 'delphi';
KeyPos := 0;
Range

这个博客提供了三种Delphi语言实现的加密解密方法,包括通过密钥加密解密、移位加密解密和异或加密解密。每个方法都有对应的加密和解密函数,如EncryptString和UnEncryptString,Encode和Decode,以及Enc和Dec。
最低0.47元/天 解锁文章
1173

被折叠的 条评论
为什么被折叠?



