Skip to main content

Github Actions Status

Binary Cookies

CLI tool and Python library for reading and writing Binary Cookies.

Documentation

For detailed documentation, please visit the Binary Cookies Documentation

Requirements

  • Python >= 3.9

Installation

pip install binarycookies

CLI example:

bcparser path/to/cookies.binarycookies

Output:

[
  {
    "name": "session_id",
    "value": "abc123",
    "url": "https://example.com",
    "path": "/",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "Secure",
    "raw_flags": 1,
    "comment": null
  },
  {
    "name": "user_token",
    "value": "xyz789",
    "url": "https://example.com",
    "path": "/account",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "HttpOnly",
    "raw_flags": 4,
    "comment": null
  }
]

Output formats

The CLI supports multiple output formats using the --output flag.

  • json (default): Outputs cookies in JSON format.
  • ascii: Outputs cookies in a human-readable ASCII format with each cookie property on a separate line.
  • netscape: Outputs cookies in the Netscape cookie file format.

Basic Usage Python

Deserialization

import binarycookies 

with open("path/to/cookies.binarycookies", "rb") as f:
    cookies = binarycookies.load(f)

Serialization

import binarycookies 

cookie = {
    "name": "session_id",
    "value": "abc123",
    "url": "https://example.com",  # "domain" is accepted as an alias for "url"
    "path": "/",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "Secure"
}

with open("path/to/cookies.binarycookies", "wb") as f:
    binarycookies.dump(cookie, f)

Optional fields:

  • comment: cookie comment string stored in the file (default: no comment)
  • raw_flags: the raw flags bitfield written to disk. When omitted, it is derived from flag (Secure = 1, HttpOnly = 4, Secure; HttpOnly = 5). Cookies read with load/loads always carry raw_flags, so unknown flag bits survive a read-modify-write round trip.

Ethical Use & Responsible Handling

This project is intended for lawful, ethical use only. Typical, appropriate uses include:

  • Inspecting Binary Cookies from your own devices or data you are authorized to access
  • DFIR, QA, and security testing performed with explicit, written permission
  • Educational/research work on datasets that are owned by you, anonymized, or publicly released for that purpose

You must not use this tool to:

  • Access, extract, modify, or distribute cookies from systems or accounts you do not own or have permission to analyze
  • Bypass authentication, session management, DRM, or other technical controls
  • Enable tracking, stalking, doxxing, fraud, or other privacy-invasive or harmful activities

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also welcome.

Metadata

Release files for binarycookies 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binarycookies 2.5.0
File Size Uploaded
binarycookies-2.5.0.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for binarycookies 2.5.0
File Interpreter ABI Platform
binarycookies-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / binarycookies-2.5.0.tar.gz

Download URL binarycookies-2.5.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2e89dcb1ec89c933d07d15404ca6c04c724903f4fce5ed092e43b2174b6ae2bc
BLAKE2b-256 checksum
How to use checksums
5284a872087723163cde4a1b6d3075263356183758650b228eb05b4d66a79280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release files / binarycookies-2.5.0-py3-none-any.whl

Download URL binarycookies-2.5.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9725f467e788c260056fef8150361116e0f1b108d4ed2212dd679c278cca2f4
BLAKE2b-256 checksum
How to use checksums
a12dd88fc5a5b65af0bcf3b435ae4854dd0aa4720172e88ea3650ac2f45d1e36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release history Release notifications | RSS feed

2.5.1

2 release files

This release

2.5.0 This release

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.3

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.5

2 release files

2.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page