HMAC with RIPEMD-160

K

Kless

Is there any way of use HMAC with RIPEMD-160?

Since that to create a ripemd-160 hash there is to use:
h = hashlib.new('ripemd160')
it looks that isn't possible

For HMAC-SHA256 would be:
 
C

Chris Rebert

Is there any way of use HMAC with RIPEMD-160?

Since that to create a ripemd-160 hash there is to use:
h = hashlib.new('ripemd160')
it looks that isn't possible

For HMAC-SHA256 would be:
---------
import hashlib
import hmac

hm = hmac.new('key', msg='message', digestmod=hashlib.sha256)

Untested, but should work according to the docs:
hm = hmac.new('key', msg='message', digestmod=lambda: hashlib.new('ripemd160'))

Cheers,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top