我一直在尝试向我的网站添加投票者功能,但到目前为止,一点运气都没有。我的问题是使用 openssl_public_encrypt 的加密返回一个空响应。
这是我的代码: http: //pastebin.com/wakjcxSF 我这样称呼它:
$vote = new Vote(USERNAME, SERVERIP, SERVERPORT, VOTIFIERKEY);
$vote->castVote();
print_r 的输出:
0
VOTE Something test 127.0.0.1 1376050280
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiRda9+W9mXLz1Mvc4hXMo rea2NPPJVgbQCypwpgIUK0Q7vQ2sK+Om2yCyTtwIvdOCAa1Uh+cX2Drs3xHkPutw/ rkTiFEWWQ3ol3jxMm+5BXUSESSK+P26nr7JvFddnOdVM1FFVCwFXYmYIwigeXK3lO qrOLFdxVEbpG5wEcNPOVIqq1RKfKQIFGvYfIVpRCaj3yMRlSK4S1jQtlqMy5Tnva+ xqaFjEHN2QJRwLecmkPnGsWicEfoc+khV64/06YKg5Becqx69sS+snY8SM1E/atZk b/eqm165A7Awzw3e9Fl2Uk4F7kUwrRGZDjzu6knr6Vr13slXDxzEKd33xv8/QIDAQ AB -----END PUBLIC KEY-----
原始公钥:
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiRda9+W9mXLz1Mvc4hXMorea2NPPJVgbQCypwpgIUK0Q7vQ2sK+Om2yCyTtwIvdOCAa1Uh+cX2Drs3xHkPutw/rkTiFEWWQ3ol3jxMm+5BXUSESSK+P26nr7JvFddnOdVM1FFVCwFXYmYIwigeXK3lOqrOLFdxVEbpG5wEcNPOVIqq1RKfKQIFGvYfIVpRCaj3yMRlSK4S1jQtlqMy5Tnva+xqaFjEHN2QJRwLecmkPnGsWicEfoc+khV64/06YKg5Becqx69sS+snY8SM1E/atZkb/eqm165A7Awzw3e9Fl2Uk4F7kUwrRGZDjzu6knr6Vr13slXDxzEKd33xv8/QIDAQAB
我使用了本教程:http ://topg.org/php_votifier 。
我试图在谷歌上环顾四周,但问题是无效的关键问题。结果:google (com)/search?q=Votifier+PHP+Encryption&oq=Votifier+PHP+Encryption&aqs=chrome.0.69i59j69i60j69i62l2.6301j0&sourceid=chrome&ie=UTF-8#bav=on.2,or.r_cp.r_qf.&fp= 917b53cc1ec39b52&q=Votifier+PHP+Encryption 也发现了这个:teamavolition (com)/topic/14380-solved-php-rsa-encryptions-votifier/
最好的问候,-ImThatPedoBear