36

I noticed that the string ICAgICAgICAgICAgICAg, in various repeating lengths, appears fairly often in public key certificates and ciphertexts.

What does this mean? Is it some kind of padding? Is it a quirk of the encryption?

2
  • 6
    Are you sure about the ciphertexts? It's actually impossible as the result of any usable encryption is a random-looking byte sequence. The probability of 15 consecutive spaces is 2**-120, i.e., practically zero.
    – maaartinus
    Dec 2, 2019 at 1:54
  • 17
    It means the certificate is made out of a polymer of Silver, Iodine and Carbon. The length of the chain depends on how long the certificate needs to be.
    – JDL
    Dec 2, 2019 at 17:14

2 Answers 2

57

ICAg represents three spaces when text is base64-encoded.

For example:

echo -n '      hello world' | openssl base64

produces:

ICAgICAgaGVsbG8gd29ybGQ=
6
  • 9
    Is there any particular reason why three spaces might be a common occurrence in public key certificates? Dec 1, 2019 at 20:40
  • 9
    Any long string of spaces would turn into n blocks of 3 spaces plus a maybe a final block of one or two spaces plus other characters Dec 1, 2019 at 22:49
  • @DélissonJunio it should not be a common occurrence. There's no reason to add pointless blank space to a certificate, and in a ciphertext it's even more concerning.
    – OrangeDog
    Dec 1, 2019 at 23:57
  • 14
    @StopHarmingMonica My guess is that the text before encoding had indentation using spaces.
    – Barmar
    Dec 2, 2019 at 8:36
  • 7
    @StopHarmingMonica Certificates do not contain any ciphertext. They often contain base-64 encoded text though. Dec 2, 2019 at 11:21
31

The accepted answer doesn't show how to get the answer (it shows, how to verify it). Use

echo 'ICAgICAgICAgICAgICAg' | base64 -d

(producing a bunch of spaces) or

echo 'ICAgICAgICAgICAgICAg' | base64 -d | hexdump -C

producing

00000000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20     |               |
0000000f

to see what's inside.

Your Answer

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.