News for hackers. Stuff that matters.
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.

  $ printf AAAA | base64 --decode | od -tx1
  0000000    00  00  00
  0000003

  $ printf AAAAAAAA | base64 --decode | od -tx1
  0000000    00  00  00  00  00  00
  0000006

  $ printf AQEB | base64 --decode | od -tx1
  0000000    01  01  01
  0000003

  $ printf AQID | base64 --decode | od -tx1
  0000000    01  02  03
  0000003

  $ printf main | base64 --decode | od -tx1
  0000000    99  a8  a7
  0000003

  $ printf scrabble | base64 --decode | od -tx1
  0000000    b1  ca  da  6d  b9  5e
  0000006

  $ printf 12345678 | base64 --decode | od -tx1
  0000000    d7  6d  f8  e7  ae  fc
  0000006
Since '+' and '/' are also used as symbols in Base64 encoding (for binary 111110 and 111111, respectively), we also have:

  $ printf 1+2+3+4+5/11 | base64 --decode | od -tx1
  0000000    d7  ed  be  df  ee  3e  e7  fd  75
  0000011

  $ printf "\xd7\xed\xbe\xdf\xee\x3e\xe7\xfd\x75" | base64
  1+2+3+4+5/11
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)

Re:'changeme' is valid base64 by m463 on Saturday October 24, 2020 @01:34PM (#24880678)

  $ 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
Re:'changeme' is valid base64 by m463 on Sunday October 25, 2020 @10:54AM (#24886719)
no! ha, I meant the old /etc/shadow trick of adding * lock * or * LCK * helps.