SlideShare una empresa de Scribd logo
1 de 9
Descargar para leer sin conexión
Base64 Encoding

    Jonathan Francis Roscoe
               jjr6@aber.ac.uk
Topics of Discussion
●
    Encoding and encryption
●
    What is base64 used for?
●
    Usage of base64 encoding
●
    The algorithm
●
    Drawbacks
●
    Alternatives
Encoding and Encryption
●
    People often refer to base64 (and similar
    methods) as a form of encryption.
●
    Encoding is the process of transforming
    information from one format into another.
    –   Transfer
    –   Storage
    –   Formating (eg. LaTeX – semantics encoding)

●
    Encryption is a type of encoding that obscures
    information to make it unreadable without
    special knowledge.
What is base64?
●
    Positional notation – a quadrosexagesimal number
    system
●
    Numerals 0-9, alphabetical characters a-z and A-Z
    plus two special characters (all printable ASCII)
●   VGhlIHF1aWNrIGJyb3duIGZveCByYW4gb3ZlciB0aGUgbGF6eS
    Bkb2c=

       Value    0    1    2    3    4    5    6    7    8    9    10   11   12   13   14   15
       Base64    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    P

       Value    16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31
       Base64    Q    R    S    T    U    V    W    X    Y    Z    a    b    c    d    e    f

       Value    32   33   34   35   36   37   38   39   40   41   42   43   44   45   46   47
       Base64    g    h    i    j    k    l    m    n    o    p    q    r    s    t    u    v

       Value    48   49   50   51   52   53   54   55   56   57   58   59   60   61   62   63
       Base64    w    x    y    z    0    1    2    3    4    5    6    7    8    9    +    /
What is base64 used for?
●
    “Binary to text” encoding.
●
    Primarily used in SMTP - transfer protocol allows
    only 7-bit ASCII characters to be used.
●
    Base64 will encode any bit stream as a sequence
    of 7-bit ASCII characters (ie. Binary data to
    plaintext).
●
    Multipurpose Internet Mail Extensions
●
    UTF-7
●
    Anti-spam evasion
●
    Binary data embedded in XML
The Encoding Algorithm
●
     Binary data is split into groups of 24 bits (3 bytes), then
     split into 6-bit chunks and converted to the corresponding
     ASCII characters.
    Original bit stream   011010110110101001101011


    6-bit chunks          011010 110110 101001 101011


    Decimal                       26 54 41 43


    Base64                            a2pr
The Encoding Algorithm
●
     What if we don't have a multiple of 3 bytes in our
     bit stream?
    Original bit stream   01100010011011000111010101100101



    Take first 24 bits,      011000 100110 110001 110101
    split into 6-bits


    Decimal                         24 38 49 53


    Base64                            Ymx1
The Encoding Algorithm
Take remaining bits          01100101



Take first 24 bits,    011001 01xxxx xxxxxx xxxxxx
split into 6-bits

Fill incomplete bits   011001 010000 xxxxxx xxxxxx
with zeros


Decimal                          25 26


Base64, replace                  ZQ==
blank bits with '='
Other Notes
●
    33% increase in size
●
    ASCII85, Quoted-printable, 8BITMIME
●
    Privacy-Enhanced Electronic Mail was the first
    place where base64 was used
●
    Headers usually describe if a message is encoded
    in base64, it is up to the client to translate

Más contenido relacionado

La actualidad más candente

IPSec (Internet Protocol Security) - PART 1
IPSec (Internet Protocol Security) - PART 1IPSec (Internet Protocol Security) - PART 1
IPSec (Internet Protocol Security) - PART 1Shobhit Sharma
 
PGP S/MIME
PGP S/MIMEPGP S/MIME
PGP S/MIMESou Jana
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptographydrewz lin
 
IP security Part 1
IP security   Part 1IP security   Part 1
IP security Part 1CAS
 
4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)Sam Bowne
 
Wireless Networking Security
Wireless Networking SecurityWireless Networking Security
Wireless Networking SecurityAnshuman Biswal
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation harshit chavda
 
