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

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.2
File Size Uploaded Provenance Actions
binarycookies-2.5.2.tar.gz 12.0 kB With provenance Details for binarycookies-2.5.2.tar.gz

Built distribution (wheel)

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

Total release size: 24.9 kB

Release files / binarycookies-2.5.2.tar.gz

Download URL binarycookies-2.5.2.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d2a8a846af2627728dad58522e46d40e971a02de65a592cb4dbb7b22836c00a4
BLAKE2b-256 checksum
How to use checksums
b2b0e3fc034eb422a2b65d81cf35a544003dd00c7dd356f5c37aa33824970e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 28, 2026.

Transparency log

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

Download URL binarycookies-2.5.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c06a1f7c4ec905f61009796d3ab16e5879ef866d8b2cce08016112be9c365cf8
BLAKE2b-256 checksum
How to use checksums
04e3a3b01930ab129d02d1babf23752a171d32e19401e76c40ee3c6533a62f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 28, 2026.

Transparency log

Security for binarycookies 2.5.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for binarycookies-2.5.2.tar.gz

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 Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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