我有2個PHP頁面,在該頁面1加密字符串onLoad
,加密字符串將通過URL傳遞到第2頁。偶爾openssl_decrypt錯誤:「未能爲base64解碼輸入」
偶爾(大約8選1)第2頁無法解密字符串,並給了我此錯誤消息:failed to base64 decode the input ...
這裏是我使用的是什麼:
- 加密方法:
AES-128-CBC
- 四:
openssl_random_pseudo_bytes(16);
這裏有一些廣告ditional信息:
- PHP 5.4.16
- 的nginx 1.8.0
- CentOS的7
有什麼建議嗎?
聽起來像一個URL編碼問題給我。你可以通過提供一個失敗的例子來幫助我們確認。它可能包含一個'+'或'='符號或一些這樣的,而其他工作正常的例子不。如果您提供了用於將字符串放入URL的代碼,那麼它也會有所幫助,因此我們可以看到它是否正確編碼。 – Simba
你是對的,那就是問題所在。我將包括我在下面解決它的方式。 – ioojimooi