#include #include #include #Include #Include #Include #include Local $apikey = "a8/dt1+Sjw6a8/OspaeKgTvQXjVGDa7MTwtkE8U85oJpX+OThqMjLcSf";you can use this for testing, it uses a test account Local $apisecret = "gmJASh6IR57seYYJE5z6qEU5sT7OBm+QPzDBp8/89OnaTNydM7rbsKo0hHbHAfMEW1zcPrN6EPDc0PD2hMEWyQ==";you can use this for testing, it uses a test account ;I hardcoded the request for the Balance to eliminate problems $output=KRAKEN_api($apikey,$apisecret) msgbox(0,"Balance JSON",$output) Func KRAKEN_api($key,$secret) Local $nonce= @Year&@MON&@MDAY&@HOUR&@MIN&@SEC&@MSEC Local $params = "nonce=" & $nonce Local $path="/0/private/Balance" Local $sign = hmac($path&_SHA256($nonce&$params), _Base64Decode($secret)); calculating SHA256 of nonce + POST data (POST data is only the nonce in my case) and then calculating hmac $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "https://api.kraken.com/0/private/Balance", false) $oHTTP.SetRequestHeader("API-Key", $key) $oHTTP.SetRequestHeader("API-Sign", _Base64Encode($sign)) $oHTTP.Send($params) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status RETURN $oReceived EndFunc Func hmac($message, $key, $hash = "SHA512") Local $blocksize = 128 Local $a_opad[$blocksize], $a_ipad[$blocksize] Local Const $oconst = 0x5C, $iconst = 0x36 Local $opad = Binary(''), $ipad = Binary('') $key = Binary($key) If BinaryLen($key) > $blocksize Then $key = Call($hash, $key) For $i = 1 To BinaryLen($key) $a_ipad[$i - 1] = Number(BinaryMid($key, $i, 1)) $a_opad[$i - 1] = Number(BinaryMid($key, $i, 1)) Next For $i = 0 To $blocksize - 1 $a_opad[$i] = BitXOR($a_opad[$i], $oconst) $a_ipad[$i] = BitXOR($a_ipad[$i], $iconst) Next For $i = 0 To $blocksize - 1 $ipad &= Binary('0x' & Hex($a_ipad[$i], 2)) $opad &= Binary('0x' & Hex($a_opad[$i], 2)) Next Return Call($hash, $opad & Call($hash, $ipad & Binary($message))) EndFunc ;==>hmac Func SHA512($message) Return _Crypt_HashData($message, 0x0000800e) EndFunc ;==>SHA512