mql4에서 데이터를 해시하는 방법 배우기

 
" 비트코인 및 이와 관련된 모든 것. 암호화폐 매니아와 그 반대자를 위한 서식지. "와 관련이 없는 댓글은 이 주제로 이동되었습니다.
 
동료 시민, 프로그래머, mql4에서 데이터를 해시하는 방법을 가르쳐 주세요(base64에서는 이미 방법을 알고 있는 것 같습니다)
 
Mischek :
예, 지금 어린 아이들을 주십시오.
"늙은 말은 고랑을 망치지 않는다"(민중)
 
sanyooooook :
동료 시민, 프로그래머, mql4에서 데이터를 해시하는 방법을 가르쳐 주세요(base64에서는 이미 방법을 알고 있는 것 같습니다)
MD5가 필요합니까?
 
sergeev :
MD5가 필요합니까?

MD5는 어딘가에서 예를 찾은 것 같습니다


샤256

나는 이것을 보지 못했기 때문에 대부분의 경우 무엇이 필요한지조차 모릅니다. 다음은 화면의 코드 예입니다.

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));
    }
  
 

게시물 요청을 보내는 방법을 알아냈지만 여기에 해시를 만들어야 합니다. 서명:

제목 약속 노트
로그인 상인 로그인 API 액세스 페이지에서 거래자가 수신하고 인터넷 교환 요청에 서명하는 데 사용됩니다.
비밀번호 거래자 비밀번호 API 액세스 페이지에서 거래자가 수신하고 인터넷 교환 요청에 서명하는 데 사용됩니다.
wmid 상인의 Wmid 인터넷 거래소에서 작업할 때 WM 상인 ID
문화 쿼리 언어 메시지의 언어를 정의합니다. (ru-RU, en-EN)
서명 서명 요청 매개변수로 구성됨: Login+ ';' + 비밀번호+ ';' + 문화+ ';' +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...
 

순진한 나는 준비를 원했다.

그것을 발견

추신: 아마도 Windows에는 이러한 암호화를 수행하는 내장 라이브러리가 있을 수 있습니다.

술 취한 실수에 대해 죄송합니다. 수정하기 시작했습니다.

 
sanyooooook :

Sharp, Sanya에 쓰기, 생각할 필요가 거의 없습니다.

벌써 4번째 거래소용 API를 구현하고 있습니다 :)

산요우우우우우우우우우우우우우 :

추신: 아마도 Windows에는 이러한 암호화를 수행하는 내장 라이브러리가 있을 수 있습니다.

크립토API
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 :

Sharp, Sanya에 쓰기, 생각할 필요가 거의 없습니다.


재구축이 어렵기 때문에 여전히 mucle4를 사용 중입니다.