Closed f0o closed 3 months ago
Symmetric HMAC Unrestricted-IP-Access API Key(s) being: prevented from enabling permissions for trading; periodically disabled if previously enabled with permissions for trading; and periodically deleted whether inactive or active.
This sounds like trading is today already not allowed anymore using the HMAC keys. I am actually getting all sorts of errors but it might be because I'm also attempting to add NAT'ing to the cloudresources used...
//EDIT: Default Security Controls disable trading with HMAC keys as of yesterday. Regardless of IP whitelisting. RSA Auth is needed or just disable the Default Security Controls.
Example for Signing mode using RSA Keys
https://github.com/kuuy/taoniu-go/blob/main/cryptos/repositories/binance/spot/margin/orders.go
`timestamp := time.Now().UnixNano() / int64(time.Millisecond) payload := fmt.Sprintf("%s×tamp=%v", params.Encode(), timestamp)
block, _ := pem.Decode([]byte(config.TRADE_SECRET_KEY))
privateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes)
if err != nil {
return
}
hashed := sha256.Sum256([]byte(payload))
signature, _ := rsa.SignPKCS1v15(rand.Reader, privateKey.(*rsa.PrivateKey), crypto.SHA256, hashed[:])
data := url.Values{}
data.Add("signature", base64.StdEncoding.EncodeToString(signature))
body := bytes.NewBufferString(fmt.Sprintf("%s&%s", payload, data.Encode()))`
No response for a long time, close this issue
Did you implement it @xyq-c-cpp? If not then why close?
Did you implement it @xyq-c-cpp? If not then why close? thanks for your concern, it's implemented in last PR.
Binance seems to recommend RSA Keys instead of the old HMACs now.
Ref: https://binance-docs.github.io/apidocs/spot/en/#change-log Ref: https://binance-docs.github.io/apidocs/spot/en/#signed-trade-user_data-and-margin-endpoint-security
This issue is just to track progress on it.