ja4

package
v0.16.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ja4 implements BSD-3-Clause-licensed JA4 TLS client fingerprinting. JA4+ methods are intentionally isolated from this package and official builds.

Index

Constants

View Source
const (
	ExtensionSNI  uint16 = 0  // Server Name Indication
	ExtensionALPN uint16 = 16 // Application-Layer Protocol Negotiation
)

TLS Extension types to exclude from JA4_c

Variables

This section is empty.

Functions

func ComputeJA4

func ComputeJA4(data *ClientHelloData) string

ComputeJA4 computes the JA4 fingerprint for a TLS ClientHello Format: {ja4_a}_{ja4_b}_{ja4_c} Example: t13d1516h2_8daaf6152771_e5627efa2ab1

func FormatJA4

func FormatJA4(fingerprint string) string

FormatJA4 formats a JA4 fingerprint for display

func GetSupportedVersion

func GetSupportedVersion(extensions []uint16, supportedVersionsData []byte) uint16

GetSupportedVersion extracts the TLS 1.3 supported_versions value from extensions Returns 0 if not found

func JA4Raw

func JA4Raw(data *ClientHelloData) string

JA4Raw returns the raw (unhashed) JA4 fingerprint for debugging Format: {ja4_a}_{sorted_ciphers}_{sorted_extensions_signature_algorithms}

func ParseCipherSuites

func ParseCipherSuites(ciphers []int32) []uint16

ParseCipherSuites converts int32 slice to uint16 slice

func ParseExtensions

func ParseExtensions(extensions []int32) []uint16

ParseExtensions converts int32 slice to uint16 slice

func ValidateJA4

func ValidateJA4(fingerprint string) bool

ValidateJA4 checks if a JA4 fingerprint has the correct format

Types

type ClientHelloData

type ClientHelloData struct {
	Version             uint16   // TLS version from handshake
	CipherSuites        []uint16 // Cipher suites offered
	Extensions          []uint16 // Extensions present
	SNI                 string   // Server Name Indication
	ALPNs               []string // Application-Layer Protocol Negotiation values
	SupportedVers       uint16   // Supported versions extension value (for TLS 1.3)
	IsQUIC              bool     // Whether this is QUIC (not TCP/TLS)
	SignatureAlgorithms []uint16 // Signature algorithms from extension 13 (signature_algorithms)
}

ClientHelloData contains the data needed to compute a JA4 fingerprint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL