Java — PHP Android RSA проблемы со связью

Исправлена ​​первоначальная проблема (попытка сделать простой RSA-блок данных), но все еще есть проблемы

Обновлены все 4 ключа, код Java и новые ошибки вывода из Java


Я перепробовал все, что потратил последние 48 часов, так чертовски тяжело, чтобы понять все это. До степени составления страницы на сервере с подробным описанием ситуации.

Короче говоря, у меня отлично работает шифрование на сервере с php, я просто не могу расшифровать клиентскую часть (еще не пробовал шифровать), я получаю так много ошибок, текущие данные большие для блока RSA, но я Тройной проверил все мои кодировки, и я просто не могу найти что-нибудь.

Использование spongycastle на Java и phpseclib 3.8

http://lunarmessaging.net/test.php

(3 ссылки на базовый бин для шифрования / дешифрования PHP, и супер простое приложение для Android, которое я сделал, чтобы проверить это)

я так потерян здесь, это даже не смешно

Редактировать: обновлено с максимально возможной информацией

В основном я создаю массив с ключами для вызова функции на сервере

{«CLASS»: «test», «FUNCTION»: «helloWorld», «ARGS»: {«value1»: «derp», «value2»: «boogah boogah boogah»}}

  1. Превратился в JSON из массива
  2. Зашифрованный с открытым ключом сервера, это становится полезной нагрузкой
  3. Base64 пользовательский открытый ключ, становится ответом
  4. Создайте объект JSON с обоими из них и Base64 / Urlencode
  5. Вызов URL с причудливыми Зашифрованные API IE: lunarmessaging.net/api/encrypted/eyJFTkNSWVBUSU9OIjoxLCJSRVNQT05TRSI6IkxTMHRMUzFDUlVkSlRpQlFWVUpNU1VNZ1MwVlpMUzB0TFMwTkNrMUpSMlpOUVRCSFExTnhSMU5KWWpORVVVVkNRVkZWUVVFMFIwNUJSRU5DYVZGTFFtZFJRMjVJVHpock1GRlFWVEpFVUV4UFVERk9jMHBwZDBsdFNXTU5Da0V4ZWpkTlprOUZkRkpXYjFobll6WmpNMjlWVDJkMldtaG9MMGxoZURGT1ZsZDVOWFZxYWpGUlducGhkazh5UVRndmVHdDRlRVJWTjNaNWF5dHpialVOQ2tGeVprTllhbGMxZDBWdWVVWTBURmc1YVhselFTODBTMVIzU3lzd2RWVkhVMGRJTVU1SVV5c3lWa2haVG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3QqK33cBEyIenFGi+V\/7JZFSQq\/6W8UlWLwdZH4n\/fMIMsEHD\/EpOQxZ7rtHEaGqZxRjg8YyecgUvYozpxm9kdxPBBIhXT2xUvpx08WJkvPqIWhR6ykS7RHvvJ3Tsz0ODvRHeHIARetrCdNLM\/z9c61xFh9vo1EGcqfBMso385M6telcOOsBeDA4\/mM6oa1d8wWOseQRnEOzTaSooIDR\/O6\/G382t5Xqf5df1JdD9dUvcrju3RvEKR+wuHJjvISCcvQ1uYf9y\/mNuA+6Vib1BJWdUNLCj7abJoxWe31RU60lktx7WxV8GG3d+rLFnBg=="}
  1. Затем сервер полностью переворачивает весь процесс, вызывая в основном открытый текст API ПРИМЕР URL IE: lunarmessaging.net/api/test/helloWorld/value1/derp/value2/boogah%20boogah%20boogah

пример ответа выглядит так

{
value1: "derp",
value2: "boogah boogah boogah",
test: "Hey It Works",
exit: {
code: 0,
message: ""}
}
  1. Повторяет описанный выше процесс (соответственно с userpub / serverpub), и это данные, которые вы видите на вышеупомянутом зашифрованном URL

ПРИМЕРЫ КОДА И БОЛЬШЕ (пример ключей в конце)

тестовое шифрование (php, аналогичное шифрованию пользователя)

`

<?php
$callData = array(  "CLASS" => "test", "FUNCTION" => "helloWorld", "ARGS" => array( "value1" => "derp", "value2" => "boogah boogah boogah" ));

$rsa = new Crypt_RSA();
$rsa->setPrivateKeyFormat(CRYPT_RSA_PRIVATE_FORMAT_PKCS1);
$rsa->setPublicKeyFormat(CRYPT_RSA_PUBLIC_FORMAT_PKCS1);

$rsa->loadKey($srvPub);
$serverData = base64_encode( $rsa->encrypt( json_encode($callData)));

$serverData = array("ENCRYPTION" => 1, "RESPONSE" => base64_encode($usrPub), "PAYLOAD" => $serverData);

$serverData = base64_encode( json_encode( $serverData));
$serverData = urlencode($serverData);

$url = $baseURL."api/encrypted/".$serverData;
?>`

сервер, расшифровывающий запрос (ОБА ФУНКЦИЯ PHP ФУНКЦИИ КАК ХОЧЕТСЯ)

`

<?php
//start RSA and do a general decode of the message
$rsa = new Crypt_RSA();
$rsa->setPrivateKeyFormat(CRYPT_RSA_PRIVATE_FORMAT_PKCS1);
$rsa->setPublicKeyFormat(CRYPT_RSA_PUBLIC_FORMAT_PKCS1);

$inputData = json_decode( base64_decode( $_GET['encrypted']), true);

//decrypt the payload sent to the server
//this is our client -> server encryption
$rsa->loadKey($srvPriv);
$payload = json_decode( $rsa->decrypt ( base64_decode( $inputData['PAYLOAD'])), true);
$response = base64_decode( $inputData['RESPONSE']);

//Call the function based on the sent information
//this is the stage where its plaintext on the server
$serverCall = rest::callFunction($payload);
//var_dump($payload);

//generate a response for the client
$rsa->loadKey($usrPub);
$serverCall = base64_encode( $rsa->encrypt( json_encode($serverCall)));

$backToUser = array(    "ENCRYPTION" => 2,
"RESPONSE" => base64_encode($srvPub),
"PAYLOAD" => $serverCall);

$backToUser = json_encode($backToUser);
echo $backToUser;
?>`

Java-приложение

