I found a description of the format of the public key here posted by Victor from Blagoevgrad at GSMHosting.com. As mentioned in the comments, both signature sizes are also 2048 bits, so that's pretty conclusive.
Here's the contents of the post of the information in the link:
#define RSANUMBYTES 256 /* 2048 bit key length */
#define RSANUMWORDS (RSANUMBYTES / sizeof(uint32_t))
typedef struct RSAPublicKey {
int len; /* Length of n[] in number of uint32_t */
uint32_t n0inv; /* -1 / n[0] mod 2^32 */
uint32_t n[RSANUMWORDS]; /* modulus as little endian array */
uint32_t rr[RSANUMWORDS]; /* R^2 as little endian array */
int exponent; /* 3 or 65537 */
} RSAPublicKey;
I found out that there is a modexp3
in the rest of the source code which is made more efficient using the n0inv
and rr
values, so the public exponent has value 3 (it seems missing from the structure, so I guess that part has been deprecated).
Possibly the confusion comes from the 40 00 00 00
hexadecimal value at the front; this encodes 64 when seen as little endian value. However, it doesn't mean 64 bytes: 64 * 8 = 512, but 64 words, where each word is 32 bits, i.e. 4 times as much giving 2048 bits.
This means that the modulus has the following value - in big endian:
93f0d9ad49d1dc8fb2445709b6210ba5a377c52f710e1e61458e84b2c53d69a4cb2aa2c914a7669230a6a81b69fbd558f11855a7adb29753a34a95e29b37a16d
509cab68883e54c88f50583d52a9bf4522d19344af4fe67d7a6163a4e7fc9b680602a691c487c55bc0c66125eb829125a78b47111da1f4a459a5d95bf1d879af
da4e28c584b16e78ea0eb584452703b6eb8e1a4a92dcfb1cf4ad50c84a7a16ca22ccf19b0bd2ec40b7af73c8e90b5ae8d057105ce744ba0cf257203e7d4b3675
da7e3decb6a89207229cbd2839c5ccd0e26c6eb76598504de4478d883f1d68852275e2ee0296ed6f2eb6ff590005c5bcaa9f48b18437950a11d69e4373fc3f53
If I use the key (just using the modulus and public exponent 3) I find that the ImeiSign
signature is a PKCS#1 v1.5 signature using SHA-1 as hash. Fortunately for Samsung, the IMEI itself will probably not be susceptible against SHA-1 weaknesses w.r.t. collision resistance.
I cannot seem to verify the IMEI with it though, probably due to some strange (BCD-like?) encoding of the IMEI number. Anyway, the SHA-1 hash within the signature is 824ae6730ee34d365375e791aa2331d5e57c320d
in case you want to try a few things.