3 ms·
Well you do save a byte in the actual key. I guess if you really want to keep it to 11 bytes, it would be better to generate 9 bytes of random data, base64 it
by gregmac 6y ago
Well you do save a byte in the actual key.
I guess if you really want to keep it to 11 bytes, it would be better to generate 9 bytes of random data, base64 it (which uses the full 12 characters, with no padding), and truncate to 11. You're throwing away 6 bits of random, but now all 88 bits in your 11-character key are useful (instead of only 86 bits).