Android Question Base64 Encode of an Hmac

Kerbeross

Member
Licensed User
Longtime User
Hi, sorry for my bad English.
I need to port this php line to B4A:

PHP:
$signature = base64_encode(hash_hmac("sha256", $string_to_sign, $secret_key, true));

hash_hmac function generate a keyed hash value using the HMAC method. With the last parameter to true returns raw binary data.

base64_encode function Encodes data with MIME base64.

Can someone help me please?
 

KMatle

Expert
Licensed User
Longtime User
I'm not sure what you need here. Usually you e.g. hash a pw, encode it to Base64, store it and compare that Base64 string later on the server side. It's not an encryption, so as you compare 2 Base64 strings, everything should be fine.

Are you getting errors from the Base64 encoding?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…