雜湊遊戲原始碼開發搭建丨hash雜湊遊戲競猜原始碼搭建丨雜湊遊戲系統開發

Tg_StPv888發表於2023-02-23

  雜湊演演算法就是把任意長度的輸入變換成固定長度的輸出,每個位元組都會對輸出值產生影響,且無法透過輸出逆向計算得到輸入。


  雜湊演演算法主要包含建構函式及衝突解決兩部分內容。I8O量化2857交易8624系統開發


  The constructor criterion of hash algorithm is relatively simple and uniform,that is,the constructor can quickly calculate the hash value,and the constructor can evenly distribute the keyword set on the output address set{0,1,...,n-1}to ensure the minimum possibility of conflict.


  當前已經提出並被廣泛使用的演演算法包括訊息摘要演演算法(Message-DigestAlgorithm,MD)系列和安全雜湊演演算法(Secure Hash Algorithm,SHA)家族。


  MD系列主要由MIT的Ronald L.Rivest設計,1989年開發出第一個版本MD2演演算法,對輸入值的位元組數補齊成16的倍數,然後再加上一個16位校驗值,最後基於該值輸出雜湊值。但是該方法如果忽略了校驗將會產生衝突。


  為了加強演演算法的安全性,在1990年推出MD4版本。


  但是人們很快就發現了MD4的漏洞,利用當時的一臺個人電腦幾分鐘就可找到MD4中的衝突,即發生碰撞。


  1991年在MD4的基礎上,又增加“安全—帶子”(Safety-belts)的概念,推出MD5版本。


  MD5相比MD4更復雜、更安全,也因此計算速度稍慢。


  MD5在很長一段時間內被廣泛使用,當前主流的程式語言均實現了MD5演演算法。


  但是,現在MD5也被證明不具備“強抗碰撞性”。


  只要透過窮舉的方法,很快就可以找到一組碰撞的輸入。


  由於計算效能的飛躍提升,當前的智慧手機幾秒鐘就可以找到一個hash碰撞的例子,所以MD5已經不推薦作為雜湊方案。


  springboot使用web3進行代幣交換(uniswap):


  import java.math.BigDecimal;


  import java.math.BigInteger;


  import java.util.ArrayList;


  import java.util.List;


  import org.slf4j.Logger;


  import org.slf4j.LoggerFactory;


  import org.springframework.beans.factory.annotation.Autowired;


  import org.springframework.stereotype.Service;


  import org.web3j.abi.FunctionEncoder;


  import org.web3j.abi.TypeReference;


  import org.web3j.abi.datatypes.Address;


  import org.web3j.abi.datatypes.Function;


  import org.web3j.abi.datatypes.StaticArray;


  import org.web3j.abi.datatypes.Type;


  import org.web3j.abi.datatypes.generated.Uint256;


  import org.web3j.crypto.Credentials;


  import org.web3j.crypto.RawTransaction;


  import org.web3j.crypto.TransactionEncoder;


  import org.web3j.protocol.Web3j;


  import org.web3j.protocol.core.methods.response.EthGasPrice;


  import org.web3j.protocol.core.methods.response.EthGetTransactionCount;


  import org.web3j.protocol.core.methods.response.EthGetTransactionReceipt;


  import org.web3j.protocol.core.methods.response.EthSendTransaction;


  import org.web3j.protocol.http.HttpService;


  import org.web3j.utils.Convert;


  import org.web3j.utils.Numeric;


  import io.renren.common.utils.R;


  import net.sf.json.JSONObject;


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70016646/viewspace-2936737/,如需轉載,請註明出處,否則將追究法律責任。

相關文章