Base64 is a group of similar binary-to-text encoding.


The Base64 index table:

ValueChar ValueChar ValueChar ValueChar
0A16Q32g48w
1B17R33h49x
2C18S34i50y
3D19T35j51z
4E20U36k520
5F21V37l531
6G22W38m542
7H23X39n553
8I24Y40o564
9J25Z41p575
10K26a42q586
11L27b43r597
12M28c44s608
13N29d45t619
14O30e46u62+
15P31f47v63/



Encoding example. 3 char( Byte ) 씩 끊어서 읽고 4 char로 encoding(3Byte -> 4Byte)한다.


Text contentMan
ASCII77 (0x4d)97 (0x61)110 (0x6e)
Bit pattern010011010110000101101110
Index1922546
Base64-encodedTWFu



만약 3 Byte 중 1 byte가 없을 경우,


Text contentMa
ASCII77 (0x4d)97 (0x61)0 (0x00)
Bit pattern010011010110000100000000
Index192240
Base64-encodedTWE=


만약 3 Byte 중 2 byte가 없을 경우,


Text contentM
ASCII77 (0x4d)0 (0x00)0 (0x00)
Bit pattern010011010000000000000000
Index191600
Base64-encodedTQ==



1. 맨 끝에 '='나 '=='가 들어가는 것 이외에도, 그 앞의 char가 바뀐다.

2. 앞에서부터 3Byte 씩 encoding 하기 때문에, 문자열의 위치에 따라 output이 변경될 수 있다.


Radix-64

Radix-64 encoding, also known as "ASCII Armor". Radix-64 is identical to the "Base64" encoding described from MIME, with the addition of an optional 24-bit CRC. The checksum is calculated on the input data before encoding; the checksum is then encoded with the same Base64 algorithm and, using an additional "=" symbol as separator, appended to the encoded output data.


즉 Base64 포맷에 맨 끝쪽에 = 이후 24-bit CRC 있으면. Radix-64


'Security > Crypto-PKCS' 카테고리의 다른 글

John the ripper  (0) 2016.12.25
Block cipher mode of operation  (0) 2016.11.25
동기식, 비동기식 stream cipher  (1) 2016.11.18
PKCS ( Public Key Cryptography Standards )  (0) 2016.09.14
Birthday Problem & Attack  (0) 2016.09.10