本文主要是关于php的des加解密方法代码内容,有需要的朋友可以参考一下。
test.php测试文件
'AbcdefghijklmnopqrstuvwX','secretcode'=>'Abcdefgh']; $encode = $des->encode($data, $conf); print_r($encode); echo "
"; $decode = $des->decode($encode,$conf); print_r($decode); ?>
Des.php
用 php + mysql 驱动的在线商城系统,我们的目标为中国的中小企业及个人提供最简洁,最安全,最高效的在线商城解决方案,使用了自建的会员积分折扣功能,不同的会员组有不同的折扣,让您的商店吸引更多的后续客户。 系统自动加分处理功能,自动处理会员等级,免去人工处理的工作量,让您的商店运作起来更方便省事 采用了自建的直接模板技术,免去了模板解析时间,提高了代码利用效率 独立开发的购物车系统,使用最
encode($data, $configKey["appkey"], $configKey["secretcode"]);
}
public static function decode($data, $configKey) {
$tripleDes = new TripleDES();
return $tripleDes->decode($data, $configKey["appkey"], $configKey["secretcode"]);
}
public static function encodeArr($data, $configKey) {
$data = json_encode($data);
return self::encode($data, $configKey);
}
public static function decodeArr($data, $configKey) {
$res = self::decode($data, $configKey);
return json_decode($res,true);
}
}相关教程:PHP视频教程










