Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A Python implementation of SipHash, a fast short-input PRF.
Extract from the description:
SipHash is a family of pseudorandom functions (a.k.a. keyed hash
functions) optimized for speed on short messages.
Target applications include network traffic authentication and defense
against hash-flooding DoS attacks.
SipHash is secure, fast, and simple (for real):
* SipHash is simpler and faster than previous cryptographic algorithms
(e.g. MACs based on universal hashing)
* SipHash is competitive in performance with insecure
non-cryptographic algorithms (e.g. MurmurHash)
* We propose that hash tables switch to SipHash as a hash
function. Users of SipHash already include OpenDNS, Perl 5, Ruby, or
Rust.
Pysiphash
tries to follow the
hashlib API. You can
add data to the hash by calling an update
method, or feed data
directly to the constructor:
>>> import siphash
>>> key = '0123456789ABCDEF'
>>> sip = siphash.SipHash_2_4(key)
>>> sip.update('a')
>>> sip.hash()
12398370950267227270L
>>> siphash.SipHash_2_4(key, 'a').hash()
12398370950267227270L
To extract the hash as a numeric value call hash()
:
>>> siphash.SipHash_2_4(key, 'a').hash()
12398370950267227270L
Or digest()
to get a raw 8-bytes string:
>>> siphash.SipHash_2_4(key, 'a').digest()
'\x86L3\x9c\xb0\xdc\x0f\xac'
Or hexdigest()
for a 16-bytes hex encoding:
>>> siphash.SipHash_2_4(key, 'a').hexdigest()
'864c339cb0dc0fac'
A series of sanity checks are present inline the main pysiphash
code, to run it type:
$ python siphash/__init__.py
all tests ok
Currently pysiphash
is a pure-python code, so don't expect blazing
speed. On my machine computing a hash from a ten byte string takes
around 0.31 ms, and hashing 1MiB blob takes 770 ms.
FAQs
siphash - python siphash implementation
We found that siphash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.