threefoldtecharchive / jumpscaleX_archived

Apache License 2.0
1 stars 6 forks source link

command to generate seed words #798

Open Dina-Abd-Elrahman opened 5 years ago

Dina-Abd-Elrahman commented 5 years ago
zaibon commented 5 years ago

This Question refers to this method: https://github.com/threefoldtech/jumpscaleX/blob/098f1d03aecdadc8d7f0bf50f4caa3c1d99fc463/Jumpscale/data/nacl/NACL.py#L109-L118

@Dina-Abd-Elrahman What behavior would you expect instead ?

Dina-Abd-Elrahman commented 5 years ago

I expect to be saved encrypted somewhere, or at least it asked me for password or key to show it. when I was installing JSX before it mentioned to save this sentence somewhere as you cannot get it again, is it normal now to find command to get it ?

zaibon commented 5 years ago

Well I'm not sure how things were done before. But we have always saved the key on the filesystem. The key is indeed encrypted with or a passphrase or using the SSH key. But in both case we can always load the key from the filesystem. And once you have the key, you can get it's seed, always.

The code in NACL module was very very cumbersome and contain quite some errors. I recently did some cleanun up there, see https://github.com/threefoldtech/jumpscaleX/commit/57fe482aae446553bf1445e2d22a5813ab8fbc79

If you check the change I made, I actually didn't not touch how we load the key from the filesystem. So even before my change there were no password ask or anything to load the key.

If you find anything wrong in my commit, please let me know.

zaibon commented 5 years ago

We ask user to write it down, cause in case of filesystem error, and the key is lost/unreadable. Then you can re-install and give the same mnemonic works to generate the same key you previously had. This is indeed required since everything in BCDB is encrypted using this key, so if you didn't wrote it down, there is now no way for you to recover your data.