---
title: "Behind GitHub’s new authentication token formats"
description: "GitHub's new token formats add a three-letter identifiable prefix (ghp, gho, ghu, ghs, ghr) with an underscore separator, a CRC32 checksum encoded in Base62 in the last six characters, and a Base62 random portion."
url: "https://swe.quest/articles/behind-github-s-new-authentication-token-formats-568a659054e6e43b"
canonical: "https://github.blog/engineering/platform-security/behind-githubs-new-authentication-token-formats/"
source: "GitHub Engineering"
published: "2021-04-05"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 3
tags: ["identity-auth","security","api-design"]
---

# Behind GitHub’s new authentication token formats

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2021-04-05, 3 min read, Deep dive. Original: [https://github.blog/engineering/platform-security/behind-githubs-new-authentication-token-formats/](https://github.blog/engineering/platform-security/behind-githubs-new-authentication-token-formats/)

## Summary

GitHub's new token formats add a three-letter identifiable prefix (ghp, gho, ghu, ghs, ghr) with an underscore separator, a CRC32 checksum encoded in Base62 in the last six characters, and a Base62 random portion. The prefix alone is expected to cut secret-scanning false positives to about 0.5%. The checksum lets fake tokens be rejected offline without a database lookup. OAuth token entropy rises from 160 to 178 bits at the same 40-character length, and the underscore is chosen because it is not a Base64 character and double-click selects the whole token.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Security](https://swe.quest/tags/security.md) (Security)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)

## Prerequisites

- API authentication tokens ([easy posts on Identity & auth](https://swe.quest/tags/identity-auth.md?difficulty=easy))
- checksums

## Keywords

GitHub, secret scanning, CRC32, Base62, OAuth, personal access tokens

## Related posts

- [Finding leaked passwords with AI: How we built Copilot secret scanning](https://swe.quest/articles/finding-leaked-passwords-with-ai-how-we-built-copilot-secret-scanning-26ede51a550b66b2.md): GitHub Engineering · 2025-03-04 · Medium · 8 min read · LLMs, Evaluation, Security, Capacity planning
  GitHub replaced regex-based detection of generic passwords with an LLM prompt that judges candidate secrets from their file context.
- [Common annotated security keys](https://swe.quest/articles/common-annotated-security-keys-5586739c75da0c4f.md): Engineering@Microsoft · 2024-09-25 · Easy · 3 min read · Security, Supply chain security, Static analysis
  Microsoft's Common Annotated Security Standard (CASK) extends GitHub's identifiable-token approach of fixed signatures plus checksums, so leaked secrets can be detected with near-zero false positives.
- [Your alt text passes automated checks. That doesn’t mean it’s any good.](https://swe.quest/articles/your-alt-text-passes-automated-checks-that-doesn-t-mean-it-s-any-good-83b9ee029ba3f1e2.md): GitHub Engineering · 2026-08-24 · Medium · 9 min read · Accessibility, Static analysis, LLMs, Testing, Privacy
  GitHub's alt text plugin for its Accessibility Scanner splits checks into five deterministic, on-by-default rules and one opt-in model-backed rule.
- [Automatically Rotating GitHub Tokens (So You Don’t Have To)](https://swe.quest/articles/automatically-rotating-github-tokens-so-you-don-t-have-to-45a6ed60a4bb7896.md): Shopify Engineering · 2022-12-20 · Medium · 11 min read · Identity & auth, CI/CD, Security, Developer tools
  Shopify replaced long-lived GitHub personal access tokens with short-lived GitHub App installation tokens that are rotated automatically by scheduled GitHub Actions workflows and written into repository secrets.
- [Security Disclosure Recommendation: Check for Anomalous GitHub Access](https://swe.quest/articles/security-disclosure-recommendation-check-for-anomalous-github-access-acf8b4a01ac2abcd.md): Railway · 2026-10-22 · Medium · 1 min read · Identity & auth, Incidents & postmortems, Security
  Railway users who connect GitHub, following the October 21, 2026 security disclosure, should audit their GitHub accounts for persistence an attacker may have left behind, then confirm no unexpected commits reached their deployments.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
