Base64 encoded data maximum size

后端 未结 4 2044
不思量自难忘°
不思量自难忘° 2021-02-09 11:51

I have a security mechanism that implements symmetric algorithm RijndaelManaged. I managed to find information what is the maximum size of encrypted data using

4条回答
  •  萌比男神i
    2021-02-09 12:21

    Absolutely - Base64 takes 4 characters to represent every 3 bytes. (Padding is applied for binary data which isn't an exact multiple of 3 bytes.) So 128 bytes will always be 172 characters. (The way to work this out is that base64 represents 6 bits in each character (26 = 64); therefore 3 bytes = 24 bits = 4 base-64 characters.)

提交回复
热议问题