`
пакет lunar.messaging.apitest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Security;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Arrays;
import java.util.concurrent.ExecutionException;

import javax.crypto.Cipher;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.JSONException;
import org.json.JSONObject;
import org.spongycastle.asn1.DERNull;
import org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.spongycastle.asn1.pkcs.PrivateKeyInfo;
import org.spongycastle.asn1.pkcs.RSAPrivateKey;
import org.spongycastle.asn1.x509.AlgorithmIdentifier;
import org.spongycastle.crypto.AsymmetricBlockCipher;
import org.spongycastle.crypto.engines.RSAEngine;
import org.spongycastle.crypto.params.AsymmetricKeyParameter;
import org.spongycastle.crypto.util.PrivateKeyFactory;
import org.spongycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateKey;
import org.spongycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey;
import org.spongycastle.openssl.PEMParser;
import org.spongycastle.util.io.pem.PemReader;

import android.support.v7.app.ActionBarActivity;
import android.net.ParseException;
import android.net.http.AndroidHttpClient;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.util.Xml.Encoding;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends ActionBarActivity {static {
Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}public void encryptedTest(View view) throws Exception {

//String usrPriv = "-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQCDbFBVWh94E0/2tmAZJ0E0oeX3DHuz/s2URtfJUTX5P7sp5MgDzKQ5kWdXbPPprG9d9QGl9koQFkMvaPZQScvUH/yGHEKyoYQLJfzWA85L1uliSmPtwb/5R26gLS9xqjetCV+VJpIXQ7FwUTkH0fFFpgMrbNASYIarPku7bfv+3wIDAQABAoGAA3J43PRDNQwUod0AwkgkTrQcaxF5wSviyovdJxupNcN1LlEg6fCZMiVdN47VCwEJ3sYJaAgAw1FCK+Et7McywHCS3Cw61vy/vt5+q9LwYE5x+5NhbJOV6UPgR34F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8gEcXNyZbdiykF9 9fu22WRzUgscoufDNor59UHaPns3pe2THbEtENyXmqb2488j9zXGFCRKjQJAV85p ae0BowZcyBF19ouG10kmT6+B+d9HQOiMPLBSeJ5f3VD8ghi6obuxlPdIZB/ojdSA PoL3530UCqkXrM9qFQJANy5KrTAtH4mTY7KW9BymA8bQRVBgQdAvNRCsBOCjnIPj M26rCOjS1BbrmuHKtoZztQeH9G+cu/iFtCPAvf0eig==";

String usrPriv = "MIICWwIBAAKBgQCDbFBVWh94E0/2tmAZJ0E0oeX3DHuz/s2URtfJUTX5P7sp5MgDzKQ5kWdXbPPprG9d9QGl9koQFkMvaPZQScvUH/yGHEKyoYQLJfzWA85L1uliSmPtwb/5R26gLS9xqjetCV+VJpIXQ7FwUTkH0fFFpgMrbNASYIarPku7bfv+3wIDAQABAoGAA3J43PRDNQwUod0AwkgkTrQcaxF5wSviyovdJxupNcN1LlEg6fCZMiVdN47VCwEJ3sYJaAgAw1FCK+Et7McywHCS3Cw61vy/vt5+q9LwYE5x+5NhbJOV6UPgR34FClZSPA7ELZmaK5IKh97+eAyTsUcOJxejwWeoBLQdHZqrNWkCQQCHzDl3cvdzYDC0c07CLhsZjhTm4BMM/+oT3wOhAYA70ti7s0JEcwCB7bYkVE2ZLUFGgLk+emG7pIfXI9NUmIILAkEA98DLERPBy0tf/gpy6W7cLXQFQWlaLvGsWQI6XL4MVSP9tD8bqk8qYiPx8ZI3m9ane3FyXF/1iNKYvDfiLKCu/QJAOMmQZoEvNZJOC8gEcXNyZbdiykF99fu22WRzUgscoufDNor59UHaPns3pe2THbEtENyXmqb2488j9zXGFCRKjQJAV85pae0BowZcyBF19ouG10kmT6+B+d9HQOiMPLBSeJ5f3VD8ghi6obuxlPdIZB/ojdSAPoL3530UCqkXrM9qFQJANy5KrTAtH4mTY7KW9BymA8bQRVBgQdAvNRCsBOCjnIPjM26rCOjS1BbrmuHKtoZztQeH9G+cu/iFtCPAvf0eig==";apiRequest testAsynch = new apiRequest();
String urlRequ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catch (InterruptedException e) {
urlRequest = "Fail 1";
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
urlRequest = "Fail 2";
}

JSONObject responseJSON = null;
String response = null;
String payload = null;

try {
responseJSON = new JSONObject(urlRequest);
response = responseJSON.getString("RESPONSE");
payload = responseJSON.getString("PAYLOAD");
} catch (JSONException e) {
e.printStackTrace();
}

Log.d("[ENCRYPTION]", "Response: " + response);
Log.d("[ENCRYPTION]", "Payload: " + payload);byte[] derp = Base64.decode(payload, Base64.DEFAULT);
Log.d("[payload]",Arrays.toString(derp));

String welp = decrypt(usrPriv,payload);
Log.d("[OUTPUT]", " " + welp);
}

public String decrypt (String privateKeyin, String encrypted){

try {

Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider());

String value = "";
String key = privateKeyin;
Log.d("CRYPT", "started");

AsymmetricKeyParameter privateKey =
(AsymmetricKeyParameter) PrivateKeyFactory.createKey(Base64.decode(privateKeyin, Base64.DEFAULT));

AsymmetricBlockCipher e = new RSAEngine();

Log.d("CRYPT", "created param");
//e = new org.spongycastle.crypto.encodings.PKCS1Encoding(e);
//e = new org.spongycastle.crypto.engines.RSAEngine();
e = new org.spongycastle.crypto.encodings.PKCS1Encoding(e);
//e = new org.spongycastle.crypto.encodings.OAEPEncoding(e);
e.init(false, privateKey);

String inputdata = encrypted;
byte[] messageBytes = Base64.decode(inputdata.getBytes("UTF-8"), Base64.DEFAULT);

Log.d("CRYPT", "decoding payload");

int i = 0;
int len = e.getInputBlockSize();
while (i < messageBytes.length)
{
if (i + len > messageBytes.length)
len = messageBytes.length - i;

byte[] hexEncodedCipher = e.processBlock(messageBytes, i, len);
value = value + new String(hexEncodedCipher);
i += e.getInputBlockSize();
}
Log.d("CRYPT", "printing output");

System.out.println(value);

return value;
}
catch (Exception e) {
System.out.println(e);
}
return null;
}

public static String getHexString(byte[] b) throws Exception {
String result = "";
for (int i=0; i < b.length; i++) {
result +=
Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );
}
return result;
}

public static byte[] hexStringToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i+1), 16));
}
return data;
}
}class apiRequest extends AsyncTask<String, Integer, String>
{
protected void onPreExecute (){
//Log.d("PreExceute","On pre Exceute......");
}

@Override
protected String doInBackground(String...arg0) {
//Log.d("[INFO]",arg0[0]);

String response = postData(arg0[0]);

//Log.d("[INFO]","END TESTING HTTP");

return response;
}

protected void onPostExecute(String result) {
//Log.d("onPostExecute",""+result);
}

public String postData(String url) {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);

try {
// Execute HTTP Request
HttpResponse response = httpclient.execute(httppost);
InputStream stream = null;
String result = null;

String encoding = EntityUtils.getContentCharSet(response.getEntity());
encoding = encoding == null ? "UTF-8" : encoding;

try {
stream = AndroidHttpClient.getUngzippedContent(response.getEntity());
} catch (IOException e1) {
e1.printStackTrace();
}
InputStreamEntity unzEntity = new InputStreamEntity(stream,-1);

try {
result = EntityUtils.toString(unzEntity, encoding);
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

return result;

} catch (ClientProtocolException e) {
} catch (IOException e) {
}
return null;
}
}`

