谁会解码Base64

zs8816685 2004-04-15 03:51:17
或知道idbase64encoder怎样使用?
...全文
65 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinawzg 2004-04-25
  • 打赏
  • 举报
回复
Base64加密原理

BaseTable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';



implementation

{$R *.dfm}

function EncodeBase64(Source:string):string;
var
Times, LenSrc, i: Integer;
x1, x2, x3, x4: Char;
xt: Byte;
begin
Result := '';
LenSrc := Length(Source);
if LenSrc mod 3 = 0 then
Times := LenSrc div 3
else
Times := LenSrc div 3 + 1;
for i := 0 to Times - 1 do
begin
if LenSrc >= (3 + i * 3) then
begin
x1 := BaseTable[(ord(Source[1 + i * 3]) shr 2)+1];
xt := (ord(Source[1 + i * 3]) shl 4) and 48;
xt := xt or (ord(Source[2 + i * 3]) shr 4);
x2 := BaseTable[xt + 1];
xt := (Ord(Source[2 + i * 3]) shl 2) and 60;
xt := xt or (Ord(Source[3 + i * 3]) shr 6);
x3 := BaseTable[xt + 1];
xt := (ord(Source[3 + i * 3]) and 63);
x4 := BaseTable[xt + 1];
end
else if LenSrc >= (2 + i * 3) then
begin
x1 := BaseTable[(Ord(Source[1 + i * 3]) shr 2) + 1];
xt := (Ord(Source[1 + i * 3]) shl 4) and 48;
xt := xt or (Ord(Source[2 + i * 3]) shr 4);
x2 := BaseTable[xt + 1];
xt := (Ord(Source[2 + i * 3]) shl 2) and 60;
x3 := BaseTable[xt + 1];
x4 := '=';
end else
begin
x1 := BaseTable[(Ord(Source[1 + i * 3]) shr 2)+1];
xt := (Ord(Source[1 + i * 3]) shl 4) and 48;
x2 := BaseTable[xt + 1];
x3 := '=';
x4 := '=';
end;
Result := Result + x1 + x2 + x3 + x4;
end;
end;

huhaojie 2004-04-16
  • 打赏
  • 举报
回复
to:zs8816685 (新兵)
indy mics 页上
zs8816685 2004-04-16
  • 打赏
  • 举报
回复
哪里有IdDecoderMIME组件?
huhaojie 2004-04-16
  • 打赏
  • 举报
回复
原串:=IdDecoderMIME1.DecodeString(编码串);
zs8816685 2004-04-15
  • 打赏
  • 举报
回复
以什么关键字找比较好找?
cnham 2004-04-15
  • 打赏
  • 举报
回复
=?GB2312?Q?
是个固定的格式
如果含有这个表明该邮件头是用QP加密的

你去找个解密的代码来看就知道了怎么解密了
很多文档的
在csdn搜索页面中有很多:www.csdn.net/search.asp
lance09 2004-04-15
  • 打赏
  • 举报
回复
你上面的就没有办法了

解码出来是

駚踼v?
zs8816685 2004-04-15
  • 打赏
  • 举报
回复
像邮件头 "=?GB2312?Q?=BE=FD=BE=FD?=" <jun@proway.com>
这样的文本

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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