diff --git a/history.txt b/history.txt index 3a41203..36a4e13 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,12 @@ +2016-10-09 + * seed the math random generator with time.Now().UnixNano() + * added 6h+6h random time delta at su3-age to increase anonymity + * app.Version = "0.1.5" + + 2016-05-15 * README.md updated - * allowed routerInfos age increased from 96 to 192 + * allowed routerInfos age increased from 96 to 192 hours * app.Version = "0.1.4" 2016-03-05 diff --git a/main.go b/main.go index 2eb534e..87b895c 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ func main() { app := cli.NewApp() app.Name = "i2p-tools" - app.Version = "0.1.4" + app.Version = "0.1.5" app.Usage = "I2P tools and reseed server" app.Author = "martin61" app.Email = "noemail" diff --git a/reseed/service.go b/reseed/service.go index c862b11..7edb38d 100644 --- a/reseed/service.go +++ b/reseed/service.go @@ -265,9 +265,15 @@ func (db *LocalNetDbImpl) RouterInfos() (routerInfos []routerInfo, err error) { continue } + // 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) + routerInfos = append(routerInfos, routerInfo{ Name: file.Name(), - ModTime: file.ModTime(), + //ModTime: file.ModTime(), + ModTime: then, Data: riBytes, }) } diff --git a/su3/su3.go b/su3/su3.go index b059716..e66bbdb 100644 --- a/su3/su3.go +++ b/su3/su3.go @@ -3,7 +3,8 @@ package su3 import ( "bytes" "crypto" - "crypto/rand" + crypto_rand "crypto/rand" + math_rand "math/rand" "crypto/rsa" "crypto/x509" "encoding/binary" @@ -53,8 +54,13 @@ 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) + return &Su3File{ - Version: []byte(strconv.FormatInt(time.Now().Unix(), 10)), + Version: []byte(strconv.FormatInt(now, 10)), SignatureType: SIGTYPE_RSA_SHA512, } } @@ -78,7 +84,7 @@ func (s *Su3File) Sign(privkey *rsa.PrivateKey) error { h.Write(s.BodyBytes()) digest := h.Sum(nil) - sig, err := rsa.SignPKCS1v15(rand.Reader, privkey, 0, digest) + sig, err := rsa.SignPKCS1v15(crypto_rand.Reader, privkey, 0, digest) if nil != err { return err }