Re:'changeme' is valid base64
by susam on Saturday October 24, 2020 @11:47AM
(#24879898)
Any alphanumeric string with a length that is a multiple of 4 is valid Base64 string.
Since '+' and '/' are also used as symbols in Base64 encoding (for binary 111110 and 111111, respectively), we also have:
[ Parent
| on HN ]
Re:'changeme' is valid base64
by billyhoffman on Saturday October 24, 2020 @01:36PM
(#24880685)
The padding character =, used to pad the base64 string to be a multiple of 4, is technically optional as well since they can be inferred from the length, though different decoders can be more strict than others. So virtually all ascii words are valid base64
https://en.m.wikipedia.org/wiki/Base64
(I got burned by this a few months ago where Chrome can produce HAR files that have base64 encoded bodies without padding characters, and .NETs built in decoder expects them)
$ echo "changeme" | base64 --decode | hexdump -C
00000000 72 16 a7 81 e9 9e |r.....|
00000006
$ echo "*lock*" | base64 --decode | hexdump -C
base64: invalid input
Re:'changeme' is valid base64
by rootusrootus on Saturday October 24, 2020 @02:25PM
(#24880989)
That's for the asterisks, not because length.
$ echo "llockk" | base64 --decode | hexdump -C
00000000 96 5a 1c |.Z.|
00000003