Skip to main content

stretch

stretch is a command line tool that uses PBKDF2 from Python’s passlib to derive a key, given a secret and a salt.

Installation

You can, of course, clone the repo or download the stretch.py script and call it from its directory, but I’d rather have it “installed” so it can be called from anywhere. The easiest way to install it:

[sudo] pip install stretch

Instead, you could just copy the script to a convenient location:

[sudo] curl https://raw.githubusercontent.com/felipedau/stretch/master/stretch/stretch.py -o /usr/local/bin/stretch

Finally, stretch the secret foo with the salt bar using the defaults hmac-sha512 and 10000 rounds:

$ stretch foo bar
FUMV4GHTdgpdEbseRSkUNiTd6CYktCUr3XPqy+pp7cPk7R7Ho0L1JJDXMbcYQkA/gkWQ7BoSOtRcMnvnD8qqhg==

Optional Arguments

Description

-h, --help

show this help message and exit

-b BEGIN, --begin BEGIN

define where to start slicing the result (equivalent to result[b:])

-e END, --end END

define where to stop slicing the result (equivalent to result[:e])

-f {md5,sha1,sha256,sha512}, --family {md5,sha1,sha256,sha512}

choose a pseudo-random family.

-r ROUNDS, --rounds ROUNDS

define the number of rounds to use on the generation (an integer greater than zero). (Default: 10000)

-c, --copy

copy the output to the clipboard by piping it to xclip instead of printing

Metadata

Release files for stretch 1.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 stretch 1.4
File Size Uploaded
stretch-1.4.tar.gz 18.5 kB Details

Release files / stretch-1.4.tar.gz

Download URL stretch-1.4.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2586b6a5db1a9d84d2cb82978acb80c0701c519ea576f13c05d9d65ccdf629ca
BLAKE2b-256 checksum
How to use checksums
458553fbc0ba9d8aa2d60f43c17c02ab38cd946ad68addf576a316fdca51f70f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.4 This release

1 release file

1.1

1 release file

1.0

1 release file

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