can anybody help me with sha2-384 encryption on OB2
What exactly are you struggling with? There’s a block for this
Hey i an asking for sha2_256 not sha256
I don’t think SHA-1 even had different sizes, the one you see in OB2 is SHA2-384
Hmm I tried that but the website declines SHA-1
Ruri I am using NodeJS Script to hash it but it always gives error that:
[Executing block Script] InvocationException: str.charCodeAt is not a function
TypeError: str.charCodeAt is not a function
Script is this one:
Send the LoliCode you are using to call node. Also did you install the module via npm first as per the guide Pure made?
yes i installed it
here is loli code
BLOCK:ConstantString
LABEL:PASS
value = $"<input.PASS>"
=> VAR @passw
ENDBLOCK
BLOCK:Script
INTERPRETER:NodeJS
INPUT passw
BEGIN SCRIPT
const sha2_256 = require('simple-js-sha2-256')
var hash = (simple-js-sha2-256(passw).toString('hex'))
var hash2 = (simple-js-sha2-256(Buffer.from(passw)).toString('hex'))
END SCRIPT
OUTPUT String @hash
OUTPUT String @hash2
ENDBLOCK
Maybe it needs latest node and not the stable one? @Pure any idea?
tried that now it says
simple is not defined ReferenceError: simple is not defined at module.exports
BLOCK:ConstantString
value = $"<input.PASSWORD>"
=> VAR @passw
ENDBLOCK
BLOCK:Script
INTERPRETER:NodeJS
INPUT passw
BEGIN SCRIPT
const sha2_256 = require('simple-js-sha2-256')
var hash = (sha2_256(passw).toString('hex'))
var buffer = Buffer.from(passw).toString('hex')
var hash2 = (sha2_256(buffer))
END SCRIPT
OUTPUT String @hash
OUTPUT String @hash2
ENDBLOCK
Your script was wrong. I fixed it for you