трассировка стека Java

11-12 13:56:22.092: D/[ENCRYPTION](13919): Response: LS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tIE1JR0pBb0dCQUpCZk40cFpxQmdpb3Q1NThCd1VZWitmNlNuc2ZvanZ0RDBUVkxlV2tnYkVSU1pKNTV3c3dzTGsgc3MrcmZadGtNL1E0QlhKMnI5bWI3RUlZYVphUkRXVFZta3I2RzRMM041WXZIRlVWZUhyczEveXpWZDBBNGoycyBkZFI5clUvYTZUQWN3Z3FmUTJtTUFVM01HcGZhRTJZVTBSN2VpMGxEQUY2V2RFQ1MyRXh6QWdNQkFBRT0gLS0tLS1FTkQgUlNBIFBVQkxJQyBLRVktLS0tLQ==
11-12 13:56:22.092: D/[ENCRYPTION](13919): Payload: BUoW99FG2YXJdQR651O/JMiQFi1Hl4XT/w7MmtMAAophZdSkGWGGJ/3MetLU90FCEN1sXn/bUDWEymfIFxtQ51BRbWM0Zrpe86AKf5mhCF7mPt2eY9nu+CEAt2xmwSOOqg1lnh5LeZS0xMd/QT4eudre58brAL3fSUXsYv4sVZh+4KkUNHaDplq75UfT670XYn8h6azc+ld/AdGBHvU9J1jnoAoryWpFYMCDE74FPaJLr2WhkAFMuGDjabH1hkucH2I4FF1zeX6cDwdd1ThIaYEIfPWvfWwacsOtKQUobDFm5HxvPrPGkXkmXbGdbr/6unyoMo3NrCRYE7CTBDmX3w==
11-12 13:56:22.092: D/[payload](13919): [5, 74, 22, -9, -47, 70, -39, -123, -55, 117, 4, 122, -25, 83, -65, 36, -56, -112, 22, 45, 71, -105, -123, -45, -1, 14, -52, -102, -45, 0, 2, -118, 97, 101, -44, -92, 25, 97, -122, 39, -3, -52, 122, -46, -44, -9, 65, 66, 16, -35, 108, 94, 127, -37, 80, 53, -124, -54, 103, -56, 23, 27, 80, -25, 80, 81, 109, 99, 52, 102, -70, 94, -13, -96, 10, 127, -103, -95, 8, 94, -26, 62, -35, -98, 99, -39, -18, -8, 33, 0, -73, 108, 102, -63, 35, -114, -86, 13, 101, -98, 30, 75, 121, -108, -76, -60, -57, 127, 65, 62, 30, -71, -38, -34, -25, -58, -21, 0, -67, -33, 73, 69, -20, 98, -2, 44, 85, -104, 126, -32, -87, 20, 52, 118, -125, -90, 90, -69, -27, 71, -45, -21, -67, 23, 98, 127, 33, -23, -84, -36, -6, 87, 127, 1, -47, -127, 30, -11, 61, 39, 88, -25, -96, 10, 43, -55, 106, 69, 96, -64, -125, 19, -66, 5, 61, -94, 75, -81, 101, -95, -112, 1, 76, -72, 96, -29, 105, -79, -11, -122, 75, -100, 31, 98, 56, 20, 93, 115, 121, 126, -100, 15, 7, 93, -43, 56, 72, 105, -127, 8, 124, -11, -81, 125, 108, 26, 114, -61, -83, 41, 5, 40, 108, 49, 102, -28, 124, 111, 62, -77, -58, -111, 121, 38, 93, -79, -99, 110, -65, -6, -70, 124, -88, 50, -115, -51, -84, 36, 88, 19, -80, -109, 4, 57, -105, -33]
11-12 13:56:22.177: D/dalvikvm(13919): GC_FOR_ALLOC freed 305K, 10% free 9851K/10848K, paused 23ms, total 23ms
11-12 13:56:22.202: D/CRYPT(13919): started
11-12 13:56:22.207: I/System.out(13919): java.lang.IllegalArgumentException: unknown object in getInstance: org.spongycastle.asn1.ASN1Integer
11-12 13:56:22.207: D/[OUTPUT](13919):  null

