From 7b9599124874a6fc876d803dfec4ff8d424e2a2e Mon Sep 17 00:00:00 2001 From: moneromooo Date: Fri, 30 Jan 2015 18:27:34 +0000 Subject: [PATCH] Use a site games salt, and use more random bits for the server seed --- tipbot/betutils.py | 5 +++-- tipbot/config.py.example | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tipbot/betutils.py b/tipbot/betutils.py index 5168e36..5084578 100644 --- a/tipbot/betutils.py +++ b/tipbot/betutils.py @@ -13,6 +13,7 @@ import random import hashlib import time import datetime +from Crypto.Random.random import getrandbits import tipbot.coinspecs as coinspecs from tipbot.command_manager import * from utils import * @@ -101,8 +102,8 @@ def GetServerSeed(link,game): def GenerateServerSeed(link,game): identity=link.identity() try: - salt="kfn3kjg4nkngvekjvn3u4vgb" + ":" + game - s=salt+":"+identity+":"+str(time.time())+":"+str(random.randint(0,1000000)) + salt="kfn3kjg4nkngvekjvn3u4vgb:" + config.site_game_salt + ":" + game + s=salt+":"+identity+":"+str(time.time())+":"+str(getrandbits(128)) seed=hashlib.sha256(s).hexdigest() SetServerSeed(link,game,seed) except Exception,e: diff --git a/tipbot/config.py.example b/tipbot/config.py.example index aae2523..600dcee 100644 --- a/tipbot/config.py.example +++ b/tipbot/config.py.example @@ -26,6 +26,7 @@ withdrawal_mixin=0 disable_withdraw_on_error = True payment_confirmations = 6 tipbot_balance_cache_time = 35 # seconds +site_game_salt = '' admins = ["freenode:moneromooo", "freenode:moneromoo"]