1. László Ferenc Horváth
  2. PowerBuilder
  3. Tuesday, 25 June 2019 08:58 AM UTC

Hi Bruce!

Pls help

I need the SHA512 hash value of the password. Example password = '12AA34ox1742'.

Any online hash generator return: 8F7780D9A703C5D989417BEC4C0FBC5371A7BD2F0765205BC6395DCF7D596FD51DE0F404AA65CE60F05FAFE014B6BB2C72A4FE1E1F4EB52E5C52E1E819F4701F

my code (PB Standard, V2019 Build 2082):

CrypterObject nvo_CrypterObject
nvo_CrypterObject = Create CrypterObject
string ls_password = '12AA34ox1742'
Blob lblb_sha512hash
//hash with SHA512
lblb_sha512hash= nvo_CrypterObject.SHA(SHA512!, Blob( ls_password, EncodingUTF8! ))
ls_hash = upper( string( lblb_sha512hash, EncodingUTF8! ))
Destroy nvo_CrypterObject

this return ls_hash = "瞏WΧ٧ŘཌA{쌏攇SQ콝好/E [Ƹ]ϽYO՝ഄ⺵EΠﯠ"

If ls_hash encode base64 then return: j3eA2acDxdmJQXvsTA+8U3GnvS8HZSBbxjldz31Zb9Ud4PQEqmXOYPBfr+AUtrsscqT+Hh9OtS5cUuHoGfRwHw==

???

What is mistake?

thx Laszlo

Marco Meoni Accepted Answer Pending Moderation
  1. Tuesday, 25 June 2019 09:53 AM UTC
  2. PowerBuilder
  3. # 1

Hi László,

on behalf of Bruce, below the correct code:  :-D

lblb_data = Blob('12AA34ox1742', EncodingANSI!)

CrypterObject lnv_CrypterObject
CoderObject lnv_CoderObject
lnv_CrypterObject = Create CrypterObject
lnv_CoderObject = Create CoderObject

lblb_sha512hash= lnv_CrypterObject.SHA(SHA512!, lblb_data)

ls_hash = lnv_CoderObject.HexEncode(lblb_sha512hash)

Best,

.m

Comment
There are no comments made yet.
László Ferenc Horváth Accepted Answer Pending Moderation
  1. Tuesday, 25 June 2019 10:40 AM UTC
  2. PowerBuilder
  3. # 2

Hi Marco!

This is ok. Thx.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.