Tuesday 24 March 2020

Crypto.createHmac not properly encoding

Hello, I'm trying to replicate one of my Python3 files in nodeJS but im finding my createHmac is not returning the same encryption hash for the same secret and message as the pythons hashlib. Is this stackoverflow post inaccurate when it says that they are syntactically the same for the sha256 encryption? Below are my encryption codes.Node JSconst Crypto = require('crypto') // Standard JavaScript cryptography library signData = Crypto.createHmac('sha256', secret).update(message).digest('hex') Pythonimport hashlib hash = hmac.new(secret, message, digestmod=hashlib.sha256) signData = hash.digest().hex()

Submitted March 24, 2020 at 04:39PM by Blockchain_cenobite

No comments:

Post a Comment