Ключи Сервера

-----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQCQXzeKWagYIqLeefAcFGGfn+kp7H6I77Q9E1S3lpIGxEUmSeec LMLC5LLPq32bZDP0OAVydq/Zm+xCGGmWkQ1k1ZpK+huC9zeWLxxVFXh67Nf8s1Xd AOI9rHXUfa1P2ukwHMIKn0NpjAFNzBqX2hNmFNEe3otJQwBelnRAkthMcwIDAQAB AoGARi9D3OpBIZqU+vrkk4IFA4jF3S+vQ/rj8F0ZbjawvsFjrH15Lx9Df2OW2gZQ hd5ss2kYnNC+JFf8vxUHH79cdtGlMe6xKYI1B93/kzZHalg/ZFWybsC4mXfLSouG k9QP7aon2xWGgYz65/aQqFtMaCtObCmCeb7uuhjc/gu1f8ECQQDHY5ig52Rvqi8+ 2UfkukbNAC6QD11jlI1+RJvhv4Aw0oYfSX3K7NTancDtdP2PCHffG2JpX3kR7Kkg rGWXSaZLAkEAuVzBKort8B4VHccLFhwEXbtbKX0JmdZllDNS2GiX8YoAuIyYjLdU 3aSQKxq7VYOv5DZuc/XzmW8LT5reB8Y5eQJAO0QHYgxldiuHz46WKA6WbOjY7kki 4S6OwDF0hC1/1QM+ip41ndO3kSPC7NIRbCqANvjUz61pN0K5ItUbfVSO8QJAWsX/ mrPafcJdmO2Gklc6FCTSKekfsIR7zi2sHmpqLlDktXu0oQSOvNP//fvjTadllZ7K TGNf3f2xTlSK8seyEQJBALU83M4DWQmN/9Mzp4h9XSb2wYFNfgUSJqhx2FIIvXrR GtDPlmPUlR8DoqGLCyTA/MMDum+0pdYStEWmR5ohLuQ= -----END RSA PRIVATE KEY----------BEGIN RSA PUBLIC KEY----- MIGJAoGBAJBfN4pZqBgiot558BwUYZ+f6SnsfojvtD0TVLeWkgbERSZJ55wswsLk ss+rfZtkM/Q4BXJ2r9mb7EIYaZaRDWTVmkr6G4L3N5YvHFUVeHrs1/yzVd0A4j2s ddR9rU/a6TAcwgqfQ2mMAU3MGpfaE2YU0R7ei0lDAF6WdECS2ExzAgMBAAE= -----END RSA PUBLIC KEY-----

