Basically I need to have a base64 encoded signature that has to be 96 characters long. However, I do not know what length I need to have the signature at so when I encode it, it can be that exact size. Does anyone know how to convert it? Also, does anyone know how to convert it in base64 encoding or any byte size encoding?
However, I do not know what length I need to have the signature at so when I encode it, it can be that exact size.
Well, base64 uses 4 characters (from an alphabet of size 64) to encode 3 bytes (3 bits contain 24 bits; 24/4 = 6 bits per base64 character).
Hence, if the signature was 72 bytes long, that would translate to 72/3*4 = 96 characters you require.
Now, base64 typically has a === trailer to signify the end of the encoding; are you counting that?
base64 is defined on rfc4648
As poncho mentions, it has an overhead of 33%, and thus 96 / 4 × 3 = 72 bytes needed