【发布时间】:2015-06-11 19:30:54
【问题描述】:
请帮忙。如何在加密和解密中制作数组?
<?php
class DES{
function encrypt($plainText, $cipherKey){
//plainText
$result = $this->toBiner($plainText);
$result = $this->InitialPermutation($result);
//key
$key = $this->toBiner($cipherKey);
$key = $this->kompresBit($key);
$arrLeftShift = $this->LeftShift($key);
//final
$result = $this->keyExpansion($result, $arrLeftShift);
return $result;
}
function decrypt($encryptedText, $cipherKey){
$key = $this->toBiner($cipherKey);
$key = $this->kompresBit($key);
$arrLeftShift = $this->LeftShift($key);
$result = $this->reverseKeyExpansion($encryptedText, $arrLeftShift);
$result = $this->revInitialPermutation($result);
【问题讨论】:
-
你的代码有什么问题?这行得通吗?它不工作吗?你看到任何错误吗?您需要什么帮助?