Score:-3

why RSA public keys contains non-ascii characters?

fi flag

let's look at the public key in this post as an example: https://crypto.stackexchange.com/a/35105

MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB

when I decode this base64 string using an online tool, I get a public key with some funny characters as below shows: enter image description here

00 *H ��0�;P8YcNEq0x&tG_)bFPd8TY5CJ5Dd1!U?oOe#9R>[5A0GONg�

I don't understand why it contains non-ascii characters, isn't that public key should be ascii format rather than unicode (which contains funny characters) format?

DannyNiu avatar
vu flag
I'm curious what do you expect an ASCII RSA public key contain.
cn flag
Also, while decoding to ASCII characters is completely meaningless, you can absolutely do so. There's just no guarantee those ASCII characters will be printable. ASCII contains a whole slew of non printable characters. And even if they're printable, there's no guarantee that your font will include the corresponding glyphs.
Score:3
si flag

That key doesn't contain any characters at all. It contains ASN.1 encoded binary data representing the large numbers which define the public key. It's not text, so trying to display it as text results in nonsense.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.