c php, .
, , A, , B.
( ):
1) , (B), A (, ) . .. B.
2) , (B). ().
, :
server_b_1 testGetDataFromA.php
server_a_1 testPushDataToB.php
Encode.php, , , server_a_1 server_b_1 ( ). .
:
, . , , (X) ( ) . , . , . , , , ( ).
,
php Mcrypt :
$encrypted_data = urlencode(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sinc_key, $notice_text, MCRYPT_MODE_ECB)));
$test_decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256,$sinc_key, base64_decode(urldecode($encrypted_data)),MCRYPT_MODE_ECB));
php OpenSSL
:
, , .
1) , (B), A (, ) . .. B.
:
B ( ) A, ( ). , N. , N. B . . .
, A , - . :
( server_b_1/testGetDataFromA.php)
SIGNATURE_KEY, . B ( ), (http://.../server_a_1/getDataToB.php) A, ( ). , N. M, md5 SIGNATURE_KEY . , N. B , , ( md5 SIGNATURE_KEY ). ( , A SIGNATURE_KEY, ), N.
2), (B). ().
:
B A B . ( ) B. A , . , .
, B, - . :
( server_a_1/testPushDataToB.php)
SIGNATURE_KEY, . A, md5 SIGNATURE_KEY ( ) B (http://.../server_b_1/get_public_key.php), md5 SIGNATURE_KEY . , A, - , B, A ( , ). md5 SIGNATURE_KEY . . , md5 A. A, SIGNATURE_KEY md5 , B, .
A ( ) , md5 SIGNATURE_KEY . B. B (http://.../server_b_1/pushDataFromA.php), SIGNATURE_KEY md5, , , - . , .
, - .
->
( )
https://habrahabr.ru/post/330792/