#Crossplatform cryptography padding issue C++ -> Java

1 messages · Page 1 of 1 (latest)

barren summit
#

Hello,

I am running into the following crossplatform cryptography issue. Given the following cipher declared in the below Java code that is running on an Android App:

cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");```

When I send the client with the aforementioned cipher a message that is encrypted on a C++ server using the Botan library with the below code:
```c++
auto encryptor = Botan::PK_Encryptor_EME(*client.public_key, rng, "PKCS1v15");```
When decrypting on the client a ``BadPaddingException`` is invoked. I have spend quite awhile trying different paddings but I cannot figure it out. Does anyone have an idea?

Now there could as well be issues with the way I send the server public key to the client but that would overscope the question, knowing the equilavant padding algorithm would already make life a bit easier on me.
rancid zealotBOT
#

<@&987246717831381062> please have a look, thanks.