I'm trying to understand how this particular app works.
At the start of registration, it will send two parameters named "keyA" and "keyB" to the server, and the server will reply with two parameters named "signe" and "data," and then the app will decrypt "data" using RSA/ECB/PKCS1.
Request:
{"keyA":"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz8Hb9tbjtYAxNQi19h75CGBdsAuSCenn/t9p0DjLUOfh75qCvqJzkrE9gv6fXo1GcyMrfVAgRxjR37F3gOzilWVJiUk9VGq/1mGV/UXI8cK6Lkae+Zie3l5L1Qc0YjeBmkQiSjSkq3zo9AVgom473TFerQpcvukzqzQFN0k2sYBQWxpN3SDnpNSeiiHIEStw25WNPkSjQlrJB4RMiO2bKeBfTPjKFAG5/iSZVzRZ/P8fdv10m/D/F5AbIFgl4OXKzbLriAsBpmcXOPV3+LQ5OUfNgKFj1khs6JMo2GT5xMfAeIw4eqo77e7RSkQxocIg9ed4GNHvC9KDKXt6rBZJfQIDAQAB","keyB":"JhDGG3QVjn6Nosxg/kTfTR40MV1XetdZ2m/i314XFoUkA8f6Mgb/lQ38iVnEZpKULZ5y3ShnPa9lR1ZP/xhkttI9e0F67UTj/FNM2837qHMbNK7ZGtFCfuXfE6bokDci6eptIVIgsSL3Is9PFlc47g5E179jjeB8Bhtr4H+6CRoB5R+Ru82XfCI1xH45EbKVqEL+it2/NoiT0EzL892jKOd8qOMvrNxjRnl14TJrdY2KBsRzgVExSX03Bzg/+QLuMa1fBBPtONZjRSIBNK40z9rDBy9Ibdc1xBESWcZMZh2glPhaZe4oy3LQa8XFrEgKJolIMznA6UGdnVck0rXP9w=="}
Response:
{"signe":"bWnUVR9NURGqpA2RPXr68u+7hCkSfkEUDVEZ8BxkjjYSOUarcEivYCU6QB5trk0n17hrSD5c/xlV0Hz4FiYm+r5eYVs2hqFj21C78/TKAyEQKeuwdSaCJo2rbnE9IUQwiIP96IYj2SZ6SelBSoRgIYi0gNIqR2tr89fBFeDtbz76J0tyFoxiqydKM+Oclir7nj8ZybkfdadzGhvCjikQIsjtEpvAK34Msmow3G73YbmIgwIRn1e/YmE0uphGXrY24V2lhkm1PH+9Ngt8qoQjMAedxnwAW7JfqFKEHmPBjfs7NOpHISG7e255Eh8m4/q8vbvfmP1UU18iIR5yr9EQ6q/yUzecp6VJeclSP0rjTPhRUbLqdLCv0bVbqZLziHCEiMcqnT6N+rkOoVsj7IdqnP6qP79L/blhc8FlRSRx4L7y5CWM3MHZ0RJWykVJVDZKnF4LnNJ+m/7CdrxXyI9LUxzwlY94RQdGWhpmElh7BY7DBSZqIA0ly4SLUxRJt5Wc","data":"hzo3Y3biJ1+YKsmKL+pwiuBIUC332dEbV/ooy2ilb5yem5kF75fLKXCNjVdPUPZgQbx0wHTuQsjFgIIeabmUqzegKebxqtUOtDVIMEj54cmfJ1itDhZIJxivb42/x1LbBYuUi91hZy/xRx2opwA+gULMyJwbNlQlcp016KLCh9AiNFYtE77hSlbriO72G3ukD8s/7uMQfpdNcDwl7wWh4L4oIZCji3G/YPJW49CMvmsTnuUhK34E2ka1h9dfwMUvZT+CFEv/anC6gXktMzqmhI6enZB9bb33bwIBiF6k+MkI11Ea9wYdvlwVhbEvOLDYYt41L5UgTCBR5pH01MY06Q=="}
I can tell that keyA is an RSA public key (2048 bits) but I don't know what keyB is.
I've tried using https://codeshare.frida.re/@ensingerphilipp/frinja-crypto-fixed/ to see how these keys are being generated, but it doesn't show any key being generated.
I've tried the process multiple times and the result of my observations is that
- KeyA and KeyB are somehow related, and if they don't match, the server replies with an error.
- It can send different KeyB with the same KeyA.
- If I send the same request multiple times, signe will not change, but the data will change (and I guess it's just because of padding).
My guess is that it's using another approach to generate these keys, but I'm not a Java developer.
I don't have access to these app source codes, and they're heavily obfuscated, so it's not an option to find anything from source codes.
Any help would be appreciated.
I found some frida js code on a Chinese website and it helped me to dig more
KeyB is a singature and I was also able to see the string that was being signed with this code :
I was also able to simulate this process with my own generated key pairs. When I decrypt response data it gives me some binary data that I don't know its purpose !! but it doesn't matter for now