Skip to main content

FeatherDuster (and Cryptanalib)

FeatherDuster logo Build Status

FeatherDuster is a tool written primarily by Daniel "unicornfurnace" Crowley, along with community contributions, for breaking crypto; It tries to make the process of identifying and exploiting weak cryptosystems as easy as possible. Cryptanalib is the moving parts behind FeatherDuster, and can be used independently of FeatherDuster.

Why "FeatherDuster"? There's an in-joke amongst some crypto folk where using crypto poorly, or to solve a problem that crypto isn't meant to solve is called "sprinkling magical crypto fairy dust on it". FeatherDuster is for cleaning up magical crypto fairy dust.

This is a beta release of FeatherDuster. Things may be broken.

If you find a bug, please file an issue. Pull requests are welcome and encouraged.

FeatherDuster Usage

python featherduster/featherduster.py [ciphertext file 1] ... [ciphertext file n]

If you have installed FeatherDuster into your virtual environment, you can simply run it as:

(featherduster) $ featherduster [ciphertext file 1] ... [ciphertext file n]

When importing samples through positional arguments, each file will be consumed and treated as its own ciphertext, regardless of the format of the files. FeatherDuster has the ability to automatically recognize and decode common encodings, so it's okay if these files contain encoded samples.

Once the FeatherDuster console launches, alternate methods of ciphertext import will be available, specifically the ability to import a file with newline-separated samples where each line will be treated as a distinct sample, like so:

68657920636f6f6c
796f752072656164
74686520726561646d65

and the ability to specify a single ciphertext in FeatherDuster through command-line input. Since this input will terminate on a newline, it is recommended to use some form of encoding in case the sample contains a newline.

Cryptanalib Usage

Cryptanalib can be used separately of FeatherDuster to make Python-based crypto attack tools. Documentation for cryptanalib functions can be accessed through the Python help() function like so:

>>> import cryptanalib as ca
>>> dir(ca)    # output edited for a cleaner README file
[ ... 'analyze_ciphertext', 'batch_gcd', 'bb98_padding_oracle', 'break_alpha_shift', 'break_ascii_shift', 'break_columnar_transposition', 'break_generic_shift', 'break_many_time_pad', ... ]
>>> help(ca.bb98_padding_oracle)

Help on function bb98_padding_oracle in module cryptanalib:

bb98_padding_oracle(ciphertext, padding_oracle, exponent, modulus, verbose=False, debug=False)
    Bleichenbacher's RSA-PKCS1-v1_5 padding oracle from CRYPTO '98

    Given an RSA-PKCS1-v1.5 padding oracle and a ciphertext,
    decrypt the ciphertext.

    ciphertext - The ciphertext to decrypt
    padding_oracle - A function that communicates with the padding oracle.
       The function should take a single parameter as the ciphertext, and
       should return either True for good padding or False for bad padding.
    exponent - The public exponent of the keypair
    modulus - The modulus of the keypair
    verbose - (bool) Whether to show verbose output
    debug - (bool) Show very verbose output

The Cryptanalib analysis engine

The analysis engine in Cryptanalib, used by FeatherDuster, can automatically detect encodings and decode samples. The engine assumes that all samples are generated with the same process (for instance, base64encode(aes_encrypt(datum))), but can handle mixed samples to some degree. Currently, Cryptanalib can detect and decode the following encoding schemes:

  • Vanilla Base64
  • ASCII hex-encoding
  • Zlib compression
  • URL encoding

Cryptanalib's analysis engine can detect a number of properties in the analysis phase, too:

  • Low entropy ciphertext (Useful for detecting homebrew ciphers)
  • Block cipher usage vs Stream cipher usage
  • ECB mode
  • CBC mode with fixed IV
  • Hash algorithm (engine will note that length extension attacks may apply with Merkle-Daamgard based hash algos)
  • OpenSSL formatted ciphertext
  • Stream cipher key reuse
  • RSA keys with private components
  • Insufficiently large RSA moduli
  • RSA modulus reuse
  • Transposition-only cipher

Metadata

Release files for featherduster 0.4

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

Source distribution (sdist)

Source distribution for featherduster 0.4
File Size Uploaded Provenance Actions
featherduster-0.4.tar.gz 272.7 kB Without provenance Details for featherduster-0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for featherduster 0.4
File Interpreter ABI Platform Actions
featherduster-0.4-py2-none-any.whl Python 2 none any Details for featherduster-0.4-py2-none-any.whl

Total release size: 555.7 kB

Release files / featherduster-0.4.tar.gz

Download URL featherduster-0.4.tar.gz
Size 272.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e6a27742cb61908d62b55768b9536b66a17938a394ddfcbd7a912be64bcd1695
BLAKE2b-256 checksum
How to use checksums
d0c13b0e6a882984413f0e7e3a6eea5b12cb8d7e6b8bfcc382e2e81dc70d2018
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.11.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.10

Release files / featherduster-0.4-py2-none-any.whl

Download URL featherduster-0.4-py2-none-any.whl
Size 282.9 kB
Tags Python 2
SHA-256 checksum
How to use checksums
e37180eddcbdad9f5d99639260877e273aacdc1056eab38922a3571d1bccbfc4
BLAKE2b-256 checksum
How to use checksums
4767d3d79358f746da0978a8f224af98009b5b1225c4fc379ce1f34742f82ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.11.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.10

Security for featherduster 0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files No provenance

0.1.42

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