Unpack .crx files the way Chrome does
Project description
crx_unpack is a Python library for extracting the contents of a Chrome extension file (.crx).
Structure of CRX Package Format
As explained at https://developer.chrome.com/extensions/crx
Package Header
The header contains the author’s public key and the extension’s signature. The signature is generated from the ZIP file using SHA-1 with the author’s private key. The header requires a little-endian byte ordering with 4-byte alignment. The following table describes the fields of the .crx header in order:
Field |
Type |
Length |
Value |
Description |
---|---|---|---|---|
magic number |
char[] |
32 bits |
Cr24 |
Chrome requires this constant at the beginning of every .crx package. |
version |
unsigned int |
32 bits |
2 |
The version of the *.crx file format used (currently 2). |
public key length |
unsigned int |
32 bits |
pubkey.length |
The length of the RSA public key in bytes. |
signature length |
unsigned int |
32 bits |
sig.length |
The length of the signature in bytes. |
public key |
byte[] |
pubkey.length |
pubkey.contents |
The contents of the author’s RSA public key formatted as an X509 SubjectPublicKeyInfo block. |
signature |
byte[] |
sig.length |
sig.contents |
The signature of the ZIP content using the author’s private key. The signature is created using the RSA algorithm with the SHA-1 hash function. |
Extension Contents
The extension’s ZIP file is appended to the *.crx package after the header. This should be the same ZIP file that the signature in the header was generated from.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for crx_unpack-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d26e331ddd72f64d7996dd08d6ec46e4c09b79810d6c82593bf2d65ae29a4976 |
|
MD5 | 4863ed625328aac1a4774cec79ba04a8 |
|
BLAKE2b-256 | 18f17d0d6f4d03b661ae6ceef7052d5078b61d0edea119166c41752d5a410d12 |