]> git.ardis.lu - static-encrypt-passkey/commit
Pad plaintext bytes so the encoded ciphertext has no base64 padding
authorArdis Lu <ardisglu@gmail.com>
Wed, 23 Jul 2025 04:18:51 +0000 (21:18 -0700)
committerArdis Lu <ardisglu@gmail.com>
Wed, 23 Jul 2025 04:18:51 +0000 (21:18 -0700)
commit31f1362a81f1643148911e374f018e3b4c31c677
tree0131a8bb249b1381aa588ce9e7019659e523eba4
parent9ee1bb21863ced8a4108497ac0aca5dd7950ddec
Pad plaintext bytes so the encoded ciphertext has no base64 padding

Since base64 padding is ignored on decode, the padding can be deleted or replaced with junk data. As a result, it is possible to decode different strings into the same bytes. By padding the bytes so the bytes are a multiple of 3, there is never base64 padding and exactly one input yields the desired output.
script.js
This page took 0.034428 seconds and 4 git commands to generate.