mql4でデータをハッシュ化する方法を教える

 
ビットコインとそれにまつわるすべて」に関係のないコメントは、このスレッドに移動されました。クリプトマニアとその敵対者の本拠地。".
 
プログラマー仲間、mql4でデータをハッシュ化する方法を教えてください(私はbase64を使う方法を知っているようです)。
 
Mischek:
ああ、今は若い人を求めているんだ。
「婆娑羅
 
sanyooooook:
市民プログラマー同志が mql4のデータをハッシュ化する方法を教えてくれる(base64の使い方は知っているようだ)。
MD5 ?
 
sergeev:
MD5が必要ですか?

MD5 どこかに例があったような気がします。


シャ256

私は扱ったことがないので、ほとんどの場合、何が必要なのかさえわからないのですが、ここにsprpのコード例があります。

protected string Login= "Получить на странице доступа к API";
    protected string Password = ""Получить на странице доступа к API";
    protected string Culture ="ru-RU";

    var RequestBalance = new { Login = Login, Wmid = wmid, Culture = Culture, Signature = HashToBase64(String.Format("{0};{1};{2};{3}", Login, Password, Culture, wmid), null)};
    string Response = ITServiceJson.Balance(ForceJson(RequestBalance));

 static public byte[] Hash(string plainString, Encoding encoding)
    {
      if (plainString == null)
        throw new ArgumentNullException("plainString");

      if (encoding == null)
        encoding = Encoding.UTF8;

      return Hash(encoding.GetBytes(plainString));
    }

    static public byte[] Hash(byte[] bytes)
    {
      if (bytes == null)
        throw new ArgumentNullException("bytes");
      using (SHA256 algorithm = new SHA256Managed())
      {
        byte[] hashBytes = algorithm.ComputeHash(bytes);
        return hashBytes;
      }
    }

    public string HashToBase64(string plainString, Encoding encoding)
    {
      if (plainString == null) throw new ArgumentNullException("plainString");
      return Convert.ToBase64String(Hash(plainString, encoding));
    }
  
 

投稿依頼の送り方はわかったのですが、ここでハッシュを作る必要があります Signature:

名前 行き先 書簡
ログイン トレーダーログイン は、API アクセスページでトレーダーに渡され、オンライン取引所へのリクエストに署名するために使用されます。
パスワード トレーダーパスワード トレーダーがAPIアクセスページで取得し、オンライン取引所へのリクエストに署名するために使用されます。
ウミッド トレーダーズウミッド オンライン取引所での作業時に、トレーダーのWM識別子
文化 問合せ言語 はメッセージの言語を定義します。(ru-RU、en-EN)
サイン 要求署名 パラメータから 生成されたもの: ログイン +';' + パスワード + ';' + カルチャー + ';' +Wmid
 
sergeev:
MD5 ?
MD5ではありません。
 
SHA-256 Source Code (SHA2) - PolarSSL
SHA-256 Source Code (SHA2) - PolarSSL
  • Offspark B.V.
  • tls.mbed.org
In addition to being used for the SHA-256 algorithm, the same code also performs the SHA-224 algorithm. In fact, the SHA-224 hash algorithm is nothing more than the result of the SHA-256 algorithm being cut short. The code only has a single dependency on config.h in the sha2.c source code file. You can remove this inclusion or just create a...
 

世間知らずの私は、既製品が欲しくなってしまいました。

私は甘かった、既製品が欲しかったんです。

ZS:もしかしたらwindowsには、この暗号化を行うライブラリが組み込まれているかもしれませんね。

誤字脱字はごめんなさい。

 
sanyooooook:

シャープ、サネックで書けば、そこはあまり考えなくていい。

すでに4回目の交換で、apiを実装しています :)

サンユウク

ZS:もしかしたらWindowsには、そのような暗号化を行うライブラリが組み込まれているかもしれません。

クリプトエーピーアイ
The Cryptography API, or How to Keep a Secret
The Cryptography API, or How to Keep a Secret
  • msdn.microsoft.com
This article describes the Microsoft® Cryptography application programming interface (API) that is available with the new Windows NT® version 4.0 release and upcoming versions of Windows® 95. This article examines what is required to set up and use this new API. In order to compile the sample application you will need Microsoft Visual C++®...
 
TheXpert:

シャープで書くと、サネック、そこはあまり考えなくていいんです。


私には変えるのは難しい、だからまだmucl4を使っているのだ
理由: