CryptoJS 解码 PHP

CryptoJS decode PHP

可以用下面的代码解码,但我想在PHP中这样做。我该怎么做?

有个PHPclass,但是需要iv之类的信息,不知道怎么解码

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script type="text/javascript">
var bytes  = CryptoJS.AES.decrypt("U2FsdGVkX1/q1v3+WzARwxPwzV6PQ6cUzkmiPwZr6ZI8xBTjVasCX7H9eAhxDyaYe4A68Pqf3EwYoYU/g3YJVDHIB04rMuBfXePSxRoHlenWHOlthU5EXLksWbv6AyA86EVgKG1xF+6TOnkZtRSPJUaaDys2k70hS0M2dUqm1gZCkz6Om/1rOUbaUayAa7TyX6EV6BWN5XIZPXzfQX8SfSsmtuaEwyJjhShnDnSbvML9hwGtnYiI+hCdqRiLRSWUzdmrqZv56hcmBX1vzEs0DwoEkP0myYJ1jOFVTHnGCFG7KgxS5QD1Rfw75Q2PhSqJiG8DdrDUihxkjAizsLDypSEuQVgDmDInKa+nUJ8Z2qb836hjuYQnIguyRPdE/DloFDVEB5CVATUJcxngN59yB3k/q5lMLbv7OSQUCbhaMQ9f01kN1UFrLXn/N+818/cM4rdbk5+YP3S84o7yoUMNoSDKCOtIEAxPQFou/XgLQ+UjgNyXO6U2snma9Wr75ocY9Bz65KgT5/lEh1Wcj3r5uDDp8hDBsd7p+zOq+6TMCCqIUQ/UGB0uC7zgyz0Q8w2zAtlPttrdXcKfsPxuzCtcABEZrQ5RXVayiVEc+urKAocFDV2bW8xwRJ0HZPkN5s9o7MygutsthsIke11zZgYbfgwns2s/tsxVuJIyESF71EL28nZ+f8LFERFvfEbX/aC23WNotFuqjfRt/rNga48hJ8jcA1q5X58rCJSWBtuHdlFYIzz/Sp6s4tceec2AbQpG0eybaP3ZflnQxVyC9tkFBDinUbosJJOUp2YSAN7fGtehzR96K/rKHqp2qpIF1mv9D7gFk3N+EKqZ8LOQuMBjQZtMPPOJN4p8tuN6XyHJRb7g+NRrLUEItwDVa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cs=");
document.write(bytes.toString(CryptoJS.enc.Utf8));
</script>

CryptoJS.decrypt()中,如果第二个参数作为字符串传递,CryptoJS uses the OpenSSL function EVP_BytesToKey作为密钥推导函数,推导出一个32字节的密钥和一个16字节的IV。

为了解密,PHP中也必须使用这个推导函数。 PHP 的网络上有几种(大部分是简化的)实现,例如 here,其中 CryptoJS 使用 MD5 而不是 SHA256。

加密时,CryptoJS.encrypt()生成一个8字节的盐,包含在第一个块的后半部分(字节8到16),前半部分对应[=14=的ASCII编码值].这个盐也必须测定。

一个可能的 PHP 实现可以是:

// from: https://gist.github.com/ezimuel/67fa19030c75052b0dde278a383eda1b
function EVP_BytesToKey($salt, $password) {
    $bytes = "";
    $last = "";

    // 32 bytes key + 16 bytes IV = 48 bytes.
    while(strlen($bytes) < 48) {
        $last = hash('md5', $last . $password . $salt, true);
        $bytes.= $last;
    }
    return $bytes;
}      
       
$dataB64 = "U2FsdGVkX1...";

// Separate salt and ciphertext
$data = base64_decode($dataB64);
$salt = substr($data,8,8);
$ciphertext = substr($data,16);

// Determine key and IV
$passphrase = "U2FsdGVkX1/FhXfmnDLMdW/zwst2X9dIxPuBfc876cs=";
$keyiv = EVP_BytesToKey($salt, $passphrase);
$key = substr($keyiv, 0, 32);
$iv = substr($keyiv, 32, 16);

// Decrypt
$decrypted = openssl_decrypt($ciphertext, "aes-256-cbc", $key, OPENSSL_RAW_DATA, $iv);
print($decrypted);

成功解密密文

请注意,专有 EVP_BytesToKey 被视为 insecure,最好使用 PBKDF2 等标准进行密钥派生。