简体   繁体   English

从哈希验证脚本中查找服务器种子

[英]Find Server Seed from Hash Verification Script

View this jsfiddle: https://jsfiddle.net/1L1uqcgv/6/查看这个jsfiddle: https ://jsfiddle.net/1L1uqcgv/6/

function refreshTable(){
    var hash = document.getElementById("gameHash").value;
    var lastHash = "";
    var amount = document.getElementById("gameAmount").value;

    var tableBody = document.getElementById("tbody");
    tableBody.innerHTML = "";
    for(var i=0; i<amount; i++){
    var gameHash = (lastHash!=""?genGameHash(lastHash):hash);
    var gameCrash = crashPointFromHash((lastHash!=""?genGameHash(lastHash):hash));
    var clr = gameCrash > 1.97 ? 'green': (gameCrash < 1.97 ? 'red' : 'blue');
    tableBody.innerHTML += "<tr><td>"+gameHash+"</td><td style='background:" + clr + "'>"+gameCrash+"</td></tr>";
    
    lastHash = gameHash;
    }
}


function divisible(hash, mod) {
// So ABCDEFGHIJ should be chunked like  AB CDEF GHIJ
var val = 0;

var o = hash.length % 4;
for (var i = o > 0 ? o - 4 : 0; i < hash.length; i += 4) {
    val = ((val << 16) + parseInt(hash.substring(i, i+4), 16)) % mod;
}

return val === 0;
}

function genGameHash(serverSeed) {
    return CryptoJS.SHA256(serverSeed).toString()
};


function hmac(key, v) {
    var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
    return hmacHasher.finalize(v).toString();
}

function crashPointFromHash(serverSeed) {
// see: provably fair seeding event
var hash = hmac(serverSeed, '000000000000000007a9a31ff7f07463d91af6b5454241d5faf282e5e0fe1b3a');

// In 1 of 101 games the game crashes instantly.
if (divisible(hash, 101))
    return 0;

// Use the most significant 52-bit from the hash to calculate the crash point
var h = parseInt(hash.slice(0,52/4),16);
var e = Math.pow(2,52);

return (Math.floor((100 * e - h) / (e - h))/100).toFixed(2);
};

Is it possible to find the "serverSeed" as shown in lines 31 and 41?是否可以找到第 31 行和第 41 行所示的“serverSeed”? To find previous games, a hash is entered into the box, showing all previous games.要查找以前的游戏,请在框中输入一个哈希,显示所有以前的游戏。 Would serverSeed be used to find these hashes, or does the single hash create all previous hashes? serverSeed 会用于查找这些散列,还是单个散列会创建所有先前的散列?

ServerSeed 是您输入的哈希值,以便查看崩溃点并查看以前的游戏。

Ok I have a question.好的,我有一个问题。

If I know the Seed Hash (SHA-256) and the Client Seed and the Nonce which increases by 1 after every roll.如果我知道种子哈希(SHA-256)和客户端种子以及每次滚动后增加 1 的随机数。

Is there a way to predict what the roll outcome will be known the each and every roll has to be between 00001 and 10000有没有办法预测滚动结果是什么,每个滚动必须在 00001 和 10000 之间

I'm looking to see if there is a way to use the crash value to predict the next roll value.我想看看是否有办法使用崩溃值来预测下一个滚动值。

shot in the dark.在黑暗中拍摄。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM