Constant-time string comparison
Sometimes you need to test strings for equality with an algorithm whose timing depends only on the length of the strings, and not on the contents of the strings themselves. If one of those strings is of constant width – an HMAC, for example – then it becomes a constant-time operation. This can be used to prevent some timing side-channel attacks, such as the critical vulnerability found in KeyCzar back in 2009.
This module offers a single function, equals(x, y), which takes two strings x and y and returns True if they are equal, and False if they are not. The time this function takes does not depend on what specific bytes are in these strings. Unicode strings are encoded as UTF-8 before being compared; it is recommended that you only use this on byte strings (str in Python 2, bytes in Python 3).
This works with Python 2 and 3, and PyPy. The license is Apache 2.0.
Metadata
Release files for streql 3.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| streql-3.0.2.tar.gz | 2.9 kB | Without provenance | Details for streql-3.0.2.tar.gz |
Release files / streql-3.0.2.tar.gz
| Download URL | streql-3.0.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54231c479871f0d347aa740cd6273602a4dcdf4191209495afffbadf5f585935
|
|
BLAKE2b-256 checksum How to use checksums |
9aa4b3e7012e4f98d8063327273af748249caf36d8b190ab55840a7ceea97bd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for streql 3.0.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.
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.