improve (crypto): derivate secret_key for each usage to reduce attack surface in the worst case scenario

This commit is contained in:
Mickael KERJEAN
2019-01-18 13:48:04 +11:00
parent 7af12753ca
commit ec6eb0e8fa
10 changed files with 53 additions and 26 deletions

View File

@ -15,7 +15,6 @@ import (
var (
Config Configuration
configPath string = filepath.Join(GetCurrentDir(), CONFIG_PATH + "config.json")
SECRET_KEY string
)
type Configuration struct {
@ -321,7 +320,7 @@ func (this *Configuration) Initialise() {
}
this.Save()
}
SECRET_KEY = this.Get("general.secret_key").String()
InitSecretDerivate(this.Get("general.secret_key").String())
}
func (this Configuration) Save() Configuration {