«Ключи пользователя»

-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQCDbFBVWh94E0/2tmAZJ0E0oeX3DHuz/s2URtfJUTX5P7sp5MgD zKQ5kWdXbPPprG9d9QGl9koQFkMvaPZQScvUH/yGHEKyoYQLJfzWA85L1uliSmPt wb/5R26gLS9xqjetCV+VJpIXQ7FwUTkH0fFFpgMrbNASYIarPku7bfv+3wIDAQAB AoGAA3J43PRDNQwUod0AwkgkTrQcaxF5wSviyovdJxupNcN1LlEg6fCZMiVdN47V CwEJ3sYJaAgAw1FCK+Et7McywHCS3Cw61vy/vt5+q9LwYE5x+5NhbJOV6UPgR34F ClZSPA7ELZmaK5IKh97+eAyTsUcOJxejwWeoBLQdHZqrNWkCQQCHzDl3cvdzYDC0 c07CLhsZjhTm4BMM/+oT3wOhAYA70ti7s0JEcwCB7bYkVE2ZLUFGgLk+emG7pIfX I9NUmIILAkEA98DLERPBy0tf/gpy6W7cLXQFQWlaLvGsWQI6XL4MVSP9tD8bqk8q YiPx8ZI3m9ane3FyXF/1iNKYvDfiLKCu/QJAOMmQZoEvNZJOC8gEcXNyZbdiykF9 9fu22WRzUgscoufDNor59UHaPns3pe2THbEtENyXmqb2488j9zXGFCRKjQJAV85p ae0BowZcyBF19ouG10kmT6+B+d9HQOiMPLBSeJ5f3VD8ghi6obuxlPdIZB/ojdSA PoL3530UCqkXrM9qFQJANy5KrTAtH4mTY7KW9BymA8bQRVBgQdAvNRCsBOCjnIPj M26rCOjS1BbrmuHKtoZztQeH9G+cu/iFtCPAvf0eig== -----END RSA PRIVATE KEY-----

-----BEGIN RSA PUBLIC KEY----- MIGJAoGBAINsUFVaH3gTT/a2YBknQTSh5fcMe7P+zZRG18lRNfk/uynkyAPMpDmR Z1ds8+msb131AaX2ShAWQy9o9lBJy9Qf/IYcQrKhhAsl/NYDzkvW6WJKY+3Bv/lH bqAtL3GqN60JX5UmkhdDsXBROQfR8UWmAyts0BJghqs+S7tt+/7fAgMBAAE= -----END RSA PUBLIC KEY-----

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]