San Ya
San Ya

Reputation: 107

decoded = visually encoded

Is it possible to decode base64 to image(or string) contains visually same base64, or reverse, so it's loops to recursion.

enter image description here

P.S. base64 actually it's not the goal, so if you know other funny ways with decoded = visually encoded, I will be very appreciate.

Upvotes: 0

Views: 197

Answers (2)

San Ya
San Ya

Reputation: 107

Didn't found solution, but compromise for my needs: First: image to base64; Second: image to color ascII-art contain prev base64 string.

Test example: enter image description here

P.S. Of course it's fake, but it works exactly as close as I wanted, I think on some sort of simple images it can works very usefull.

Upvotes: 0

Thomas M. DuBuisson
Thomas M. DuBuisson

Reputation: 64740

Is it possible to decode base64 to image(or string) contains visually same base64, or reverse, so it's loops to recursion.

So you want a base64-encoding-quine (see quine). Restated, you'd like either:

  1. An x such that ascii(decode_base64(x)) == x. This isn't possible because base64 is strictly larger than the value being encoded. So the result of decoding yields something smaller than the initial value.

  2. An x such that some_really_vague_image_decoding(decode_base64(x)) ~ x. This probably isn't possible for any standard image encoding because the number of bits required to represent a pixel, and number of pixels required to represent a character, are far larger than the 6 bits provided by a single base64 character.

Upvotes: 1

Related Questions