I need to generate a Hash with these procedure:
- The algorithm will be AES (that's not a problem).
- Method AES/CBC/PKCS5PADDING
- HASH in SHA-512
The first three points will be covered with a node.
But here comes the complex....additional the process will be the following:
- The Salt will be dinamic and random.
- Next to the Salt i need to apply a derivation process with a Hash 123WithHmac233
- The point 2 needs to be returned in HEX or Base64
I found it difficult to do it in node red, specially the SALT part.
Thanks a lot in advance.
What library are you using to do this? And what have you tried?
I'd use a suitable library and a function node myself.
I'cant use any library at all because i have to do it in a prod server, so no additional npm install can be done.
I know that the SALT is used in addition to the HASH and it can be placed in the first part or the last one of the HASH.
Urm, you should never do crypto without a tried and trusted library. Rule number one: never do it yourself.
Yes that is right.
I know there is a well used library called 'cripto'.
Can't you use the
crypto library built in to nodejs?
On the setup tab of a function node, add an import named crypto then in the on message tab...
const salt = crypto.randomBytes(256).toString('base64');
//Do what you need to with salt then return the result...
msg.payload = result
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.