Information and data security cryptography and network security
Information and data security cryptography and network securityInformation and data security cryptography and network security
Information and data security cryptography and network securityMazin Alwaaly
 
Blow fish final ppt
Blow fish final pptBlow fish final ppt
Blow fish final pptAjay AJ
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptographyzahid-mian
 
Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)CAS
 

La actualidad más candente (20)

Hash function
Hash functionHash function
Hash function
 
IPSec (Internet Protocol Security) - PART 1
IPSec (Internet Protocol Security) - PART 1IPSec (Internet Protocol Security) - PART 1
IPSec (Internet Protocol Security) - PART 1
 
PGP S/MIME
PGP S/MIMEPGP S/MIME
PGP S/MIME
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptography
 
IP security Part 1
IP security   Part 1IP security   Part 1
IP security Part 1
 
4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)4. The Advanced Encryption Standard (AES)
4. The Advanced Encryption Standard (AES)
 
Wireless Networking Security
Wireless Networking SecurityWireless Networking Security
Wireless Networking Security
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
SHA 1 Algorithm
SHA 1 AlgorithmSHA 1 Algorithm
SHA 1 Algorithm
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
Information and data security cryptography and network security
Information and data security cryptography and network securityInformation and data security cryptography and network security
Information and data security cryptography and network security
 
Blow fish final ppt
Blow fish final pptBlow fish final ppt
Blow fish final ppt
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
 
Internet Key Exchange Protocol
Internet Key Exchange ProtocolInternet Key Exchange Protocol
Internet Key Exchange Protocol
 
Secure Hash Algorithm
Secure Hash AlgorithmSecure Hash Algorithm
Secure Hash Algorithm
 
Cryptographic hash function md5
Cryptographic hash function md5Cryptographic hash function md5
Cryptographic hash function md5
 
Ipsec
IpsecIpsec
Ipsec
 
Kerberos
KerberosKerberos
Kerberos
 
RC4&RC5
RC4&RC5RC4&RC5
RC4&RC5
 
Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)
 

Similar a Base64 Encoding

Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)SoumyaBhattacharyya14
 
Bits and the organization of memory
Bits and the organization of memoryBits and the organization of memory
Bits and the organization of memorydmendonsa
 
Cryptographic algorithms
Cryptographic algorithmsCryptographic algorithms
Cryptographic algorithmsAnamika Singh
 
Cryptographic algorithms
Cryptographic algorithmsCryptographic algorithms
Cryptographic algorithmsAnamika Singh
 
Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011Fedor Tsarev
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Information and network security 20 data encryption standard des
Information and network security 20 data encryption standard desInformation and network security 20 data encryption standard des
Information and network security 20 data encryption standard desVaibhav Khanna
 
Modern symmetric cipher
Modern symmetric cipherModern symmetric cipher
Modern symmetric cipherRupesh Mishra
 
Block Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxBlock Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxHodaAhmedBekhitAhmed
 
Block ciphers & public key cryptography
Block ciphers & public key cryptographyBlock ciphers & public key cryptography
Block ciphers & public key cryptographyRAMPRAKASHT1
 
Two fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption AlgorithmTwo fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption AlgorithmRifat Tasnim
 
Modern block cipher
Modern block cipherModern block cipher
Modern block cipherUdit Mishra
 
javaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxjavaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxMattMarino13
 

Similar a Base64 Encoding (20)

4-DES.pdf
4-DES.pdf4-DES.pdf
4-DES.pdf
 
Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)Cryptography Symmetric Key Algorithm (CSE)
Cryptography Symmetric Key Algorithm (CSE)
 
Bits and the organization of memory
Bits and the organization of memoryBits and the organization of memory
Bits and the organization of memory
 
Cryptographic algorithms
Cryptographic algorithmsCryptographic algorithms
Cryptographic algorithms
 
Cryptographic algorithms
Cryptographic algorithmsCryptographic algorithms
Cryptographic algorithms
 
