Urgent.News

What's breaking now, across thousands of outlets.

Tech

Base64 Is Not Encryption (And Other Common Misconceptions)

Base64 shows up everywhere: emails, data URLs, HTTP headers, JWTs. Because the output looks scrambled, it is often mistaken for encryption. It isn't. Base64 is an encoding: a reversible way to represent binary data as plain text, with no key and no secret. How Base64 works Base64 takes your data three bytes (24 bits) at a time and splits them into four groups of six bits. Each 6-bit value (0 to…

Base64 is frequently mistaken for encryption, but it is merely an encoding method that converts binary data into a text format. It is reversible, meaning anyone can decode it, and does not offer any secrecy or confidentiality. Base64 works by taking three bytes of input and splitting them into four groups of six bits, each mapped to a character from a 64-character alphabet. If the input length isn't a multiple of three, the output is padded with "=" characters.

Base64 is used to move binary data through text-only channels, such as email attachments and JSON fields. It can also embed small images or fonts directly in HTML or CSS via data URLs. It is the basis for HTTP Basic authentication, which encodes the username and password. However, this method does not provide any protection and should only be used over HTTPS.

Base64 is commonly used in JSON Web Tokens (JWTs), which use the URL-safe variant for their three segments. The padding character "=" at the end indicates that the input length wasn't a multiple of three bytes. URL-safe Base64 replaces "+" and "/" with "-" and "_" for safer usage in URLs, filenames, and JWTs. While Base64 changes the representation of data, it is not compression, as it always makes data larger due to its 33% overhead.

Contrasting with encoding, hashing, and encryption, encoding is reversible and does not provide secrecy. Hashing is a one-way process where the original data cannot be retrieved, but it can verify whether an input matches. Encryption is reversible only with the correct key, providing confidentiality. For secrecy, use authenticated encryption methods like AES-GCM with a properly generated key or a well-reviewed library that handles it securely.

When storing passwords, use slow, salted hash functions like bcrypt or Argon2. Never create your own scheme or rely on Base64 as a security layer.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How Strong Should a Password Be? Length vs. Complexity

Password strength is really a question of how many guesses an attacker would need. Every extra character multiplies that number, which is why length matters far more than swapping an a for an @.

  • Length of password exponentially increases possible guesses for attacker
  • Entropy measures password unpredictability in bits, doubles with each bit
  • Passphrases made of random words offer strong security and memorability

How to Check Color Contrast for Accessibility (WCAG Explained)

Low-contrast text is one of the most common accessibility failures on the web, and one of the easiest to fix. It affects people with low vision and color-vision differences, but also anyone reading a…

  • WCAG quantifies contrast via ratio measuring luminance between colors.
  • Level AA requires minimum 4.5:1 contrast ratio for normal text.
  • Non-text elements like input borders need a minimum 3:1 contrast.

Unix Timestamps Explained: Seconds, Milliseconds, and Time Zones

A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, a moment known as the Unix epoch.

  • Unix timestamp represents seconds since 1970 epoch
  • Seconds vs milliseconds differentiated by number length
  • Store timestamps in UTC to avoid Year 2038 problem

Regex Cheatsheet for Beginners (With Copy-Paste Examples)

Regular expressions look cryptic at first, but a small set of building blocks covers most real-world tasks: validating input, searching logs, and doing bulk find-and-replace.

  • Dot character . matches any character except newline
  • Character classes like [abc] match specific options
  • Quantifiers specify occurrence counts like , +, ?

JSON vs YAML: When to Use Which

JSON and YAML can describe the same data, so the choice comes down to who (or what) reads and writes the file. JSON is strict, small, and easy for software to parse.

  • JSON is strict and compact, ideal for software parsing
  • YAML is forgiving and user-friendly for humans
  • Use JSON for software-to-software data exchange

More from Saturday 26 September →