deactivating previous random time delta, makes only sense when patching ri too

This commit is contained in:
martin61
2016-12-21 12:18:59 +01:00
parent 7e5738004a
commit 960375356a
4 changed files with 15 additions and 10 deletions

View File

@@ -1,3 +1,7 @@
2016-12-21
* deactivating previous random time delta, makes only sense when patching ri too
* app.Version = "0.1.6"
2016-10-09
* seed the math random generator with time.Now().UnixNano()
* added 6h+6h random time delta at su3-age to increase anonymity

View File

@@ -14,7 +14,7 @@ func main() {
app := cli.NewApp()
app.Name = "i2p-tools"
app.Version = "0.1.5"
app.Version = "0.1.6"
app.Usage = "I2P tools and reseed server"
app.Author = "martin61"
app.Email = "noemail"

View File

@@ -266,14 +266,14 @@ func (db *LocalNetDbImpl) RouterInfos() (routerInfos []routerInfo, err error) {
}
// added 6h+6h random time delta to increase Anonymity
rr := rand.New(rand.NewSource(time.Now().UnixNano()))
now := file.ModTime()
then := now.Add(-1 * time.Duration(rr.Intn(60*60*6) + 60*60*6) * time.Second)
//rr := rand.New(rand.NewSource(time.Now().UnixNano()))
//now := file.ModTime()
//then := now.Add(-1 * time.Duration(rr.Intn(60*60*6) + 60*60*6) * time.Second)
routerInfos = append(routerInfos, routerInfo{
Name: file.Name(),
//ModTime: file.ModTime(),
ModTime: then,
ModTime: file.ModTime(),
//ModTime: then,
Data: riBytes,
})
}

View File

@@ -4,7 +4,7 @@ import (
"bytes"
"crypto"
crypto_rand "crypto/rand"
math_rand "math/rand"
//math_rand "math/rand"
"crypto/rsa"
"crypto/x509"
"encoding/binary"
@@ -56,11 +56,12 @@ type Su3File struct {
func NewSu3File() *Su3File {
// added 6h random time delta to increase Anonymity
rr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
now := time.Now().Unix() - rr.Int63n(60*60*6)
//rr := math_rand.New(math_rand.NewSource(time.Now().UnixNano()))
//now := time.Now().Unix() - rr.Int63n(60*60*6)
return &Su3File{
Version: []byte(strconv.FormatInt(now, 10)),
//Version: []byte(strconv.FormatInt(now, 10)),
Version: []byte(strconv.FormatInt(time.Now().Unix(), 10)),
SignatureType: SIGTYPE_RSA_SHA512,
}
}