要求:1,入口是一个数组,如array[1..400] of char 出口是一个数组如 array[1..400] of char
2,每个字节先异或0x9f,然后高4位,低四位交换顺序。
3,入口参数array[1..400] of char如果400字节的空间只用了100字节,那么剩下的300字节初值也加密
3,有加密和解密的算法。谢谢
2,每个字节先异或0x9f,然后高4位,低四位交换顺序。
3,入口参数array[1..400] of char如果400字节的空间只用了100字节,那么剩下的300字节初值也加密
3,有加密和解密的算法。谢谢
解决方案 »
- 帮我看看这代码怎么改?多条件查询
- 写手机壁纸制作的工具遇到几个问题
- 线程中使用非阻塞式SOCKET,切换输入法时造成死机!!!
- 关于DateTimePicker控件的使用问题?
- 为什么这样插不了Jpeg格式的图片到数据库中
- 使用UEDIT32的朋友快来,我有好东东送给大家,同时散分!!
- DELPHI里面数据库访问的问题!!!!!!!!!!!!!!!!
- 预览和打印树
- array[1..3]of byte 内容以'mm:ss'表示出来.怎么写
- 谁能给我一个delphi连接access数据库的实例,小弟万分感谢!!!!!!!!!!!!!
- 如何用txmldocument生成以下xml文档?多谢大家喽,
- 新手请教一个Delphi中与ACCESS连接的问题!
type
TData=array[0..DATA_SIZE-1] of char;
procedure Encrypt(var Input:TData;var Output:TData);
asm
mov ecx,DATA_SIZE
mov esi,Input
mov edi,Output
@next:
mov al,[esi+ecx-1]
xor al,$9f
rol al,4
mov [edi+ecx-1],al
loop @next
ret
end;
procedure Decrypt(var Input:TData;var Output:TData);
asm
mov ecx,DATA_SIZE
mov esi,Input
mov edi,Output
@next:
mov al,[esi+ecx-1]
rol al,4
xor al,$9f
mov [edi+ecx-1],al
loop @next
ret
end;
const DATA_SIZE=400;
type
TData=array[0..DATA_SIZE-1] of Char;
procedure Encrypt(const Input:TData;var Output:TData);
var i:Integer;C:Byte;
begin
for i:=Low(Input) to High(Input) do
begin
C:=Byte(Input[i]) xor $9f;
Output[i]:=Char(((C and $f) shl 4) or (C shr 4));
end;
end;
procedure Decrypt(const Input:TData;var Output:TData);
var i:Integer;C:Byte;
begin
for i:=Low(Input) to High(Input) do
begin
C:=Byte(Input[i]);
C:=((C and $f) shl 4) or (C shr 4);
Output[i]:=Char(C xor $9f);
end;
end;
这句写的好!