求解地图经纬度加解密方法?

jyb_9 2012-09-10 10:14:41
如题:求解百度地图经纬度加解密方法
...全文
451 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
广州佬 2012-09-15
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]
加密码的不正准啊
[/Quote]
我回应你的问题,都能不厌其烦的,你就不能敲多几个键,把如何“不准”说说吗?你试过我在4楼的回复否?
jyb_9 2012-09-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
抱歉,注释错了:是“纬度”,不该是“维度”。
[/Quote]

加密码的不正准啊
山东蓝鸟贵薪 2012-09-10
  • 打赏
  • 举报
回复
不会吧,百度的呀,
你还是直接问题百度技术人员吧
广州佬 2012-09-10
  • 打赏
  • 举报
回复
噢,少考虑了0的值,勘正:

......
var
Form1: TForm1;

implementation

const Secretkey='9762801435';
var wd_Encryption,jd_Encryption,
wd_Decrypt,jd_Decrypt:string;

{$R *.dfm}

function TForm1.Encryption(s: ansistring): ansistring;//加密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ Secretkey[strtoint(s[i])+1];
end;
except
Result:='';
end;
end;

function TForm1.Decrypt(s: ansistring): ansistring;//解密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ inttostr(pos(s[i],Secretkey)-1);
end;
except
Result:='';
end;
end;

procedure TForm1.Button1Click(Sender: TObject);//获取加密后的坐标
begin
wd_Encryption:=Encryption(centerweidu.innerText);//经度
jd_Encryption:=Encryption(centerjingdu.innerText);//纬度
end;

procedure TForm1.Button2Click(Sender: TObject);//获取解密后的坐标
begin
wd_Decrypt:=Decrypt(wd_Encryption);//经度
jd_Decrypt:=Decrypt(jd_Encryption);//纬度
end;
......
广州佬 2012-09-10
  • 打赏
  • 举报
回复
抱歉,注释错了:是“纬度”,不该是“维度”。
广州佬 2012-09-10
  • 打赏
  • 举报
回复
最简单的,就是使用查表法:

......
var
Form1: TForm1;

implementation

const Secretkey='9762801435';
var wd_Encryption,jd_Encryption,
wd_Decrypt,jd_Decrypt:string;

{$R *.dfm}

function TForm1.Encryption(s: ansistring): ansistring;//加密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ Secretkey[strtoint(s[i])];
end;
except
Result:='';
end;
end;

function TForm1.Decrypt(s: ansistring): ansistring;//解密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ inttostr(pos(s[i],Secretkey));
end;
except
Result:='';
end;
end;

procedure TForm1.Button1Click(Sender: TObject);//获取加密后的坐标
begin
wd_Encryption:=Encryption(centerweidu.innerText);//经度
jd_Encryption:=Encryption(centerjingdu.innerText);//维度
end;

procedure TForm1.Button2Click(Sender: TObject);//获取解密后的坐标
begin
wd_Decrypt:=Decrypt(wd_Encryption);//经度
jd_Decrypt:=Decrypt(jd_Encryption);//维度
end;
......

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