API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

HMAC256 not working

  • 1.  HMAC256 not working

    Posted Thu March 09, 2023 01:18 PM

    Hi Team,

    I am trying to generate HMAC using below on JS and it gives output :


    const crypto = require('crypto');

    const secret = Buffer.from('DDASCD');
    const hash = crypto.createHmac('sha256', secret).update('446578').digest('base64');
    console.log(hash);  //output =>   D+wGGPQkAlGnM9AuBTqRieTN+Y++FixBki500ptR2VU=

    When tired on Datapower/APIC above same code it is giving me error 256 bit key required.

    I want same output from datapower as above , please help me here.

    our client is using same secret key to generate hash , we have to match the same hash in incoming request..



    ------------------------------
    sanket shirke
    ------------------------------


  • 2.  RE: HMAC256 not working

    This message was posted by a user wishing to remain anonymous
    Posted Fri March 17, 2023 02:00 PM
    This post was removed


  • 3.  RE: HMAC256 not working

    Posted Fri April 07, 2023 02:57 PM

    Hi Sanket, 

    there was another thread related to the same question - linked here



    ------------------------------
    Gabriel Marte Blanco
    Austin TX
    ------------------------------