Discussion:
[base64+]
Add Reply
Stefan Claas
2024-12-30 14:21:31 UTC
Reply
Permalink
Hi all,

while no encryption, this is an enhanced version of a standard
base64 encoder/decoder.

It writes the filename, file size and SHA256 hashsum as a Header,
like in this example:

bart.jpg
2837
8f17bcf334121fe993a48c61179d09c18c25aa2dac1c9c8e6ccef8f860e68997

/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQIBAQEBAQIB
AQECAgICAgICAgIDAwQDAwMDAwICAwQDAwQEBAQEAgMFBQQEBQQEBAT/2wBDAQEB
AQEBAQIBAQIEAwIDBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE
BAQEBAQEBAQEBAQEBAT/wgARCAAwADADAREAAhEBAxEB/8QAGgABAQADAQEAAAAA
AAAAAAAACAAEBQcCCf/EABwBAAIDAAMBAAAAAAAAAAAAAAAGBQcIAQIDBP/aAAwD
[...]

When decoding one no longer needs to provide a filename, because
it is detected and the file is automatically written in the current
directory.

$ base64+ -d < bart.txt
Original size: 2837 bytes
SHA256: 8f17bcf334121fe993a48c61179d09c18c25aa2dac1c9c8e6ccef8f860e68997
Matches original: true

Hope you like base64+!

https://github.com/706f6c6c7578/base64-plus
--
Regards
Stefan
Rich
2024-12-30 20:37:52 UTC
Reply
Permalink
Post by Stefan Claas
Hi all,
while no encryption, this is an enhanced version of a standard
base64 encoder/decoder.
It writes the filename, file size and SHA256 hashsum as a Header,
So, somewhat like an 'extended' uuencode.

https://en.wikipedia.org/wiki/Uuencoding
Stefan Claas
2024-12-31 12:45:49 UTC
Reply
Permalink
Post by Rich
Post by Stefan Claas
Hi all,
while no encryption, this is an enhanced version of a standard
base64 encoder/decoder.
It writes the filename, file size and SHA256 hashsum as a Header,
So, somewhat like an 'extended' uuencode.
https://en.wikipedia.org/wiki/Uuencoding
Well, yes. :-)

I wonder why nobody else came up with the idea of base64+ in the past.
--
Happy New Year 2025
Stefan
Rich
2024-12-31 23:25:50 UTC
Reply
Permalink
Post by Stefan Claas
Post by Rich
Post by Stefan Claas
Hi all,
while no encryption, this is an enhanced version of a standard
base64 encoder/decoder.
It writes the filename, file size and SHA256 hashsum as a Header,
So, somewhat like an 'extended' uuencode.
https://en.wikipedia.org/wiki/Uuencoding
Well, yes. :-)
I wonder why nobody else came up with the idea of base64+ in the past.
Several ideas (all mostly guesses):

1) Uuencode already exists (although, granted, your base64+ goes beyond
what Uuencode does in providing a hash over the data)

2) yenc exists <https://en.wikipedia.org/wiki/YEnc>

3) par2 exists (and goes far beyond base64+ in allowing recovery of
broken files) <https://en.wikipedia.org/wiki/Parchive>

4) (I feel this one is most likely) The 99.9'th percentile of computer
user has no idea what base64 even is, and all the mechanics are hidden
from them behind their email UI. They simply drag and drop a file onto
their email client, and it becomes an "attachment" (and looks to them
to be a "file" via UI trickery) and they don't know, nor care, about
the how/why. MIME specifies base64 encoding for the attached files,
and includes features for including the filenames and sizes (which is
how the "attached files" can appear to be "files" to the users), and so
99.9% of the "need" has been met. So no one is worried about meeting
the missing 0.1%.

Loading...