IDEA.ppt
IDEA.pptIDEA.ppt
IDEA.ppt
 
Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011Talk at dnGASP workshop, April 5, 2011
Talk at dnGASP workshop, April 5, 2011
 
Cache mapping
Cache mappingCache mapping
Cache mapping
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
Information and network security 20 data encryption standard des
Information and network security 20 data encryption standard desInformation and network security 20 data encryption standard des
Information and network security 20 data encryption standard des
 
Modern symmetric cipher
Modern symmetric cipherModern symmetric cipher
Modern symmetric cipher
 
Block Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxBlock Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptx
 
Block ciphers & public key cryptography
Block ciphers & public key cryptographyBlock ciphers & public key cryptography
Block ciphers & public key cryptography
 
1 DES.pdf
1 DES.pdf1 DES.pdf
1 DES.pdf
 
Two fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption AlgorithmTwo fish & Rijndael (AES) Encryption Algorithm
Two fish & Rijndael (AES) Encryption Algorithm
 
03 UNIT-2.pdf
03 UNIT-2.pdf03 UNIT-2.pdf
03 UNIT-2.pdf
 
AES.pptx
AES.pptxAES.pptx
AES.pptx
 
Modern block cipher
Modern block cipherModern block cipher
Modern block cipher
 
javaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxjavaPrimitiveTypes.pptx
javaPrimitiveTypes.pptx
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Base64 Encoding

  • 1. Base64 Encoding Jonathan Francis Roscoe jjr6@aber.ac.uk
  • 2. Topics of Discussion ● Encoding and encryption ● What is base64 used for? ● Usage of base64 encoding ● The algorithm ● Drawbacks ● Alternatives
  • 3. Encoding and Encryption ● People often refer to base64 (and similar methods) as a form of encryption. ● Encoding is the process of transforming information from one format into another. – Transfer – Storage – Formating (eg. LaTeX – semantics encoding) ● Encryption is a type of encoding that obscures information to make it unreadable without special knowledge.
  • 4. What is base64? ● Positional notation – a quadrosexagesimal number system ● Numerals 0-9, alphabetical characters a-z and A-Z plus two special characters (all printable ASCII) ● VGhlIHF1aWNrIGJyb3duIGZveCByYW4gb3ZlciB0aGUgbGF6eS Bkb2c= Value 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Base64 A B C D E F G H I J K L M N O P Value 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Base64 Q R S T U V W X Y Z a b c d e f Value 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 Base64 g h i j k l m n o p q r s t u v Value 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Base64 w x y z 0 1 2 3 4 5 6 7 8 9 + /
  • 5. What is base64 used for? ● “Binary to text” encoding. ● Primarily used in SMTP - transfer protocol allows only 7-bit ASCII characters to be used. ● Base64 will encode any bit stream as a sequence of 7-bit ASCII characters (ie. Binary data to plaintext). ● Multipurpose Internet Mail Extensions ● UTF-7 ● Anti-spam evasion ● Binary data embedded in XML
  • 6. The Encoding Algorithm ● Binary data is split into groups of 24 bits (3 bytes), then split into 6-bit chunks and converted to the corresponding ASCII characters. Original bit stream 011010110110101001101011 6-bit chunks 011010 110110 101001 101011 Decimal 26 54 41 43 Base64 a2pr
  • 7. The Encoding Algorithm ● What if we don't have a multiple of 3 bytes in our bit stream? Original bit stream 01100010011011000111010101100101 Take first 24 bits, 011000 100110 110001 110101 split into 6-bits Decimal 24 38 49 53 Base64 Ymx1
  • 8. The Encoding Algorithm Take remaining bits 01100101 Take first 24 bits, 011001 01xxxx xxxxxx xxxxxx split into 6-bits Fill incomplete bits 011001 010000 xxxxxx xxxxxx with zeros Decimal 25 26 Base64, replace ZQ== blank bits with '='
  • 9. Other Notes ● 33% increase in size ● ASCII85, Quoted-printable, 8BITMIME ● Privacy-Enhanced Electronic Mail was the first place where base64 was used ● Headers usually describe if a message is encoded in base64, it is up to the client to translate