29 julio, 2024

What is Base64? | Bootcamps

Do you know what Base64 is? Currently, the most used code is Extended ASCIIwhich has 256 characters and is used to represent uppercase and lowercase letters, numbers and different symbols with eight-bit strings, that is, one byte.

Initially, ASCII code only used seven bits of information and, therefore, could only represent a total of 128 characters. Therefore, it was impossible to represent symbols such as «¿», «á, é, í, ó, ú», «©», among others. Finally, in 1987, Extended ASCII was published, a coding standard in which it was agreed to use an eighth bit to add another 128 new characters to the system.

However, this update produced compatibility errors with computers that only received printable symbols at that time. That’s why, A six-bit intermediate code was developed, which contained all the printable elements. This base six number system provides a total of sixty-four possible combinations and therefore serves to represent sixty-four symbols.

Next, we will explain what is Base64a method of information encryption that arose from this system and is very present in the world of computing.

What is Base64?

If you have ever used the programming language Html or have sent a emailthen you have used the Base64 system.

Base64 is a number system used to transform any type of data into a long plain text stringto send information over the Internet without putting its integrity at risk.

The number system Base64 uses six-bit strings to represent different symbols. The number of possibilities can be calculated by raising two to the power of six, which gives a result of sixty-four options.

The sixty-four characters of this number system (base64 or b64) are:

The 26 letters from «A» to «Z» in capital letters:

ABCDEFGHIJKLMNOPQRSTU VWXYZ

The 26 lowercase letters «a» to «z» of Base64:

ABCDEFGHIJKLMNOPQRSTU WXYZ

The ten numbers from 0 to 9 of the base 64 code:

0 1 2 3 4 5 6 7 8 9

The «+» and «/» characters of the base 64 code:

+ /

How to convert an ASCII code to Base64?

The first thing you must do to convert an ASCII code to Base64 or B64 is to convert a text input to its corresponding binary code. For example, the word «hello«.

bin(hello) = 01101000 01101111 01101100 01100001

Then, the entire chain is brought together in one string:

01101000011011110110110001100001

Then with code base 64 separates the string in six digit sets and fill in the missing spaces with zeros. You should write down the number of pairs of zeros you add to the end of a string. In our example, it would look like this:

011010 000110 111101 101100 011000 010000

In this case, two pairs of zeros have been added in the end.

Now, each block of data is replaced by its corresponding decimal numberwhich can go from 0 (000000) to 63 (111111), like this:

26 6 61 44 24 16

Finally, it is compared with the symbol table, the numbers are replaced by the corresponding characters and An «=» is added to the end of the code for each pair of zeros that have been added at the end of the chain. The Base64 encrypted code for the “hello” text input would be:

aG9sYQ==

The way that Base64 or B64 code is reversible to its ASCII version is by grouping the terms of the string into their original binary code version. After that, they are regrouped into sets of eight bits, thereby reassigning the corresponding symbols of the Extended ASCII code. Thus, information is sent through multiple computer channels in a practical, light way and protecting the integrity of the data with Base64.

How to learn more?

Now you know what Base64 is, how this code is generated and what its function is in the world of computing, it is time to go one step further in your training process and continue learning to specialize in cybersecurity. To do this, you cannot miss our Full Stack Cybersecurity Bootcamp, an intensive training with both theoretical and practical knowledge with which, in less than 7 months, you will become a professional in the IT sector. Don’t keep waiting and sign up now to continue training!

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *