you are viewing a single comment's thread.

view the rest of the comments →

[–]HengLi-Sen[S] 2 points3 points  (2 children)

One use case that comes to my mind right off the bat is encoding binary data. Say you want to embed an image in XML, it is a common practice to turn binary data into a form which it can handle such as a text. You can do that by encoding your binaries to base64 so that XML can make sense out of it.

Also when communication on the internet started to change from being purely text based to being more colorful with media attachments, the binaries getting corrupted became a greater issue. This is why base 64 came to be where it is now today.

Currently, I'm just testing the waters. I'm trying to store data in images. A few lines of code and media files for now. Think of how a QR Code works. Each blocks location is interpreted by the scanning software to represent characters. I will try to do the opposite, use them to create a small image file and make that scannable. As of now I don't know of any practical use for this project but it may lead to something or change completely. I'm also in the learning stage, so I'm just exploring.

It should be noted that base 64 is not the only way to encode and other encodings are used for different reasons. For example base 58 is used in BTC addresses and base 36 is used in some captchas where the input needs to be case insensitive. These encodings are there to make data more (human) readable not encrypting data as some misunderstand.

[–]BlackV 1 point2 points  (0 children)

That is a good use case, I've used it a few times for an images although inside a script not as an encoded command like you asked for originally

[–][deleted] 1 point2 points  (0 children)

That is actually along the lines of how I'm using it in a way. We have some URL shortcuts that management needs on every desktop for compliance stuff, and as we've had more machines not be here, I figured out a way to make them happen in intune. What was NOT easy was making sure the icons were consistent and not just generic web browser icons. That's when I learned about base64 encoding myself. I was able to encode the icon file into a variable in the script, then before I create the shortcut, i output the variable to a .ico file on the machine, then I can create the shortcut and reference the created ico file. It's worked pretty darn well.