Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

Code-archived

加密算法的Pascal实现

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

加密算法的Pascal实现

DES库

将DES的代码改了改,改为位运算实现,速度快了几十倍(怀疑那个时候的水平)。

另外,根据hash计算的补位,更加合理的设计了文本和密钥的补位。

函数:

text表示要加/解密的文本,key表示密钥,encryption为true是加密、为false是解密。

pascal
function DES_64bit(text,key:string;encryption:boolean):string;

64位的二进制加密,最原始的DES加密。

pascal
function DES(text,key:ansistring;encryption:boolean):ansistring;

DES文本加密。

pascal
function DES_hex(text,key:ansistring;encryption:boolean):ansistring;

DES十六进制加密。加密后的文本以十六进制形式显示。