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.1

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.1
File Size Uploaded
binarycookies-2.5.1.tar.gz 11.9 kB Details

Built distribution (wheel)

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

Total release size: 24.7 kB

Release files / binarycookies-2.5.1.tar.gz

Download URL binarycookies-2.5.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ecd1cbe032333918324f3d8cf15a502f17ea88e0a9131385f2b0b39be891d06b
BLAKE2b-256 checksum
How to use checksums
fea52e6f2c6811f726022bc356865cae69de358055a1f1cdf5ec382e3131a8cf
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 28, 2026.

Transparency log

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

Download URL binarycookies-2.5.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c1a65ca035f5762ae249115060c9882591a0d1437ecc41415a6931b75f7bb25
BLAKE2b-256 checksum
How to use checksums
5eb121f0f5165f4fcfd736337fbe52bb3bce39b6b1eb5bbd7f2d3288a904b557
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.5.1 This release

2 release files

2.5.0

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