1

I'm trying to figure out the format/encoding for this:

00040000a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100040000a56e4a0e70101759a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 to replicate it with my own public key.

I've looked at this https://crypto.stackexchange.com/questions/41871/how-to-find-the-encoding-of-an-rsa-public-key and from what I can see there are similarities, though it doesn't seem to be the same as that.

New contributor
orangedoggo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
8

00040000 looks like a 32 bit value representing the length of the data.

If we decode it in little-endian we get 1024:

sage: int.from_bytes(bytes.fromhex('00040000'), 'little')
1024

I'm assuming this gives the number of bits that follow; the next 1024 bits (n) are:

f21a03ef61ad05c0af8d2acf29d3d779c2f73b61aa88533dac358410ac7a08d005dbd6325bb5064eb8afb24e3aef680cfad779d854b7ef97d4f5a1f2f16eb63ebf1b1235f89b65053c01f68a19bcda4183516c20cd907a49301d1314f956fbcc2018e4cfe6991c224d0e177eb11d7fae8477cd6701580754cc116782a0b6b6db

Followed by 1024 bits (e) that are

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001

The latter is very likely the exponent, however in big-endian:

sage: int.from_bytes(bytes.fromhex('00010001'), 'big')
65537

65537 is a very commonly used exponent.

Since e is in big-endian, I assume n is too, so your public modulus is:

sage: int.from_bytes(bytes.fromhex('f21a03ef61ad05c0af8d2acf29d3d779c2f73b61aa88533dac358410ac7a08d005dbd6325bb5064eb8afb24e3aef680cfad779d854b7ef97d4f5a1f2f16eb63ebf1b1235f89b65053c01f68a19bcda4183516c20cd907a49301d1314f956fbcc2018e4cfe6991c224d0e177eb11d7fae8477cd6701580754cc116782a0b6b6db'), 'big')
170009540932613151769038469988293650218844004053584339002200232194264352712884216925985784801458591501781573072892989116728048997832334682982748978655741179946010134561466243581524386945399240608537896417387019700398948330733836779231824938918338194668413830256507020494474648180467264074322450994971415066331

Then, there is another public key of the same length 00040000 with the same e 00010001.

It's public modulus is:

sage: int.from_bytes(bytes.fromhex('af5105fa343e9d8e72294fb8e752a703f54f9b403826f8dd06cf2628ece496806e182ab0e88591f6c0ee7873cb69409e735c62105dd2e28bd45428806836cdb8d94b204ace06d342d24ed824c6988b7db3bd840b50071d291aa4a8cda9187a3f698616fb8ae398f0011a3e38ef31312f07aba316b35858d8e5fe7e7ef8c01209'), 'big')
123111431213688323191113429717081285154340099011946618199498087171573056754335780131987080307395734064403880657942875702088682210145904820435534801337217797703105810136529933603381871426734823683013576987571192787312359697878601542181638347168216122667608679225431011863788903839101406098646701462875195576841
New contributor
cisnjxqu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • 1
    65537 is more than very common, it is around 98% of the public exponents. – user36062 May 4 at 14:12

Your Answer

orangedoggo is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.