Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does Base64 code mean?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The content of this article mainly revolves around the meaning of Base64 coding. The content of the article is clear and clear. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!

Today's knowledge popularization is to take you to understand what Base64 coding is. The editor expounds Base64 coding from several aspects: definition, origin, coding process and not encryption algorithm.

First, definition.

Base64 encoding is a method of representing binary data based on 64 printable characters. At present, Base64 has become one of the common coding methods for transmitting 8-bit binary byte codes on the network.

Second, why is there Base64 coding?

Because some network transmission channels do not support all bytes, for example, traditional mail only supports the transmission of visible characters, such as ASCII code control characters can not be sent through mail. In this way, the use is greatly limited.

Every byte of the binary stream of a picture cannot be all visible characters, which makes it impossible to transmit the binary stream of the picture. The best solution is to make an extension scheme to support the transfer of binary files without changing the traditional protocol. That is, the non-printable characters can also be represented by printable characters, and the problem is solved. Base64 coding is a coding format designed to implement this scheme. Base64 is a representation of binary data based on 64 printable characters.

3. Base64 coding process

(1) if the string to be converted is divided into a group of 8 binary bits every three bytes, then there are 24 binary bits.

(2) if every 24 binary bits obtained in step (1) are divided into 6 groups, every 3 bytes can be divided into 4 groups.

(3) add two zeros in front of each group, each group from 6 binary bits to 8 binary bits, a total of 32 binary bits, that is, four bytes.

(4) according to the Base64 coding comparison table, the corresponding value is obtained.

Most encodings are converted from strings to binaries, while Base64 encodings are converted from binary to strings. On the contrary, Base64 coding is mainly used in the field of transmission, storage and presentation, which can not be regarded as encryption, but can not see the plaintext directly. Encryption can also be done by disrupting the Base64 code. There are many kinds of codes in Chinese (for example: utf-8, gb2312, gbk, etc.), different codes correspond to different Base64 coding results.

4. Base64 is not an encryption algorithm

Many people will mistakenly think that Base64 is an encryption algorithm, like to say when the data transmission is not secure: use Base64 encryption.

Let's first look at the definition of encryption: in cryptography, encryption (English: Encryption) is the process of changing plaintext information into unreadable ciphertext content. Only objects with decryption methods can restore the ciphertext to normal readable content through the decryption process. The so-called encryption algorithm is the method of encryption. If you use Base64 for "encryption", the third party can instantly decrypt the data, which simply cannot achieve the encryption effect you want. Therefore, Base64 cannot be said to be an encryption algorithm, it can only be said to be coding.

Thank you for your reading, I believe you have a certain understanding of "what is the meaning of Base64 coding", go to practice quickly, if you want to know more related knowledge, you can follow the website! The editor will continue to bring you better articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report