Use a site games salt, and use more random bits for the server seed

This commit is contained in:
moneromooo 2015-01-30 18:27:34 +00:00
parent c03f518b96
commit 7b95991248
2 changed files with 4 additions and 2 deletions

View file

@ -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:

View file

@ -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"]